| | |
| | | * 解析报文 |
| | | */ |
| | | public UPExgMsgRegister decode(UPExgMsg exgMsg) { |
| | | byte[] data = exgMsg.getData(); |
| | | ByteBuf byteBuf = Unpooled.wrappedBuffer(data); |
| | | this.vehicleNo = exgMsg.getVehicleNo(); |
| | | this.vehicleColor = exgMsg.getVehicleColor(); |
| | | this.dataType = exgMsg.getDataType(); |
| | | this.dataLength = exgMsg.getDataLength(); |
| | | |
| | | //平台唯一编码 |
| | | this.platformId = Jtt809Util.readGBKString(byteBuf, 11); |
| | | //车载终端厂商唯一编码 |
| | | this.producerId = Jtt809Util.readGBKString(byteBuf, 11); |
| | | //车载终端型号 |
| | | this.terminalModelType = Jtt809Util.readGBKString(byteBuf, 8); |
| | | //车载终端编号 |
| | | this.terminalId = Jtt809Util.readGBKString(byteBuf, 7); |
| | | //车载终端SIM卡电话号码 |
| | | this.terminalSIMCode = Jtt809Util.readGBKString(byteBuf, 12); |
| | | try { |
| | | byte[] data = exgMsg.getData(); |
| | | ByteBuf byteBuf = Unpooled.wrappedBuffer(data); |
| | | this.vehicleNo = exgMsg.getVehicleNo(); |
| | | this.vehicleColor = exgMsg.getVehicleColor(); |
| | | this.dataType = exgMsg.getDataType(); |
| | | this.dataLength = exgMsg.getDataLength(); |
| | | |
| | | //平台唯一编码 |
| | | this.platformId = Jtt809Util.readGBKString(byteBuf, 11); |
| | | //车载终端厂商唯一编码 |
| | | this.producerId = Jtt809Util.readGBKString(byteBuf, 11); |
| | | //车载终端型号 |
| | | this.terminalModelType = Jtt809Util.readGBKString(byteBuf, 8); |
| | | //车载终端编号 |
| | | this.terminalId = Jtt809Util.readGBKString(byteBuf, 7); |
| | | //车载终端SIM卡电话号码 |
| | | this.terminalSIMCode = Jtt809Util.readGBKString(byteBuf, 12); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return this; |
| | | } |
| | | } |