mobile CCTV,mobile surveillance,police body worn cameras

标题: CU SDK 发送消息 字段丢失 [打印本页]

author: LJJ    time: 2019-7-10 14:47
标题: CU SDK 发送消息 字段丢失
CU SDK 发送位置消息的时候,添加字段
  1. imMsgs.im_Msg[0].szTextMsg = address;
copycode



发送数据
  1. {"iCount":1,"im_Msg":[{"iMsgID":0,"iSourceIndex":0,"iType":3,"stGPSData":{"bAntennaState":0,"bOrientationState":0,"iAngle":0,"iHeight":0,"iLatitude":312055880,"iLongitude":1214701735,"iSatelliteSignal":0,"iSpeed":0,"iStarCount":0},"szTextMsg":"之俊大厦-2座附近31米"}]}
copycode
另外一段接受
  1. {"iCount":1,"im_Msg":[{"iMsgID":14050,"iSourceIndex":7342,"iType":3,"stGPSData":{"bAntennaState":0,"bOrientationState":0,"iAngle":0,"iHeight":0,"iLatitude":312055880,"iLongitude":1214701735,"iSatelliteSignal":0,"iSpeed":0,"iStarCount":0,"stTime":{"iDay":0,"iHour":0,"iMinute":0,"iMonth":0,"iSecond":0,"iYear":0}},"stSendTime":{"iDay":10,"iHour":6,"iMinute":43,"iMonth":7,"iSecond":47,"iYear":2019},"szSourceID":"UA_29973668","szTargetID":"CONF_5CECE1A6"}]}
copycode
丢失了 szTextMsg字段 ,请问怎么解决


author: xuwei    time: 2019-7-10 14:51
发送GPS消息时,只能填写GPS数据,发送文本消息时,textmsg才生效
author: hardfire    time: 2019-7-10 14:51
哈哈,兄弟,代码开发,要自己动手丰衣足食。我们研发超忙。
author: LJJ    time: 2019-7-10 14:57
hardfire post on2019-7-10 14:51
哈哈,兄弟,代码开发,要自己动手丰衣足食。我们研发超忙。

为什么会丢呢。。就搞不懂啊兄弟
author: xuwei    time: 2019-7-10 15:21
LJJ post on2019-7-10 14:57
为什么会丢呢。。就搞不懂啊兄弟

这不是丢,是你的消息类型填写错了,一个消息只能传输一种类型的负载,是消息类型决定了哪种负载有效,位置消息类型对应GPS负载有效,文本消息类型,对应文本负载有效。




欢迎光临 mobile CCTV,mobile surveillance,police body worn cameras (http://bbs.besovideo.com:8067/) Powered by Discuz! X3.2