|
@@ -0,0 +1,235 @@
|
|
|
+// 注册功能编码说明:10:设备请求注册,11:服务器设备注册信息,12:设备注册完成确认,13:服务器确认设备注册完成
|
|
|
+// 未注册设备接收消息订阅:$regdrx,发送消息订阅:$regdtx
|
|
|
+// 注册完成的设备发送消息订阅:$dtx/d1,接收消息订阅:$drx/d1,其中“d1”是服务器返回的信息。
|
|
|
+// 服务器订阅,发送消息订阅:$regdrx,$drx/d1,$drx/d2……,接收消息订阅:$regdtx,$dtx/d1,$dtx/d2……
|
|
|
+// 注册报文,client->server,使用授权信息:登录名为:regUser,密码为:RE12we,mqtt地址为:view.ailishi.org:1883
|
|
|
+device_register_10 = {
|
|
|
+ "m": "10",
|
|
|
+ "t": "$regdtx",
|
|
|
+ "r": "$regdrx",
|
|
|
+ "data": {
|
|
|
+ "regnum": "19999942"// 设备随机码
|
|
|
+ }
|
|
|
+};
|
|
|
+// 设备注册完成,client->server,
|
|
|
+device_register_ok_12 = {
|
|
|
+ "m": "12",
|
|
|
+ "t": "$dtx/d1", //发送订阅主题
|
|
|
+ "r": "$drx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "deviceid": "d1" //mqtt服务器登陆名
|
|
|
+ }
|
|
|
+};
|
|
|
+// 服务器返回设备授权码,server->client
|
|
|
+server_register_11 = {
|
|
|
+ "m": "11",
|
|
|
+ "t": "$regdrx",
|
|
|
+ "r": "$regdtx",
|
|
|
+ "data": {
|
|
|
+ "regnum": "1234343242",//设备唯一码
|
|
|
+ "deviceid": "d1", //mqtt服务器登陆名
|
|
|
+ "password": "1234"// mqtt服务器密码
|
|
|
+ }
|
|
|
+};
|
|
|
+// 服务器返回设备注册完成消息,server->client
|
|
|
+server_register_ok_13 = {
|
|
|
+ "m": "13",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "deviceid": "d1", //mqtt服务器登陆名
|
|
|
+ "res": "ok"// 注册成功标记
|
|
|
+ }
|
|
|
+};
|
|
|
+// 注册结束
|
|
|
+// 上传位置信息功能,20:
|
|
|
+// 位置信息上传,无网络情况下设备本地最多可存储100条数据,有网络后上传到服务器上,并清除本地储存,client->server
|
|
|
+device_location_20 = {
|
|
|
+ "m": "20",
|
|
|
+ "t": "$dtx/d1", //发送订阅主题
|
|
|
+ "r": "$drx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "deviceid": "d1",
|
|
|
+ "type": 1,// 1:实时数据,2:补发数据
|
|
|
+ "batterynum": 80, // 电量
|
|
|
+ "signalnum": 25, // 信号强度
|
|
|
+ "mode": 1,//0:无法定位,1:北斗定位,2:基站定位,3:GPS定位
|
|
|
+ "lon": "xxxx.xxxx",//精度
|
|
|
+ "lat": "xxxx.xxx",//纬度
|
|
|
+ "speed": 2.3, //速度
|
|
|
+ "num": 3,// 收星颗数
|
|
|
+ "createtime": "", //数据时间
|
|
|
+ "uploadtime": ""//上传时间
|
|
|
+ }
|
|
|
+};
|
|
|
+// 服务器发送设备配置信息,tag为0表示没有更新设置,1表示有更新,设备应去获取对应更新,server->client
|
|
|
+server_device_config_tag_21 = {
|
|
|
+ "m": "21",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "deviceid": "d1",
|
|
|
+ "uploadtag": "0",//数据上传频率
|
|
|
+ "owntag": "0",//持有者配置
|
|
|
+ "sostag": "0",// 紧急联系人设置
|
|
|
+ "valtag": "0",//音量设置
|
|
|
+ "timetag": "0",//整点报时设置
|
|
|
+ "hongontag": "0",//自动接听设置
|
|
|
+ "whitetag": "0",// 白名单设置
|
|
|
+ "servertag": "0",//服务器设置
|
|
|
+ "msgtag": "0"//语音播报内容设置
|
|
|
+ }
|
|
|
+};
|
|
|
+// 设置有更新,设备向服务器请求更新数据,client->server
|
|
|
+device_set_uploadtag_30 = {
|
|
|
+ "m": "30",
|
|
|
+ "t": "$dtx/d1", //发送订阅主题
|
|
|
+ "r": "$drx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "settag": "uploadtag",//设置类型
|
|
|
+ "res": 0//请求更新,1为设置完成
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+//服务器端返回配置信息,server->client
|
|
|
+server_set_device_31 = {
|
|
|
+ "m": "31",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "network": 0,// 0上传数据时打开网络链接,1一直保持网络链接
|
|
|
+ "rate": 0//0-6,0:15S上传一次位置信息,
|
|
|
+ //1:1分钟上传一次位置信息
|
|
|
+ //2:10分钟上传一次位置信息
|
|
|
+ //3:30分钟上传一次位置信息
|
|
|
+ //4:1小时上传一次位置信息
|
|
|
+ //5:2小时上传一次位置信息
|
|
|
+ //6:6小时上传一次位置信息
|
|
|
+ //7:12小时上传一次位置信息
|
|
|
+
|
|
|
+ }
|
|
|
+};
|
|
|
+// 持有者
|
|
|
+server_set_device_32 = {
|
|
|
+ "m": "32",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "username": "",// 持有者姓名
|
|
|
+ "cardid": "",//持有者证件号码
|
|
|
+ "memo": ""//备注信息
|
|
|
+ }
|
|
|
+};
|
|
|
+//紧急联系人设置
|
|
|
+server_set_device_33 = {
|
|
|
+ "m": "33",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+
|
|
|
+ "key0_keynum": "key1",//按键编号
|
|
|
+ "key0_type": 1, //1只拨打第一个电话,2电话1无人接听时拨打第二个电话
|
|
|
+ "key0_name": "",// 姓名
|
|
|
+ "key0_phone": "",//电话
|
|
|
+ "key0_name2": "",// 备用联系人
|
|
|
+ "key0_phone2": "",//
|
|
|
+ "key0_msg": "",//短信内容,可以为空,不设置不打电话
|
|
|
+
|
|
|
+ "key1_keynum": "key2",//按键编号
|
|
|
+ "key1_type": 1, //1只拨打第一个电话,2电话1无人接听时拨打第二个电话
|
|
|
+ "key1_name": "",// 姓名
|
|
|
+ "key1_phone": "",//电话
|
|
|
+ "key1_name2": "",// 备用联系人
|
|
|
+ "key1_phone2": "",//
|
|
|
+ "key1_msg": "",//短信内容,可以为空,不设置不打电话
|
|
|
+
|
|
|
+ "key2_keynum": "key3",//按键编号
|
|
|
+ "key2_type": 1, //1只拨打第一个电话,2电话1无人接听时拨打第二个电话
|
|
|
+ "key2_name": "",// 姓名
|
|
|
+ "key2_phone": "",//电话
|
|
|
+ "key2_name2": "",// 备用联系人
|
|
|
+ "key2_phone2": "",//
|
|
|
+ "key2_msg": ""//短信内容,可以为空,不设置不打电话
|
|
|
+
|
|
|
+ }
|
|
|
+};
|
|
|
+// 音量设置,
|
|
|
+server_set_device_34 = {
|
|
|
+ "m": "34",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "msgvol": 5,// 0-10,系统通知
|
|
|
+ "phonevol": 5,//0-10,通话音量
|
|
|
+ "msgtype": 3// 电话铃声,设备里的铃声编号
|
|
|
+ }
|
|
|
+};
|
|
|
+// 整点报时设置,server_set_device_35
|
|
|
+server_set_device_35 = {
|
|
|
+ "m": "35",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "clock": 1// 0关闭整点报时,1打开整点报时
|
|
|
+ }
|
|
|
+};
|
|
|
+// 自动接听设置
|
|
|
+server_set_device_36 = {
|
|
|
+ "m": "36",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "autoanswer": 1// 1自动接听,0不自动接听
|
|
|
+ }
|
|
|
+};
|
|
|
+//白名单设置,白名单中的号码来电,播报来电人姓名,如:张三来电,张三来电;白名单以外的电话号码来电,播报手机号,如:13833812345来电……
|
|
|
+server_set_device_37 = {
|
|
|
+ "m": "37",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "whitetag": 1,// 0关闭白名单,1打开白名单
|
|
|
+
|
|
|
+ "name0": "张三",//姓名
|
|
|
+ "phone0": "",//电话号码
|
|
|
+ "name1": "张三",//姓名
|
|
|
+ "phone1": "",//电话号码
|
|
|
+ "name9": "张三",//姓名
|
|
|
+ "phone9": ""//电话号码
|
|
|
+
|
|
|
+ }
|
|
|
+};
|
|
|
+// 服务器端口号设置
|
|
|
+server_set_device_38 = {
|
|
|
+ "m": "38",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "serverhost": "",
|
|
|
+ "serverport": ""
|
|
|
+ }
|
|
|
+};
|
|
|
+//语音播报
|
|
|
+server_set_device_39 = {
|
|
|
+ "m": "39",
|
|
|
+ "t": "$drx/d1", //发送订阅主题
|
|
|
+ "r": "$dtx/d1", //接收订阅主题
|
|
|
+ "data": {
|
|
|
+ "newstime": "",// 语音播放时间,到时间后开始播放内容
|
|
|
+ "newstype": "1",// 播报类型,1,实时播报,0,延时播报,等到newstime的时间点再播放。
|
|
|
+ "news": "",//服务器下发文字,播报完自动删除
|
|
|
+ "newsurl": ""//音频文件url,有内容的话,播放此音频文件
|
|
|
+ }
|
|
|
+};
|
|
|
+// 基站信息
|
|
|
+c2s_40 = {
|
|
|
+ "m": "40",
|
|
|
+ "t": "$dtx/5a0966ac50d14fa7831db53ab3200008",
|
|
|
+ "r": "$drx/5a0966ac50d14fa7831db53ab3200008",
|
|
|
+ "data": {
|
|
|
+ "cellinf0": "460.1.9550.102075144.28",// 临近基站1
|
|
|
+ "cellinf1": "460.1.9538.102218501.6",// 临近基站2
|
|
|
+ "createTime": "20200722102239",
|
|
|
+ "uploadTime": "20200722102239"
|
|
|
+ }
|
|
|
+};
|