예제 #1
0
        /// <summary>
        /// 方法说明:SDK发送终端消息接口:心跳消息、请求离线消息
        /// 完成时间:2017-05-16
        /// </summary>
        /// <param name="entity">发送消息实体</param>
        /// <param name="errorMsg">提示信息</param>
        /// <returns>是否成功发送消息</returns>
        public bool SdkPublishTerminalMsg <T>(T entity, ref string errorMsg) where T : SdkMsTerminalBase
        {
            var isheartBeat = false;
            var jsonStr     = MsgConverter.GetJsonByTerminalMsg <T>(entity, ref isheartBeat, ref errorMsg);

            return(!string.IsNullOrEmpty(jsonStr) &&
                   Publish(TopicSend.sdk_user.ToString(), jsonStr, isheartBeat, ref errorMsg));
        }