|
@@ -133,11 +133,27 @@ public class DiscardServerHandler extends ChannelInboundHandlerAdapter {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * [3G*3918197044*015E*UD2,200917,004156,V,31.027562,N,121.4171983,E,0.00,0.0,0.0,0,38,61,13641,0,
|
|
|
- * 00000010,6,0,460,0,6234,57810,122,6234,57458,126,6234,57459,123,6234,57811,120,6234,57443,119,
|
|
|
- * 6233,61458,113,5,808A,34:96:72:1c:81:b1,-57,tidecloud,f4:83:cd:22:e4:e9,-62,parking,be:5f:f6:11:fd:2c,-65,
|
|
|
- * office1_2.4GHz,20:6b:e7:42:39:60,-70,Guest_2.4GHz,2:6b:e7:42:39:60,-70,14.1]
|
|
|
+ /* 数据[手表具体数据] [对应位数] [数据内容]
|
|
|
+ * 3G*3918197044*0107*UD [0] [厂商*设备 ID*内容长度*内容类型]
|
|
|
+ 200917 [1] 日期
|
|
|
+ 054140 [2] 时间
|
|
|
+ V [3] gps定位是否有效[A]有效,[V]无效
|
|
|
+ 31.171093 [4] 纬度
|
|
|
+ N [5] 纬度表示
|
|
|
+ 121.4215967 [6] 经度
|
|
|
+ E [7] 经度表示
|
|
|
+ 0.00 [8] 速度
|
|
|
+ 0.0 [9] 方向
|
|
|
+ 0.0 [10] 海拔
|
|
|
+ 0 [11] 卫星个数
|
|
|
+ 42,50 [12] gsm信号强度
|
|
|
+ 14420 [13] 电量
|
|
|
+ 0 [14] 计步数
|
|
|
+ 00000010 [15] 终端状态
|
|
|
+ 7,255 [16]
|
|
|
+ 460 [17]
|
|
|
+ 0 [18]
|
|
|
+ ... ...
|
|
|
*/
|
|
|
private Device getDevice(String msg) throws Exception {
|
|
|
int startIndex = msg.indexOf("[");
|
|
@@ -159,9 +175,9 @@ public class DiscardServerHandler extends ChannelInboundHandlerAdapter {
|
|
|
device.setLat(getDouble(bodys[4]));
|
|
|
device.setLng(getDouble(bodys[6]));
|
|
|
device.setSpeed(getDouble(bodys[8]));
|
|
|
- device.setElectric(getDouble(bodys[14]));
|
|
|
- device.setStep(getInteger(bodys[15]));
|
|
|
- device.setItemState(bodys[17]);
|
|
|
+ device.setElectric(getDouble(bodys[13]));
|
|
|
+ device.setStep(getInteger(bodys[14]));
|
|
|
+ device.setItemState(bodys[15]);
|
|
|
// getDouble()
|
|
|
logger.info("设备上传具体监控项信息:" + device.toString());
|
|
|
return device;
|