├── jt1078 ├── doc │ ├── images │ │ ├── jt1078-message-flow.png │ │ └── jt1078-component-flow.png │ ├── jt1078-component-flow.plantuml │ └── jt1078-message-flow.plantuml ├── src │ └── main │ │ └── java │ │ └── ai │ │ └── sangmado │ │ └── gbprotocol │ │ └── jt1078 │ │ └── protocol │ │ ├── exceptions │ │ ├── UnsupportedJT1078OperationException.java │ │ ├── UnsupportedJT1078MessageException.java │ │ └── UnsupportedJT1078ProtocolVersionException.java │ │ └── message │ │ └── content │ │ └── JT1078_Message_Content_0x9003.java └── README.md ├── gb17691 ├── doc │ ├── images │ │ └── gb17691-message-flow.png │ └── gb17691-message-flow.plantuml ├── README.md └── src │ └── main │ └── java │ └── ai │ └── sangmado │ └── gbprotocol │ └── gb17691 │ └── protocol │ └── exceptions │ ├── UnsupportedGB17691OperationException.java │ ├── UnsupportedGB17691MessageException.java │ └── UnsupportedGB17691ProtocolVersionException.java ├── jt808db32t3610 ├── doc │ ├── images │ │ └── warning-file-upload-flow.png │ └── warning-file-upload-flow.plantuml ├── README.md └── src │ └── main │ └── java │ └── ai │ └── sangmado │ └── gbprotocol │ └── jt808db32t3610 │ └── protocol │ ├── exceptions │ ├── UnsupportedJT808DB32T3610OperationException.java │ ├── UnsupportedJT808DB32T3610MessageException.java │ └── UnsupportedJT808DB32T3610ProtocolVersionException.java │ └── message │ └── content │ └── JT808DB32T3610_WarningFileDescription.java ├── gbcommon ├── src │ └── main │ │ └── java │ │ └── ai │ │ └── sangmado │ │ └── gbprotocol │ │ └── gbcommon │ │ ├── enums │ │ ├── IExtension.java │ │ ├── IProtocolVersion.java │ │ └── IMessageId.java │ │ ├── memory │ │ ├── IBufferPool.java │ │ ├── PooledByteArray.java │ │ └── PooledByteArrayFactory.java │ │ ├── serializer │ │ ├── LongToHexStringSerializer.java │ │ ├── LongToHex4StringSerializer.java │ │ ├── LongToHex8StringSerializer.java │ │ ├── IntegerToHexStringSerializer.java │ │ ├── IntegerToHex2StringSerializer.java │ │ ├── IntegerToHex4StringSerializer.java │ │ └── IntegerToHex8StringSerializer.java │ │ └── utils │ │ ├── BCD.java │ │ └── CRC16.java └── pom.xml ├── jt808db51chuanbiao ├── README.md └── src │ └── main │ └── java │ └── ai │ └── sangmado │ └── gbprotocol │ └── jt808db51chuanbiao │ └── protocol │ ├── exceptions │ ├── UnsupportedJT808DB51ChuanBiaoOperationException.java │ ├── UnsupportedJT808DB51ChuanBiaoMessageException.java │ └── UnsupportedJT808DB51ChuanBiaoProtocolVersionException.java │ └── message │ └── content │ └── JT808DB51ChuanBiao_WarningFileDescription.java ├── gb19056 ├── README.md └── src │ └── main │ └── java │ └── ai │ └── sangmado │ └── gbprotocol │ └── gb19056 │ └── protocol │ ├── message │ ├── content │ │ ├── GB19056MessageBlock.java │ │ ├── reply │ │ │ ├── GB19056_Reply_Message_Block_0x03.java │ │ │ ├── GB19056_Reply_Message_Block_0x00.java │ │ │ ├── GB19056_Reply_Message_Block_0x01.java │ │ │ ├── GB19056_Reply_Message_Block_0x02.java │ │ │ └── GB19056_Reply_Message_Block_0x04.java │ │ ├── command │ │ │ ├── GB19056_Command_Message_Block_0x00.java │ │ │ ├── GB19056_Command_Message_Block_0x01.java │ │ │ ├── GB19056_Command_Message_Block_0x02.java │ │ │ ├── GB19056_Command_Message_Block_0x03.java │ │ │ └── GB19056_Command_Message_Block_0x04.java │ │ └── GB19056MessagePacket.java │ └── extension │ │ └── GB19056MessageExtension.java │ └── exceptions │ ├── UnsupportedGB19056OperationException.java │ ├── UnsupportedGB19056MessageException.java │ └── UnsupportedGB19056ProtocolVersionException.java ├── jt808db23heibiao ├── README.md └── src │ └── main │ └── java │ └── ai │ └── sangmado │ └── gbprotocol │ └── jt808db23heibiao │ └── protocol │ ├── exceptions │ ├── UnsupportedJT808DB23HeiBiaoOperationException.java │ ├── UnsupportedJT808DB23HeiBiaoMessageException.java │ └── UnsupportedJT808DB23HeiBiaoProtocolVersionException.java │ └── message │ └── content │ └── JT808DB23HeiBiao_WarningFileDescription.java ├── .gitignore ├── jt809 ├── src │ └── main │ │ └── java │ │ └── ai │ │ └── sangmado │ │ └── gbprotocol │ │ └── jt809 │ │ └── protocol │ │ ├── enums │ │ ├── JT809MessageContentEncryptionOptions.java │ │ └── JT809VersionFlag.java │ │ ├── IVersionedSpecificationContext.java │ │ ├── exceptions │ │ ├── UnsupportedJT809OperationException.java │ │ ├── InvalidJT809MessageChecksumException.java │ │ ├── UnsupportedJT809ProtocolVersionException.java │ │ └── UnsupportedJT809MessageException.java │ │ ├── serialization │ │ ├── IJT809MessageFormatter.java │ │ ├── IJT809MessageBufferReader.java │ │ └── IJT809MessageBufferWriter.java │ │ ├── message │ │ ├── IJT809VersioningMessage.java │ │ ├── JT809MessageAssembler.java │ │ ├── content │ │ │ ├── JT809MessageContentRegistration.java │ │ │ ├── JT809_Message_Content_0x1400_Sub │ │ │ │ ├── JT809_Message_Content_0x1400_SubMessageRegistration.java │ │ │ │ └── JT809_Message_Content_0x1400_SubMessage.java │ │ │ └── JT809MessageContent.java │ │ ├── IJT809Message.java │ │ └── header │ │ │ └── JT809MessageHeaderRegistration.java │ │ └── ISpecificationContext.java └── README.md ├── jt808 ├── src │ └── main │ │ └── java │ │ └── ai │ │ └── sangmado │ │ └── gbprotocol │ │ └── jt808 │ │ └── protocol │ │ ├── IVersionedSpecificationContext.java │ │ ├── message │ │ ├── content │ │ │ ├── JT808_Message_Content_Passthrough_Message │ │ │ │ ├── JT808_Message_Content_0x0900_Base.java │ │ │ │ ├── JT808_Message_Content_0x8900_Base.java │ │ │ │ ├── JT808_Message_Content_0x0900_Registration.java │ │ │ │ ├── JT808_Message_Content_0x0900_Message_0x0B.java │ │ │ │ └── JT808_Message_Content_0x0900_Message_0x00.java │ │ │ ├── JT808_Message_Content_0x8103_Parameter │ │ │ │ └── JT808_Message_Content_0x8103_ParameterItem.java │ │ │ ├── JT808_Message_Content_0x0200_Additional │ │ │ │ └── JT808_Message_Content_0x0200_AdditionalInformation.java │ │ │ ├── JT808_Message_Content_0x0002.java │ │ │ ├── JT808_Message_Content_0x0003.java │ │ │ ├── JT808_Message_Content_0x8104.java │ │ │ ├── JT808_Message_Content_0x8201.java │ │ │ ├── JT808_Message_Content_0x8204.java │ │ │ ├── JT808_Message_Content_0x0004.java │ │ │ ├── JT808_Message_Content_0x8107.java │ │ │ ├── JT808_Message_Content_0x8702.java │ │ │ ├── JT808_Message_Content_0x0A00.java │ │ │ ├── JT808_Message_Content_0x8A00.java │ │ │ ├── JT808_Message_Content_0x8805.java │ │ │ ├── JT808_Message_Content_0x0901.java │ │ │ └── JT808_Message_Content_0x0108.java │ │ ├── IJT808VersioningMessage.java │ │ ├── header │ │ │ ├── JT808MessageHeaderMessagePacketProperty.java │ │ │ ├── JT808MessageHeaderMessageContentProperty.java │ │ │ └── JT808MessageHeaderRegistration.java │ │ └── IJT808Message.java │ │ ├── exceptions │ │ ├── UnsupportedJT808OperationException.java │ │ ├── InvalidJT808MessageChecksumException.java │ │ ├── UnsupportedJT808ProtocolVersionException.java │ │ └── UnsupportedJT808MessageException.java │ │ ├── serialization │ │ ├── IJT808MessageFormatter.java │ │ ├── IJT808MessageBufferWriter.java │ │ └── IJT808MessageBufferReader.java │ │ ├── ISpecificationContext.java │ │ └── utils │ │ └── StringsConverter.java └── README.md ├── jt808db22jibiao ├── README.md └── src │ └── main │ └── java │ └── ai │ └── sangmado │ └── gbprotocol │ └── jt808db22jibiao │ └── protocol │ ├── exceptions │ ├── UnsupportedJT808DB22JiBiaoOperationException.java │ ├── UnsupportedJT808DB22JiBiaoMessageException.java │ └── UnsupportedJT808DB22JiBiaoProtocolVersionException.java │ └── message │ └── content │ ├── JT808DB22JiBiao_WarningFileDescription.java │ └── JT808DB22JiBiao_Message_Content_0x8E12.java ├── jt905 ├── src │ └── main │ │ └── java │ │ └── ai │ │ └── sangmado │ │ └── gbprotocol │ │ └── jt905 │ │ └── protocol │ │ ├── IVersionedSpecificationContext.java │ │ ├── message │ │ ├── content │ │ │ └── JT905MessageContent.java │ │ ├── IJT905Message.java │ │ └── header │ │ │ └── JT905MessageHeader.java │ │ ├── exceptions │ │ ├── UnsupportedJT905OperationException.java │ │ ├── InvalidJT905MessageChecksumException.java │ │ ├── UnsupportedJT905MessageException.java │ │ └── UnsupportedJT905ProtocolVersionException.java │ │ ├── serialization │ │ ├── IJT905MessageFormatter.java │ │ ├── IJT905MessageBufferWriter.java │ │ └── IJT905MessageBufferReader.java │ │ └── ISpecificationContext.java └── README.md ├── gb32960 ├── src │ └── main │ │ └── java │ │ └── ai │ │ └── sangmado │ │ └── gbprotocol │ │ └── gb32960 │ │ └── protocol │ │ ├── IVersionedSpecificationContext.java │ │ ├── message │ │ ├── IGB32960DeviceMessage.java │ │ ├── IGB32960PlatformMessage.java │ │ ├── header │ │ │ ├── device │ │ │ │ └── GB32960DeviceMessageHeaderRegistration.java │ │ │ └── platform │ │ │ │ └── GB32960PlatformMessageHeaderRegistration.java │ │ └── content │ │ │ ├── device │ │ │ ├── GB32960DeviceMessageContentRegistration.java │ │ │ ├── GB32960DeviceMessageContent.java │ │ │ └── GB32960_Device_Message_Content_0x04.java │ │ │ └── platform │ │ │ ├── GB32960PlatformMessageContentRegistration.java │ │ │ └── GB32960PlatformMessageContent.java │ │ ├── exceptions │ │ ├── UnsupportedGB32960OperationException.java │ │ ├── InvalidGB32960MessageChecksumException.java │ │ ├── UnsupportedGB32960MessageException.java │ │ └── UnsupportedGB32960ProtocolVersionException.java │ │ ├── serialization │ │ ├── IGB32960MessageFormatter.java │ │ ├── IGB32960MessageBufferReader.java │ │ └── IGB32960MessageBufferWriter.java │ │ └── ISpecificationContext.java └── README.md ├── jt809db32t3610 ├── README.md └── src │ └── main │ └── java │ └── ai │ └── sangmado │ └── gbprotocol │ └── jt809db32t3610 │ └── protocol │ ├── exceptions │ ├── UnsupportedJT809DB32T3610OperationException.java │ ├── UnsupportedJT809DB32T3610MessageException.java │ └── UnsupportedJT809DB32T3610ProtocolVersionException.java │ └── message │ └── extension │ └── JT809DB32T3610MessageExtension.java ├── jt808db37lubiao ├── README.md └── src │ └── main │ └── java │ └── ai │ └── sangmado │ └── gbprotocol │ └── jt808db37lubiao │ └── protocol │ ├── exceptions │ ├── UnsupportedJT808DB37LuBiaoOperationException.java │ ├── UnsupportedJT808DB37LuBiaoMessageException.java │ └── UnsupportedJT808DB37LuBiaoProtocolVersionException.java │ └── message │ └── content │ ├── JT808DB37LuBiao_WarningFileDescription.java │ ├── JT808DB37LuBiao_Message_Content_0x0E10.java │ ├── JT808DB37LuBiao_Message_Content_0x0E11.java │ ├── JT808DB37LuBiao_Message_Content_0x0E12.java │ ├── JT808DB37LuBiao_Message_Content_0x8E11.java │ ├── JT808DB37LuBiao_Message_Content_0x8E12.java │ └── JT808DB37LuBiao_Message_Content_0x8E10.java ├── settings.xml └── LICENSE /jt1078/doc/images/jt1078-message-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaochundong/gbprotocol/HEAD/jt1078/doc/images/jt1078-message-flow.png -------------------------------------------------------------------------------- /gb17691/doc/images/gb17691-message-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaochundong/gbprotocol/HEAD/gb17691/doc/images/gb17691-message-flow.png -------------------------------------------------------------------------------- /jt1078/doc/images/jt1078-component-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaochundong/gbprotocol/HEAD/jt1078/doc/images/jt1078-component-flow.png -------------------------------------------------------------------------------- /jt808db32t3610/doc/images/warning-file-upload-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaochundong/gbprotocol/HEAD/jt808db32t3610/doc/images/warning-file-upload-flow.png -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/enums/IExtension.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.enums; 2 | 3 | /** 4 | * 扩展接口定义 5 | */ 6 | public interface IExtension { 7 | } 8 | -------------------------------------------------------------------------------- /jt808db51chuanbiao/README.md: -------------------------------------------------------------------------------- 1 | # 四川省地方标准 2 | 3 | 四川省道路运输车辆主动安全智能防控系统技术规范 第3部分 通讯协议 4 | 5 | ## 协议依赖 6 | 7 | - JT/T808-2011 道路运输车辆卫星定位系统终端通讯协议及数据格式 8 | - JT/T809-2011 道路运输车辆卫星定位系统平台数据交换 9 | - JT/T1078-2016 道路运输车辆卫星定位系统视频通信协议 10 | -------------------------------------------------------------------------------- /gb17691/README.md: -------------------------------------------------------------------------------- 1 | # GB17691协议 2 | 3 | GB17691 重型柴油车污染物排放限值及测量方法 4 | 5 | ## 附录Q 远程排放管理车载终端的技术要求及通信数据格式 6 | 7 | 数据类型和传输规则符合 GB/T32960.3 附录B.3.1的要求。 8 | 9 | 车载终端登入成功后,应至少每10s向管理平台上报OBD信息和数据实时信息。 10 | 11 | ![GB17691 Q.1 车载终端与管理平台通信协议栈](./doc/images/gb17691-message-flow.png) 12 | -------------------------------------------------------------------------------- /gb19056/README.md: -------------------------------------------------------------------------------- 1 | # GB19056协议 2 | 3 | GB/T 19056 汽车行驶记录仪 4 | 5 | ## GB19056 与 JT808 标准对焦 6 | 7 | 在GB19056中,记录仪与通讯机通过RS232接口进行通信。而通讯机是实现了JT808标准的设备,该设备实现JT808标准中关于行驶记录仪相关的协议消息,包括: 8 | - 0x8700 行驶记录仪数据采集命令 9 | - 0x8701 行驶记录仪参数下传命令 10 | - 0x0700 行驶记录仪数据上传 11 | 12 | 在此意义上,可以理解为,实现上GB19056协议是JT808协议的一个扩展。 13 | -------------------------------------------------------------------------------- /jt808db23heibiao/README.md: -------------------------------------------------------------------------------- 1 | # 黑龙江省地方标准 2 | 3 | 黑龙江省道路运输车辆智能视频监控报警系统通讯协议技术要求 4 | 5 | ## 协议依赖 6 | 7 | - JT/T 808-2019 道路运输车辆卫星定位系统终端通讯协议及数据格式。 8 | - JT/T 1078-2016 道路运输车辆卫星定位系统视频通信协议。 9 | 10 | ## 特点 11 | 12 | - 0x8103 增加了ADAS/DMS/主备服务器地址 13 | - 0x0200 增加了ADAS/DMS/电子地图/路网图 14 | - 增加驾驶员身份识别功能 15 | - 增加设备状态汇总上报日报 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | 25 | # Maven files 26 | *.factorypath 27 | -------------------------------------------------------------------------------- /gb17691/doc/gb17691-message-flow.plantuml: -------------------------------------------------------------------------------- 1 | @startuml 2 | skinparam backgroundColor #EEEBDC 3 | skinparam handwritten false 4 | 5 | title GB17691 Q.1 车载终端与管理平台通信协议栈 6 | 7 | participant 车载终端 8 | participant 管理平台 9 | 10 | 车载终端 -> 管理平台 : 车辆登出(0x04) 11 | 车载终端 -> 管理平台 : 实时信息上报(0x02) 12 | 车载终端 -> 管理平台 : 车辆登入(0x01) 13 | 车载终端 <-> 管理平台 : 本标准所规定的协议 14 | 车载终端 <-> 管理平台 : TCP 15 | 车载终端 <-> 管理平台 : IP 16 | 车载终端 <-> 管理平台 : 底层承载 17 | 18 | @enduml 19 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/enums/JT809MessageContentEncryptionOptions.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.enums; 2 | 3 | import lombok.*; 4 | 5 | /** 6 | * 消息体加密参数 7 | */ 8 | @Getter 9 | @Setter 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | @Builder 13 | public class JT809MessageContentEncryptionOptions { 14 | 15 | private Long IA1; 16 | 17 | private Long IC1; 18 | 19 | private Long M1; 20 | } 21 | -------------------------------------------------------------------------------- /jt808db32t3610/README.md: -------------------------------------------------------------------------------- 1 | # 江苏省地方标准 DB32/T3610.3 2 | 3 | 道路运输车辆主动安全智能防控系统 技术规范 第3部分:通讯协议 4 | 5 | Technical specification of active safety intelligent prevention and control system for road transportation vehicles Part3:Communication protocol 6 | 7 | ## 协议依赖 8 | 9 | - JT/T808-2011 道路运输车辆卫星定位系统终端通讯协议及数据格式 10 | - JT/T809-2011 道路运输车辆卫星定位系统平台数据交换 11 | - JT/T1078-2016 道路运输车辆卫星定位系统视频通信协议 12 | 13 | ## 苏标报警附件文件上传流程 14 | 15 | ![苏标报警附件文件上传流程](doc/images/warning-file-upload-flow.png) 16 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/IVersionedSpecificationContext.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808ProtocolVersion; 4 | 5 | /** 6 | * 协议版本上下文 7 | */ 8 | public interface IVersionedSpecificationContext extends ISpecificationContext { 9 | 10 | /** 11 | * 获取协议版本 12 | * 13 | * @return 协议版本 14 | */ 15 | JT808ProtocolVersion getProtocolVersion(); 16 | } 17 | -------------------------------------------------------------------------------- /jt808db22jibiao/README.md: -------------------------------------------------------------------------------- 1 | # 吉林省地方标准 2 | 3 | 团体标准 T/JLYSXH 1.3—2019 4 | 5 | 道路运输车辆智能视频监控报警系统技术规范 第3部分:通讯协议 6 | 7 | Technical specification for Intelligent video surveillance and alarm system for road transport vehicle Part III: Communication Protocol 8 | 9 | ## 协议依赖 10 | 11 | - JT/T 808 道路运输车辆卫星定位系统终端通讯协议及数据格式 12 | - JT/T 1078-2016 道路运输车辆卫星定位系统视频通信协议 13 | - GB/T 26773-2011 营运车辆行驶危险预警系统技术要求和试验方法 14 | - JT/T 883-2014 智能运输系统车道偏离报警系统性能要求与检测方法 15 | 16 | ## 特点 17 | 18 | - 增加了人脸库和比对功能 19 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/IVersionedSpecificationContext.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol; 2 | 3 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809ProtocolVersion; 4 | 5 | /** 6 | * 协议版本上下文 7 | */ 8 | public interface IVersionedSpecificationContext extends ISpecificationContext { 9 | 10 | /** 11 | * 获取协议版本 12 | * 13 | * @return 协议版本 14 | */ 15 | JT809ProtocolVersion getProtocolVersion(); 16 | } 17 | -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/IVersionedSpecificationContext.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol; 2 | 3 | import ai.sangmado.gbprotocol.jt905.protocol.enums.JT905ProtocolVersion; 4 | 5 | /** 6 | * 协议版本上下文 7 | */ 8 | public interface IVersionedSpecificationContext extends ISpecificationContext { 9 | 10 | /** 11 | * 获取协议版本 12 | * 13 | * @return 协议版本 14 | */ 15 | JT905ProtocolVersion getProtocolVersion(); 16 | } 17 | -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/enums/IProtocolVersion.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.enums; 2 | 3 | /** 4 | * 协议版本接口定义 5 | */ 6 | public interface IProtocolVersion extends Comparable { 7 | 8 | /** 9 | * 获取协议版本名称 10 | */ 11 | String getName(); 12 | 13 | /** 14 | * 获取协议版本整型值 15 | */ 16 | Integer getValue(); 17 | 18 | /** 19 | * 获取协议版本描述 20 | */ 21 | String getDescription(); 22 | } 23 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/IVersionedSpecificationContext.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960ProtocolVersion; 4 | 5 | /** 6 | * 协议版本上下文 7 | */ 8 | public interface IVersionedSpecificationContext extends ISpecificationContext { 9 | 10 | /** 11 | * 获取协议版本 12 | * 13 | * @return 协议版本 14 | */ 15 | GB32960ProtocolVersion getProtocolVersion(); 16 | } 17 | -------------------------------------------------------------------------------- /jt809db32t3610/README.md: -------------------------------------------------------------------------------- 1 | # 江苏省地方标准 DB32/T3610.3 2 | 3 | 道路运输车辆主动安全智能防控系统 技术规范 第3部分:通讯协议 4 | 5 | Technical specification of active safety intelligent prevention and control system for road transportation vehicles Part3:Communication protocol 6 | 7 | 终端与平台协议基本约定如下: 8 | - a) 协议的通讯方式、数据类型、传输规则和消息组成按照JT/T 808-2011中第4章的要求; 9 | - b) 协议中报文分类参照JT/T 1078-2016中第4.3节分类方式; 10 | - c) 协议中信令数据报文的通信连接方式按照JT/T 808-2011中第5章的要求; 11 | - d) 协议中信令数据报文的消息处理机制按照JT/T 808-2011中第6章的要求; 12 | - e) 协议中信令数据报文的加密机制按照JT/T 808-2011中第7章的要求; 13 | -------------------------------------------------------------------------------- /jt808db37lubiao/README.md: -------------------------------------------------------------------------------- 1 | # 山东省地方标准 2 | 3 | 山东道路运输车辆主动安全智能防控系统-通讯协议规范 4 | 5 | ## 协议依赖 6 | 7 | - JT/T 808-2019 道路运输车辆卫星定位系统终端通讯协议及数据格式。 8 | - JT/T 1078-2016 道路运输车辆卫星定位系统视频通信协议。 9 | - GB/T 26773-2011 营运车辆行驶危险预警系统技术要求和试验方法。 10 | - JT/T 883-2014 智能运输系统 车道偏离报警系统性能要求与检测方法。 11 | 12 | ## 特点 13 | 14 | - 0x8103 增加了ADAS/DMS/BSD/胎压监测/驾驶员比对 15 | - 0x0200 增加了ADAS/DMS/BSD/胎压监测 16 | - 增加了人脸识别功能 17 | - 要求支持设备端人脸识别功能,设备端识别的准确率要高于97%,支持侧脸比对,设备端存储驾驶员模型数据容量大于10条。 18 | - 基于人脸识别实现如下功能:点火、换人、同一驾驶员驾驶时长超过4小时上传疲劳驾驶报警信息和驾驶员照片及身份标识。 19 | -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/enums/IMessageId.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.enums; 2 | 3 | /** 4 | * 消息ID接口定义 5 | */ 6 | public interface IMessageId extends Comparable, IExtension { 7 | 8 | /** 9 | * 获取消息名称 10 | */ 11 | String getName(); 12 | 13 | /** 14 | * 获取消息ID 15 | */ 16 | Integer getValue(); 17 | 18 | /** 19 | * 获取消息协议版本 20 | */ 21 | IProtocolVersion getSince(); 22 | 23 | /** 24 | * 获取消息描述 25 | */ 26 | String getDescription(); 27 | } 28 | -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/memory/IBufferPool.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.memory; 2 | 3 | /** 4 | * 池化数组接口 5 | */ 6 | public interface IBufferPool { 7 | 8 | /** 9 | * 获取池化数组长度 10 | * 11 | * @return 数组长度 12 | */ 13 | int getArraySize(); 14 | 15 | /** 16 | * 借一个数组 17 | * 18 | * @return 数组对象 19 | */ 20 | PooledByteArray borrow(); 21 | 22 | /** 23 | * 还一个数组 24 | * 25 | * @param pooledByteArray 数组对象 26 | */ 27 | void recycle(PooledByteArray pooledByteArray); 28 | } 29 | -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/message/content/JT905MessageContent.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt905.protocol.enums.JT905MessageId; 4 | import ai.sangmado.gbprotocol.jt905.protocol.serialization.IJT905MessageFormatter; 5 | 6 | /** 7 | * JT905 消息体 8 | */ 9 | public abstract class JT905MessageContent implements IJT905MessageFormatter { 10 | 11 | /** 12 | * 获取消息体定义的消息ID 13 | * 14 | * @return 消息ID 15 | */ 16 | public abstract JT905MessageId getMessageId(); 17 | } 18 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/GB19056MessageBlock.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 5 | 6 | /** 7 | * GB19056 消息体 - 数据块 8 | */ 9 | public abstract class GB19056MessageBlock implements IJT808MessageFormatter { 10 | 11 | /** 12 | * 获取消息体定义的消息ID 13 | * 14 | * @return 消息ID 15 | */ 16 | public abstract T getMessageId(); 17 | } 18 | -------------------------------------------------------------------------------- /gb32960/README.md: -------------------------------------------------------------------------------- 1 | # GB32960协议 2 | 3 | GB/T32960 Technical specifications of remote service and management system for electric vehicles, 4 | Part 3: Communication protocol and data format 5 | 6 | GB/T32960 电动汽车远程服务与管理系统技术规范 第3部分:通信协议及数据格式 7 | 8 | ## 数据包结构和定义 9 | 10 | | 起始符1 | 起始符2 | 命令标识 | 应答标志 | 唯一识别码 | 数据单元加密方式 | 数据单元长度 | 数据单元 | 校验码 | 11 | | :----------: | :----------: | :-------: | :------: | :--------: | :--------------: | :-----------: | :------: | :------: | 12 | | BeginMarker1 | BeginMarker2 | CommandId | ReplyId | VIN | EncryptionMode | ContentLength | Content | Checksum | 13 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_Passthrough_Message/JT808_Message_Content_0x0900_Base.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808_Message_Content_Passthrough_Message; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 4 | import lombok.NoArgsConstructor; 5 | 6 | /** 7 | * 透传消息抽象类 - 0x0900 8 | */ 9 | @NoArgsConstructor 10 | public abstract class JT808_Message_Content_0x0900_Base implements IJT808MessageFormatter { 11 | 12 | /** 13 | * 获取透传消息类型 14 | * 15 | * @return 透传消息类型 16 | */ 17 | public abstract JT808_Message_Content_Passthrough_MessageType getPassthroughMessageType(); 18 | } 19 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_Passthrough_Message/JT808_Message_Content_0x8900_Base.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808_Message_Content_Passthrough_Message; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 4 | import lombok.NoArgsConstructor; 5 | 6 | /** 7 | * 透传消息抽象类 - 0x8900 8 | */ 9 | @NoArgsConstructor 10 | public abstract class JT808_Message_Content_0x8900_Base implements IJT808MessageFormatter { 11 | 12 | /** 13 | * 获取透传消息类型 14 | * 15 | * @return 透传消息类型 16 | */ 17 | public abstract JT808_Message_Content_Passthrough_MessageType getPassthroughMessageType(); 18 | } 19 | -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/message/IJT905Message.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol.message; 2 | 3 | import ai.sangmado.gbprotocol.jt905.protocol.enums.JT905MessageId; 4 | import ai.sangmado.gbprotocol.jt905.protocol.enums.JT905ProtocolVersion; 5 | import ai.sangmado.gbprotocol.jt905.protocol.serialization.IJT905MessageFormatter; 6 | 7 | /** 8 | * JT905 消息通用接口 9 | */ 10 | public interface IJT905Message extends IJT905MessageFormatter { 11 | /** 12 | * 获取协议版本 13 | * 14 | * @return 协议版本 15 | */ 16 | JT905ProtocolVersion getProtocolVersion(); 17 | 18 | /** 19 | * 获取消息ID 20 | * 21 | * @return 消息ID 22 | */ 23 | JT905MessageId getMessageId(); 24 | } 25 | -------------------------------------------------------------------------------- /jt1078/doc/jt1078-component-flow.plantuml: -------------------------------------------------------------------------------- 1 | @startuml 2 | 3 | title JT1078组件交互示意图 4 | 5 | actor [用户1] 6 | actor [用户2] 7 | component [车载终端] 8 | component [Web服务器] 9 | component [JT1078信令服务器] 10 | component [JT1078流媒体服务器] 11 | component [HLS服务器] 12 | component [RTMP服务器] 13 | 14 | [用户1] -[#007ED6]> [Web服务器]: 点击UI实时直播按钮 15 | [用户2] -[#007ED6]> [Web服务器]: 点击UI实时直播按钮 16 | 17 | [Web服务器] -[#007ED6]> [JT1078信令服务器]: 请求实时直播视频 18 | [JT1078信令服务器] <-[#007ED6]> [JT1078流媒体服务器]: 请求流媒体接收地址 19 | [JT1078信令服务器] -[#007ED6]> [车载终端]: 下发0x0901指令 20 | [车载终端] ..[#FF0000]> [JT1078流媒体服务器]: 发送RTP媒体流 21 | 22 | [JT1078流媒体服务器] ..[#FF0000]> [HLS服务器]: 打包HLS切片 23 | [用户1] <..[#FF0000]> [HLS服务器]: 拉取HLS切片 24 | 25 | [JT1078流媒体服务器] ..[#FF0000]> [RTMP服务器]: 封装音视频流 26 | [RTMP服务器] ..[#FF0000]> [用户2]: 发送RTMP音视频流 27 | 28 | @enduml 29 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/message/IGB32960DeviceMessage.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.message; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960DeviceCommandId; 4 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960ProtocolVersion; 5 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageFormatter; 6 | 7 | /** 8 | * GB32960 消息通用接口 (终端) 9 | */ 10 | public interface IGB32960DeviceMessage extends IGB32960MessageFormatter { 11 | /** 12 | * 获取协议版本 13 | * 14 | * @return 协议版本 15 | */ 16 | GB32960ProtocolVersion getProtocolVersion(); 17 | 18 | /** 19 | * 获取命令ID 20 | * 21 | * @return 命令ID 22 | */ 23 | GB32960DeviceCommandId getCommandId(); 24 | } 25 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/exceptions/UnsupportedJT808OperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.exceptions; 2 | 3 | /** 4 | * 不支持协议操作异常 5 | */ 6 | public class UnsupportedJT808OperationException extends RuntimeException { 7 | static final long serialVersionUID = 8796577638288634770L; 8 | 9 | public UnsupportedJT808OperationException() { 10 | this("暂不支持该协议操作"); 11 | } 12 | 13 | public UnsupportedJT808OperationException(String message) { 14 | super(message); 15 | } 16 | 17 | public UnsupportedJT808OperationException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public UnsupportedJT808OperationException(Throwable cause) { 22 | super(cause); 23 | } 24 | } -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/exceptions/UnsupportedJT809OperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.exceptions; 2 | 3 | /** 4 | * 不支持协议操作异常 5 | */ 6 | public class UnsupportedJT809OperationException extends RuntimeException { 7 | static final long serialVersionUID = -7900740943722150014L; 8 | 9 | public UnsupportedJT809OperationException() { 10 | this("暂不支持该协议操作"); 11 | } 12 | 13 | public UnsupportedJT809OperationException(String message) { 14 | super(message); 15 | } 16 | 17 | public UnsupportedJT809OperationException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public UnsupportedJT809OperationException(Throwable cause) { 22 | super(cause); 23 | } 24 | } -------------------------------------------------------------------------------- /jt905/README.md: -------------------------------------------------------------------------------- 1 | # JT905协议 2 | 3 | JT/T905 Taxi service and management information system - Part2: Special operation equipment 4 | 5 | JT/T905 出租汽车服务管理信息系统 第2部分:运营专用设备 6 | 7 | ## JT905协议消息数据结构 8 | 9 | ### 消息结构 JT905MessagePackage 10 | 11 | 每条消息由标识位、消息头、消息体、校验码组成。 12 | 13 | | 头标识 | 消息头 | 消息体 | 校验码 | 尾标识 | 14 | | :---------: | :----------------: | :-----------------: | :------: | :-------: | 15 | | BeginMarker | JT905MessageHeader | JT905MessageContent | Checksum | EndMarker | 16 | | 0x7e | - | - | - | 0x7e | 17 | 18 | ### 消息头 JT905MessageHeader 19 | 20 | | 消息ID | 消息体属性 | ISU标识 | 消息流水号 | 21 | | :-------: | :-----------: | :-----: | :----------: | 22 | | MessageId | ContentLength | ISU | SerialNumber | 23 | 24 | -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/exceptions/UnsupportedJT905OperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol.exceptions; 2 | 3 | /** 4 | * 不支持协议操作异常 5 | */ 6 | public class UnsupportedJT905OperationException extends RuntimeException { 7 | static final long serialVersionUID = 7190837226015908943L; 8 | 9 | public UnsupportedJT905OperationException() { 10 | this("暂不支持该协议操作"); 11 | } 12 | 13 | public UnsupportedJT905OperationException(String message) { 14 | super(message); 15 | } 16 | 17 | public UnsupportedJT905OperationException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public UnsupportedJT905OperationException(Throwable cause) { 22 | super(cause); 23 | } 24 | } -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/message/IGB32960PlatformMessage.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.message; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960PlatformCommandId; 4 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960ProtocolVersion; 5 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageFormatter; 6 | 7 | /** 8 | * GB32960 消息通用接口 (平台) 9 | */ 10 | public interface IGB32960PlatformMessage extends IGB32960MessageFormatter { 11 | /** 12 | * 获取协议版本 13 | * 14 | * @return 协议版本 15 | */ 16 | GB32960ProtocolVersion getProtocolVersion(); 17 | 18 | /** 19 | * 获取命令ID 20 | * 21 | * @return 命令ID 22 | */ 23 | GB32960PlatformCommandId getCommandId(); 24 | } 25 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/serialization/IJT808MessageFormatter.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.serialization; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | 5 | /** 6 | * JT808 消息序列化器 7 | */ 8 | public interface IJT808MessageFormatter { 9 | 10 | /** 11 | * 将JT808消息对象序列化后写入Buffer 12 | * 13 | * @param ctx 协议规范上下文 14 | * @param writer Buffer写入器 15 | */ 16 | void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer); 17 | 18 | /** 19 | * 从Buffer读取数据并反序列化后构建JT808消息对象 20 | * 21 | * @param ctx 协议规范上下文 22 | * @param reader Buffer读取器 23 | */ 24 | void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader); 25 | } -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/serialization/IJT809MessageFormatter.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.serialization; 2 | 3 | import ai.sangmado.gbprotocol.jt809.protocol.IVersionedSpecificationContext; 4 | 5 | /** 6 | * JT809 消息序列化器 7 | */ 8 | public interface IJT809MessageFormatter { 9 | 10 | /** 11 | * 将JT809消息对象序列化后写入Buffer 12 | * 13 | * @param ctx 协议规范上下文 14 | * @param writer Buffer写入器 15 | */ 16 | void serialize(IVersionedSpecificationContext ctx, IJT809MessageBufferWriter writer); 17 | 18 | /** 19 | * 从Buffer读取数据并反序列化后构建JT809消息对象 20 | * 21 | * @param ctx 协议规范上下文 22 | * @param reader Buffer读取器 23 | */ 24 | void deserialize(IVersionedSpecificationContext ctx, IJT809MessageBufferReader reader); 25 | } -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/serialization/IJT905MessageFormatter.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol.serialization; 2 | 3 | import ai.sangmado.gbprotocol.jt905.protocol.IVersionedSpecificationContext; 4 | 5 | /** 6 | * JT905 消息序列化器 7 | */ 8 | public interface IJT905MessageFormatter { 9 | 10 | /** 11 | * 将JT905消息对象序列化后写入Buffer 12 | * 13 | * @param ctx 协议规范上下文 14 | * @param writer Buffer写入器 15 | */ 16 | void serialize(IVersionedSpecificationContext ctx, IJT905MessageBufferWriter writer); 17 | 18 | /** 19 | * 从Buffer读取数据并反序列化后构建JT905消息对象 20 | * 21 | * @param ctx 协议规范上下文 22 | * @param reader Buffer读取器 23 | */ 24 | void deserialize(IVersionedSpecificationContext ctx, IJT905MessageBufferReader reader); 25 | } -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/exceptions/InvalidJT808MessageChecksumException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.exceptions; 2 | 3 | /** 4 | * 无效的消息校验码异常 5 | */ 6 | public class InvalidJT808MessageChecksumException extends RuntimeException { 7 | static final long serialVersionUID = -8292016349079936925L; 8 | 9 | public InvalidJT808MessageChecksumException() { 10 | this("无效的消息校验码"); 11 | } 12 | 13 | public InvalidJT808MessageChecksumException(String message) { 14 | super(message); 15 | } 16 | 17 | public InvalidJT808MessageChecksumException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public InvalidJT808MessageChecksumException(Throwable cause) { 22 | super(cause); 23 | } 24 | } -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/exceptions/InvalidJT809MessageChecksumException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.exceptions; 2 | 3 | /** 4 | * 无效的消息校验码异常 5 | */ 6 | public class InvalidJT809MessageChecksumException extends RuntimeException { 7 | static final long serialVersionUID = -1583356138533718648L; 8 | 9 | public InvalidJT809MessageChecksumException() { 10 | this("无效的消息校验码"); 11 | } 12 | 13 | public InvalidJT809MessageChecksumException(String message) { 14 | super(message); 15 | } 16 | 17 | public InvalidJT809MessageChecksumException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public InvalidJT809MessageChecksumException(Throwable cause) { 22 | super(cause); 23 | } 24 | } -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/exceptions/InvalidJT905MessageChecksumException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol.exceptions; 2 | 3 | /** 4 | * 无效的消息校验码异常 5 | */ 6 | public class InvalidJT905MessageChecksumException extends RuntimeException { 7 | static final long serialVersionUID = 4117039868431199537L; 8 | 9 | public InvalidJT905MessageChecksumException() { 10 | this("无效的消息校验码"); 11 | } 12 | 13 | public InvalidJT905MessageChecksumException(String message) { 14 | super(message); 15 | } 16 | 17 | public InvalidJT905MessageChecksumException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public InvalidJT905MessageChecksumException(Throwable cause) { 22 | super(cause); 23 | } 24 | } -------------------------------------------------------------------------------- /gb17691/src/main/java/ai/sangmado/gbprotocol/gb17691/protocol/exceptions/UnsupportedGB17691OperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb17691.protocol.exceptions; 2 | 3 | /** 4 | * 不支持协议操作异常 5 | */ 6 | public class UnsupportedGB17691OperationException extends RuntimeException { 7 | static final long serialVersionUID = 6389610690309860958L; 8 | 9 | public UnsupportedGB17691OperationException() { 10 | this("暂不支持该协议操作"); 11 | } 12 | 13 | public UnsupportedGB17691OperationException(String message) { 14 | super(message); 15 | } 16 | 17 | public UnsupportedGB17691OperationException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public UnsupportedGB17691OperationException(Throwable cause) { 22 | super(cause); 23 | } 24 | } -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/exceptions/UnsupportedGB32960OperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.exceptions; 2 | 3 | /** 4 | * 不支持协议操作异常 5 | */ 6 | public class UnsupportedGB32960OperationException extends RuntimeException { 7 | static final long serialVersionUID = 1608244261368497438L; 8 | 9 | public UnsupportedGB32960OperationException() { 10 | this("暂不支持该协议操作"); 11 | } 12 | 13 | public UnsupportedGB32960OperationException(String message) { 14 | super(message); 15 | } 16 | 17 | public UnsupportedGB32960OperationException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public UnsupportedGB32960OperationException(Throwable cause) { 22 | super(cause); 23 | } 24 | } -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/exceptions/UnsupportedGB19056OperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.exceptions; 2 | 3 | /** 4 | * 不支持协议操作异常 5 | */ 6 | public class UnsupportedGB19056OperationException extends RuntimeException { 7 | static final long serialVersionUID = -8189267007359958827L; 8 | 9 | public UnsupportedGB19056OperationException() { 10 | this("暂不支持该协议操作"); 11 | } 12 | 13 | public UnsupportedGB19056OperationException(String message) { 14 | super(message); 15 | } 16 | 17 | public UnsupportedGB19056OperationException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public UnsupportedGB19056OperationException(Throwable cause) { 22 | super(cause); 23 | } 24 | } -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/exceptions/InvalidGB32960MessageChecksumException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.exceptions; 2 | 3 | /** 4 | * 无效的消息校验码异常 5 | */ 6 | public class InvalidGB32960MessageChecksumException extends RuntimeException { 7 | static final long serialVersionUID = -1571494177605459617L; 8 | 9 | public InvalidGB32960MessageChecksumException() { 10 | this("无效的消息校验码"); 11 | } 12 | 13 | public InvalidGB32960MessageChecksumException(String message) { 14 | super(message); 15 | } 16 | 17 | public InvalidGB32960MessageChecksumException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | public InvalidGB32960MessageChecksumException(Throwable cause) { 22 | super(cause); 23 | } 24 | } -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/serialization/IGB32960MessageFormatter.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.serialization; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.IVersionedSpecificationContext; 4 | 5 | /** 6 | * GB32960 消息序列化器 7 | */ 8 | public interface IGB32960MessageFormatter { 9 | 10 | /** 11 | * 将GB32960消息对象序列化后写入Buffer 12 | * 13 | * @param ctx 协议规范上下文 14 | * @param writer Buffer写入器 15 | */ 16 | void serialize(IVersionedSpecificationContext ctx, IGB32960MessageBufferWriter writer); 17 | 18 | /** 19 | * 从Buffer读取数据并反序列化后构建GB32960消息对象 20 | * 21 | * @param ctx 协议规范上下文 22 | * @param reader Buffer读取器 23 | */ 24 | void deserialize(IVersionedSpecificationContext ctx, IGB32960MessageBufferReader reader); 25 | } -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/ISpecificationContext.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.memory.IBufferPool; 4 | 5 | import java.nio.ByteOrder; 6 | import java.nio.charset.Charset; 7 | 8 | /** 9 | * 协议上下文 10 | */ 11 | public interface ISpecificationContext extends Cloneable { 12 | 13 | /** 14 | * 获取字节序 15 | *

16 | * 大端(Big-Endian)字节序:高字节存于内存低地址,低字节存于内存高地址。 17 | * 小端(Little-Endian)字节序:低字节存于内存低地址,高字节存于内存高地址。 18 | * 19 | * @return 字节序 20 | */ 21 | ByteOrder getByteOrder(); 22 | 23 | /** 24 | * 获取字符集 25 | * 26 | * @return 字符集 27 | */ 28 | Charset getCharset(); 29 | 30 | /** 31 | * 获取数组池 32 | * 33 | * @return 数组池 34 | */ 35 | IBufferPool getBufferPool(); 36 | } 37 | -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/ISpecificationContext.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.memory.IBufferPool; 4 | 5 | import java.nio.ByteOrder; 6 | import java.nio.charset.Charset; 7 | 8 | /** 9 | * 协议上下文 10 | */ 11 | public interface ISpecificationContext extends Cloneable { 12 | 13 | /** 14 | * 获取字节序 15 | *

16 | * 大端(Big-Endian)字节序:高字节存于内存低地址,低字节存于内存高地址。 17 | * 小端(Little-Endian)字节序:低字节存于内存低地址,高字节存于内存高地址。 18 | * 19 | * @return 字节序 20 | */ 21 | ByteOrder getByteOrder(); 22 | 23 | /** 24 | * 获取字符集 25 | * 26 | * @return 字符集 27 | */ 28 | Charset getCharset(); 29 | 30 | /** 31 | * 获取数组池 32 | * 33 | * @return 数组池 34 | */ 35 | IBufferPool getBufferPool(); 36 | } 37 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/ISpecificationContext.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.memory.IBufferPool; 4 | 5 | import java.nio.ByteOrder; 6 | import java.nio.charset.Charset; 7 | 8 | /** 9 | * 协议上下文 10 | */ 11 | public interface ISpecificationContext extends Cloneable { 12 | 13 | /** 14 | * 获取字节序 15 | *

16 | * 大端(Big-Endian)字节序:高字节存于内存低地址,低字节存于内存高地址。 17 | * 小端(Little-Endian)字节序:低字节存于内存低地址,高字节存于内存高地址。 18 | * 19 | * @return 字节序 20 | */ 21 | ByteOrder getByteOrder(); 22 | 23 | /** 24 | * 获取字符集 25 | * 26 | * @return 字符集 27 | */ 28 | Charset getCharset(); 29 | 30 | /** 31 | * 获取数组池 32 | * 33 | * @return 数组池 34 | */ 35 | IBufferPool getBufferPool(); 36 | } 37 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/IJT808VersioningMessage.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808ProtocolVersion; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 6 | import com.fasterxml.jackson.annotation.JsonIgnore; 7 | 8 | /** 9 | * JT808 版本化消息 10 | */ 11 | public interface IJT808VersioningMessage extends IJT808MessageFormatter { 12 | /** 13 | * 获取协议版本 14 | * 15 | * @return 协议版本 16 | */ 17 | @JsonIgnore 18 | JT808ProtocolVersion getProtocolVersion(); 19 | 20 | /** 21 | * 获取消息ID 22 | * 23 | * @return 消息ID 24 | */ 25 | @JsonIgnore 26 | JT808MessageId getMessageId(); 27 | } 28 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/message/IJT809VersioningMessage.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.message; 2 | 3 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809MessageId; 4 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809ProtocolVersion; 5 | import ai.sangmado.gbprotocol.jt809.protocol.serialization.IJT809MessageFormatter; 6 | import com.fasterxml.jackson.annotation.JsonIgnore; 7 | 8 | /** 9 | * JT809 版本化消息 10 | */ 11 | public interface IJT809VersioningMessage extends IJT809MessageFormatter { 12 | /** 13 | * 获取协议版本 14 | * 15 | * @return 协议版本 16 | */ 17 | @JsonIgnore 18 | JT809ProtocolVersion getProtocolVersion(); 19 | 20 | /** 21 | * 获取消息ID 22 | * 23 | * @return 消息ID 24 | */ 25 | @JsonIgnore 26 | JT809MessageId getMessageId(); 27 | } 28 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x8103_Parameter/JT808_Message_Content_0x8103_ParameterItem.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808_Message_Content_0x8103_Parameter; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 4 | import lombok.NoArgsConstructor; 5 | 6 | /** 7 | * 平台设置终端参数 - 参数项 8 | */ 9 | @NoArgsConstructor 10 | public abstract class JT808_Message_Content_0x8103_ParameterItem implements IJT808MessageFormatter { 11 | 12 | /** 13 | * 获取参数项ID 14 | * 15 | * @return 参数项ID 16 | */ 17 | public abstract JT808_Message_Content_0x8103_ParameterItemId getParameterItemId(); 18 | 19 | /** 20 | * 获取参数项长度 21 | * 22 | * @return 参数项长度 23 | */ 24 | public abstract Integer getParameterItemLength(); 25 | } 26 | -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/serializer/LongToHexStringSerializer.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.serializer; 2 | 3 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase; 5 | 6 | /** 7 | * 整数转16进制字符串 8 | */ 9 | public class LongToHexStringSerializer extends ToStringSerializerBase { 10 | public final static ToStringSerializer instance = new ToStringSerializer(); 11 | 12 | public LongToHexStringSerializer() { 13 | super(Object.class); 14 | } 15 | 16 | public LongToHexStringSerializer(Class handledType) { 17 | super(handledType); 18 | } 19 | 20 | @Override 21 | @SuppressWarnings("RedundantCast") 22 | public String valueToString(Object value) { 23 | return "0x" + String.format("%X", (Long) value).toUpperCase(); 24 | } 25 | } -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/header/JT808MessageHeaderMessagePacketProperty.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.header; 2 | 3 | import lombok.*; 4 | 5 | /** 6 | * JT808 消息头中消息包封装项 7 | */ 8 | @Getter 9 | @Setter 10 | @AllArgsConstructor(access = AccessLevel.PROTECTED) 11 | @NoArgsConstructor 12 | @Builder 13 | public class JT808MessageHeaderMessagePacketProperty implements Cloneable { 14 | 15 | /** 16 | * 消息总包数 17 | */ 18 | private Integer totalPackets; 19 | 20 | /** 21 | * 包序号 22 | */ 23 | private Integer packetSequence; 24 | 25 | /** 26 | * 克隆对象 27 | * 28 | * @return 克隆对象 29 | */ 30 | @Override 31 | public JT808MessageHeaderMessagePacketProperty clone() throws CloneNotSupportedException { 32 | return (JT808MessageHeaderMessagePacketProperty) super.clone(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/serializer/LongToHex4StringSerializer.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.serializer; 2 | 3 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase; 5 | 6 | /** 7 | * 整数转16进制字符串,宽度为4 8 | */ 9 | public class LongToHex4StringSerializer extends ToStringSerializerBase { 10 | public final static ToStringSerializer instance = new ToStringSerializer(); 11 | 12 | public LongToHex4StringSerializer() { 13 | super(Object.class); 14 | } 15 | 16 | public LongToHex4StringSerializer(Class handledType) { 17 | super(handledType); 18 | } 19 | 20 | @Override 21 | @SuppressWarnings("RedundantCast") 22 | public String valueToString(Object value) { 23 | return "0x" + String.format("%04X", (Long) value).toUpperCase(); 24 | } 25 | } -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/serializer/LongToHex8StringSerializer.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.serializer; 2 | 3 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase; 5 | 6 | /** 7 | * 整数转16进制字符串,宽度为8 8 | */ 9 | public class LongToHex8StringSerializer extends ToStringSerializerBase { 10 | public final static ToStringSerializer instance = new ToStringSerializer(); 11 | 12 | public LongToHex8StringSerializer() { 13 | super(Object.class); 14 | } 15 | 16 | public LongToHex8StringSerializer(Class handledType) { 17 | super(handledType); 18 | } 19 | 20 | @Override 21 | @SuppressWarnings("RedundantCast") 22 | public String valueToString(Object value) { 23 | return "0x" + String.format("%08X", (Long) value).toUpperCase(); 24 | } 25 | } -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/serializer/IntegerToHexStringSerializer.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.serializer; 2 | 3 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase; 5 | 6 | /** 7 | * 整数转16进制字符串 8 | */ 9 | public class IntegerToHexStringSerializer extends ToStringSerializerBase { 10 | public final static ToStringSerializer instance = new ToStringSerializer(); 11 | 12 | public IntegerToHexStringSerializer() { 13 | super(Object.class); 14 | } 15 | 16 | public IntegerToHexStringSerializer(Class handledType) { 17 | super(handledType); 18 | } 19 | 20 | @Override 21 | @SuppressWarnings("RedundantCast") 22 | public String valueToString(Object value) { 23 | return "0x" + String.format("%X", (Integer) value).toUpperCase(); 24 | } 25 | } -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/serializer/IntegerToHex2StringSerializer.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.serializer; 2 | 3 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase; 5 | 6 | /** 7 | * 整数转16进制字符串,宽度为2 8 | */ 9 | public class IntegerToHex2StringSerializer extends ToStringSerializerBase { 10 | public final static ToStringSerializer instance = new ToStringSerializer(); 11 | 12 | public IntegerToHex2StringSerializer() { 13 | super(Object.class); 14 | } 15 | 16 | public IntegerToHex2StringSerializer(Class handledType) { 17 | super(handledType); 18 | } 19 | 20 | @Override 21 | @SuppressWarnings("RedundantCast") 22 | public String valueToString(Object value) { 23 | return "0x" + String.format("%02X", (Integer) value).toUpperCase(); 24 | } 25 | } -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/serializer/IntegerToHex4StringSerializer.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.serializer; 2 | 3 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase; 5 | 6 | /** 7 | * 整数转16进制字符串,宽度为4 8 | */ 9 | public class IntegerToHex4StringSerializer extends ToStringSerializerBase { 10 | public final static ToStringSerializer instance = new ToStringSerializer(); 11 | 12 | public IntegerToHex4StringSerializer() { 13 | super(Object.class); 14 | } 15 | 16 | public IntegerToHex4StringSerializer(Class handledType) { 17 | super(handledType); 18 | } 19 | 20 | @Override 21 | @SuppressWarnings("RedundantCast") 22 | public String valueToString(Object value) { 23 | return "0x" + String.format("%04X", (Integer) value).toUpperCase(); 24 | } 25 | } -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/serializer/IntegerToHex8StringSerializer.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.serializer; 2 | 3 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; 4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase; 5 | 6 | /** 7 | * 整数转16进制字符串,宽度为8 8 | */ 9 | public class IntegerToHex8StringSerializer extends ToStringSerializerBase { 10 | public final static ToStringSerializer instance = new ToStringSerializer(); 11 | 12 | public IntegerToHex8StringSerializer() { 13 | super(Object.class); 14 | } 15 | 16 | public IntegerToHex8StringSerializer(Class handledType) { 17 | super(handledType); 18 | } 19 | 20 | @Override 21 | @SuppressWarnings("RedundantCast") 22 | public String valueToString(Object value) { 23 | return "0x" + String.format("%08X", (Integer) value).toUpperCase(); 24 | } 25 | } -------------------------------------------------------------------------------- /jt1078/src/main/java/ai/sangmado/gbprotocol/jt1078/protocol/exceptions/UnsupportedJT1078OperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt1078.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808OperationException; 4 | 5 | /** 6 | * 不支持协议操作异常 7 | */ 8 | public class UnsupportedJT1078OperationException extends UnsupportedJT808OperationException { 9 | static final long serialVersionUID = 6857103519680790348L; 10 | 11 | public UnsupportedJT1078OperationException() { 12 | this("暂不支持该协议操作"); 13 | } 14 | 15 | public UnsupportedJT1078OperationException(String message) { 16 | super(message); 17 | } 18 | 19 | public UnsupportedJT1078OperationException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | 23 | public UnsupportedJT1078OperationException(Throwable cause) { 24 | super(cause); 25 | } 26 | } -------------------------------------------------------------------------------- /jt808db32t3610/src/main/java/ai/sangmado/gbprotocol/jt808db32t3610/protocol/exceptions/UnsupportedJT808DB32T3610OperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db32t3610.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808OperationException; 4 | 5 | /** 6 | * 不支持协议操作异常 7 | */ 8 | public class UnsupportedJT808DB32T3610OperationException extends UnsupportedJT808OperationException { 9 | static final long serialVersionUID = 3884063173042415016L; 10 | 11 | public UnsupportedJT808DB32T3610OperationException() { 12 | this("暂不支持该协议操作"); 13 | } 14 | 15 | public UnsupportedJT808DB32T3610OperationException(String message) { 16 | super(message); 17 | } 18 | 19 | public UnsupportedJT808DB32T3610OperationException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | 23 | public UnsupportedJT808DB32T3610OperationException(Throwable cause) { 24 | super(cause); 25 | } 26 | } -------------------------------------------------------------------------------- /jt809db32t3610/src/main/java/ai/sangmado/gbprotocol/jt809db32t3610/protocol/exceptions/UnsupportedJT809DB32T3610OperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809db32t3610.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.jt809.protocol.exceptions.UnsupportedJT809OperationException; 4 | 5 | /** 6 | * 不支持协议操作异常 7 | */ 8 | public class UnsupportedJT809DB32T3610OperationException extends UnsupportedJT809OperationException { 9 | static final long serialVersionUID = 6410882341427901991L; 10 | 11 | public UnsupportedJT809DB32T3610OperationException() { 12 | this("暂不支持该协议操作"); 13 | } 14 | 15 | public UnsupportedJT809DB32T3610OperationException(String message) { 16 | super(message); 17 | } 18 | 19 | public UnsupportedJT809DB32T3610OperationException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | 23 | public UnsupportedJT809DB32T3610OperationException(Throwable cause) { 24 | super(cause); 25 | } 26 | } -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/exceptions/UnsupportedJT905MessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | 5 | /** 6 | * 不支持协议消息异常 7 | */ 8 | public class UnsupportedJT905MessageException extends RuntimeException { 9 | static final long serialVersionUID = -3208575297084463133L; 10 | 11 | public UnsupportedJT905MessageException() { 12 | this("暂不支持该协议消息"); 13 | } 14 | 15 | public UnsupportedJT905MessageException(IMessageId messageId) { 16 | this("暂不支持该协议消息: " + messageId.getName()); 17 | } 18 | 19 | public UnsupportedJT905MessageException(String message) { 20 | super(message); 21 | } 22 | 23 | public UnsupportedJT905MessageException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public UnsupportedJT905MessageException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x0200_Additional/JT808_Message_Content_0x0200_AdditionalInformation.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808_Message_Content_0x0200_Additional; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | 8 | /** 9 | * 终端位置信息汇报 - 位置附加信息 10 | *

11 | * 􏰢􏰣格式:附加信息ID+附加信息长度+附加信息 12 | */ 13 | @NoArgsConstructor 14 | public abstract class JT808_Message_Content_0x0200_AdditionalInformation implements IJT808MessageFormatter { 15 | 16 | /** 17 | * 获取位置附加信息ID 18 | * 19 | * @return 位置附加信息ID 20 | */ 21 | public abstract JT808_Message_Content_0x0200_AdditionalInformationId getAdditionalInformationId(); 22 | 23 | /** 24 | * 附件信息长度 25 | */ 26 | @Getter 27 | @Setter 28 | private Integer additionalInformationLength; 29 | } 30 | -------------------------------------------------------------------------------- /jt808db22jibiao/src/main/java/ai/sangmado/gbprotocol/jt808db22jibiao/protocol/exceptions/UnsupportedJT808DB22JiBiaoOperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db22jibiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808OperationException; 4 | 5 | /** 6 | * 不支持协议操作异常 7 | */ 8 | public class UnsupportedJT808DB22JiBiaoOperationException extends UnsupportedJT808OperationException { 9 | static final long serialVersionUID = 4362796032044740723L; 10 | 11 | public UnsupportedJT808DB22JiBiaoOperationException() { 12 | this("暂不支持该协议操作"); 13 | } 14 | 15 | public UnsupportedJT808DB22JiBiaoOperationException(String message) { 16 | super(message); 17 | } 18 | 19 | public UnsupportedJT808DB22JiBiaoOperationException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | 23 | public UnsupportedJT808DB22JiBiaoOperationException(Throwable cause) { 24 | super(cause); 25 | } 26 | } -------------------------------------------------------------------------------- /jt808db37lubiao/src/main/java/ai/sangmado/gbprotocol/jt808db37lubiao/protocol/exceptions/UnsupportedJT808DB37LuBiaoOperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db37lubiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808OperationException; 4 | 5 | /** 6 | * 不支持协议操作异常 7 | */ 8 | public class UnsupportedJT808DB37LuBiaoOperationException extends UnsupportedJT808OperationException { 9 | static final long serialVersionUID = -1888033475037040646L; 10 | 11 | public UnsupportedJT808DB37LuBiaoOperationException() { 12 | this("暂不支持该协议操作"); 13 | } 14 | 15 | public UnsupportedJT808DB37LuBiaoOperationException(String message) { 16 | super(message); 17 | } 18 | 19 | public UnsupportedJT808DB37LuBiaoOperationException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | 23 | public UnsupportedJT808DB37LuBiaoOperationException(Throwable cause) { 24 | super(cause); 25 | } 26 | } -------------------------------------------------------------------------------- /gb17691/src/main/java/ai/sangmado/gbprotocol/gb17691/protocol/exceptions/UnsupportedGB17691MessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb17691.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | 5 | /** 6 | * 不支持协议消息异常 7 | */ 8 | public class UnsupportedGB17691MessageException extends RuntimeException { 9 | static final long serialVersionUID = 1631125493187729352L; 10 | 11 | public UnsupportedGB17691MessageException() { 12 | this("暂不支持该协议消息"); 13 | } 14 | 15 | public UnsupportedGB17691MessageException(IMessageId messageId) { 16 | this("暂不支持该协议消息: " + messageId.getName()); 17 | } 18 | 19 | public UnsupportedGB17691MessageException(String message) { 20 | super(message); 21 | } 22 | 23 | public UnsupportedGB17691MessageException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public UnsupportedGB17691MessageException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/exceptions/UnsupportedGB19056MessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | 5 | /** 6 | * 不支持协议消息异常 7 | */ 8 | public class UnsupportedGB19056MessageException extends RuntimeException { 9 | static final long serialVersionUID = 1505235794519333561L; 10 | 11 | public UnsupportedGB19056MessageException() { 12 | this("暂不支持该协议消息"); 13 | } 14 | 15 | public UnsupportedGB19056MessageException(IMessageId messageId) { 16 | this("暂不支持该协议消息: " + messageId.getName()); 17 | } 18 | 19 | public UnsupportedGB19056MessageException(String message) { 20 | super(message); 21 | } 22 | 23 | public UnsupportedGB19056MessageException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public UnsupportedGB19056MessageException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/exceptions/UnsupportedGB32960MessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | 5 | /** 6 | * 不支持协议消息异常 7 | */ 8 | public class UnsupportedGB32960MessageException extends RuntimeException { 9 | static final long serialVersionUID = -6373752214056440411L; 10 | 11 | public UnsupportedGB32960MessageException() { 12 | this("暂不支持该协议消息"); 13 | } 14 | 15 | public UnsupportedGB32960MessageException(IMessageId messageId) { 16 | this("暂不支持该协议消息: " + messageId.getName()); 17 | } 18 | 19 | public UnsupportedGB32960MessageException(String message) { 20 | super(message); 21 | } 22 | 23 | public UnsupportedGB32960MessageException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public UnsupportedGB32960MessageException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /jt808db23heibiao/src/main/java/ai/sangmado/gbprotocol/jt808db23heibiao/protocol/exceptions/UnsupportedJT808DB23HeiBiaoOperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db23heibiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808OperationException; 4 | 5 | /** 6 | * 不支持协议操作异常 7 | */ 8 | public class UnsupportedJT808DB23HeiBiaoOperationException extends UnsupportedJT808OperationException { 9 | static final long serialVersionUID = -1888033475037040646L; 10 | 11 | public UnsupportedJT808DB23HeiBiaoOperationException() { 12 | this("暂不支持该协议操作"); 13 | } 14 | 15 | public UnsupportedJT808DB23HeiBiaoOperationException(String message) { 16 | super(message); 17 | } 18 | 19 | public UnsupportedJT808DB23HeiBiaoOperationException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | 23 | public UnsupportedJT808DB23HeiBiaoOperationException(Throwable cause) { 24 | super(cause); 25 | } 26 | } -------------------------------------------------------------------------------- /jt808db51chuanbiao/src/main/java/ai/sangmado/gbprotocol/jt808db51chuanbiao/protocol/exceptions/UnsupportedJT808DB51ChuanBiaoOperationException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db51chuanbiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808OperationException; 4 | 5 | /** 6 | * 不支持协议操作异常 7 | */ 8 | public class UnsupportedJT808DB51ChuanBiaoOperationException extends UnsupportedJT808OperationException { 9 | static final long serialVersionUID = -1888033475037040646L; 10 | 11 | public UnsupportedJT808DB51ChuanBiaoOperationException() { 12 | this("暂不支持该协议操作"); 13 | } 14 | 15 | public UnsupportedJT808DB51ChuanBiaoOperationException(String message) { 16 | super(message); 17 | } 18 | 19 | public UnsupportedJT808DB51ChuanBiaoOperationException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | 23 | public UnsupportedJT808DB51ChuanBiaoOperationException(Throwable cause) { 24 | super(cause); 25 | } 26 | } -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/message/JT809MessageAssembler.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.message; 2 | 3 | import ai.sangmado.gbprotocol.jt809.protocol.message.content.JT809MessageContent; 4 | import ai.sangmado.gbprotocol.jt809.protocol.message.header.JT809MessageHeader; 5 | import ai.sangmado.gbprotocol.jt809.protocol.IVersionedSpecificationContext; 6 | import com.google.common.collect.Lists; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * JT809 消息装配器 12 | */ 13 | public final class JT809MessageAssembler { 14 | 15 | public static List assemble( 16 | IVersionedSpecificationContext ctx, JT809MessageHeader header, JT809MessageContent content) { 17 | 18 | header.setMessageLength(header.getMessageLengthWithoutContent() + content.getContentLength(ctx)); 19 | 20 | JT809Message message = new JT809Message(); 21 | message.setHeader(header); 22 | message.setContent(content); 23 | 24 | return Lists.newArrayList(message); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/exceptions/UnsupportedJT808ProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | 5 | /** 6 | * 不支持协议版本异常 7 | */ 8 | public class UnsupportedJT808ProtocolVersionException extends RuntimeException { 9 | static final long serialVersionUID = 4318942682551505933L; 10 | 11 | public UnsupportedJT808ProtocolVersionException() { 12 | this("暂不支持该协议版本"); 13 | } 14 | 15 | public UnsupportedJT808ProtocolVersionException(IProtocolVersion protocolVersion) { 16 | this("暂不支持该协议版本: " + protocolVersion); 17 | } 18 | 19 | public UnsupportedJT808ProtocolVersionException(String message) { 20 | super(message); 21 | } 22 | 23 | public UnsupportedJT808ProtocolVersionException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public UnsupportedJT808ProtocolVersionException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/exceptions/UnsupportedJT809ProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | 5 | /** 6 | * 不支持协议版本异常 7 | */ 8 | public class UnsupportedJT809ProtocolVersionException extends RuntimeException { 9 | static final long serialVersionUID = 303547021877163206L; 10 | 11 | public UnsupportedJT809ProtocolVersionException() { 12 | this("暂不支持该协议版本"); 13 | } 14 | 15 | public UnsupportedJT809ProtocolVersionException(IProtocolVersion protocolVersion) { 16 | this("暂不支持该协议版本: " + protocolVersion); 17 | } 18 | 19 | public UnsupportedJT809ProtocolVersionException(String message) { 20 | super(message); 21 | } 22 | 23 | public UnsupportedJT809ProtocolVersionException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public UnsupportedJT809ProtocolVersionException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/exceptions/UnsupportedJT905ProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | 5 | /** 6 | * 不支持协议版本异常 7 | */ 8 | public class UnsupportedJT905ProtocolVersionException extends RuntimeException { 9 | static final long serialVersionUID = 8691477310068804322L; 10 | 11 | public UnsupportedJT905ProtocolVersionException() { 12 | this("暂不支持该协议版本"); 13 | } 14 | 15 | public UnsupportedJT905ProtocolVersionException(IProtocolVersion protocolVersion) { 16 | this("暂不支持该协议版本: " + protocolVersion); 17 | } 18 | 19 | public UnsupportedJT905ProtocolVersionException(String message) { 20 | super(message); 21 | } 22 | 23 | public UnsupportedJT905ProtocolVersionException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public UnsupportedJT905ProtocolVersionException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/utils/BCD.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.utils; 2 | 3 | /** 4 | * BCD Code 工具类 5 | */ 6 | public class BCD { 7 | 8 | public static String bcd2String(byte[] bcd) { 9 | StringBuilder sb = new StringBuilder(); 10 | for (byte x : bcd) { 11 | byte high = (byte) (x & 0xf0); 12 | high >>>= (byte) 4; 13 | high = (byte) (high & 0x0f); 14 | byte low = (byte) (x & 0x0f); 15 | sb.append(high); 16 | sb.append(low); 17 | } 18 | return sb.toString(); 19 | } 20 | 21 | public static byte[] string2BCD(String x) { 22 | byte[] bcd = new byte[(x.length() + x.length() % 2) / 2]; 23 | for (int pointer = 0, index = 0; pointer < x.length(); pointer++, index++) { 24 | int left = Character.digit(x.charAt(pointer), 16); 25 | int right = Character.digit(x.charAt(++pointer), 16); 26 | bcd[index] = (byte) ((left << 4) | right); 27 | } 28 | return bcd; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /gb17691/src/main/java/ai/sangmado/gbprotocol/gb17691/protocol/exceptions/UnsupportedGB17691ProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb17691.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | 5 | /** 6 | * 不支持协议版本异常 7 | */ 8 | public class UnsupportedGB17691ProtocolVersionException extends RuntimeException { 9 | static final long serialVersionUID = 6807920661590619336L; 10 | 11 | public UnsupportedGB17691ProtocolVersionException() { 12 | this("暂不支持该协议版本"); 13 | } 14 | 15 | public UnsupportedGB17691ProtocolVersionException(IProtocolVersion protocolVersion) { 16 | this("暂不支持该协议版本: " + protocolVersion); 17 | } 18 | 19 | public UnsupportedGB17691ProtocolVersionException(String message) { 20 | super(message); 21 | } 22 | 23 | public UnsupportedGB17691ProtocolVersionException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public UnsupportedGB17691ProtocolVersionException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/exceptions/UnsupportedGB19056ProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | 5 | /** 6 | * 不支持协议版本异常 7 | */ 8 | public class UnsupportedGB19056ProtocolVersionException extends RuntimeException { 9 | static final long serialVersionUID = 6188340483471357278L; 10 | 11 | public UnsupportedGB19056ProtocolVersionException() { 12 | this("暂不支持该协议版本"); 13 | } 14 | 15 | public UnsupportedGB19056ProtocolVersionException(IProtocolVersion protocolVersion) { 16 | this("暂不支持该协议版本: " + protocolVersion); 17 | } 18 | 19 | public UnsupportedGB19056ProtocolVersionException(String message) { 20 | super(message); 21 | } 22 | 23 | public UnsupportedGB19056ProtocolVersionException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public UnsupportedGB19056ProtocolVersionException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/exceptions/UnsupportedGB32960ProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | 5 | /** 6 | * 不支持协议版本异常 7 | */ 8 | public class UnsupportedGB32960ProtocolVersionException extends RuntimeException { 9 | static final long serialVersionUID = -4999454353039597741L; 10 | 11 | public UnsupportedGB32960ProtocolVersionException() { 12 | this("暂不支持该协议版本"); 13 | } 14 | 15 | public UnsupportedGB32960ProtocolVersionException(IProtocolVersion protocolVersion) { 16 | this("暂不支持该协议版本: " + protocolVersion); 17 | } 18 | 19 | public UnsupportedGB32960ProtocolVersionException(String message) { 20 | super(message); 21 | } 22 | 23 | public UnsupportedGB32960ProtocolVersionException(String message, Throwable cause) { 24 | super(message, cause); 25 | } 26 | 27 | public UnsupportedGB32960ProtocolVersionException(Throwable cause) { 28 | super(cause); 29 | } 30 | } -------------------------------------------------------------------------------- /settings.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | central 8 | aliyun-central 9 | Aliyun Maven Repository Mirror 10 | https://maven.aliyun.com/repository/central 11 | 12 | 13 | releases 14 | aliyun-releases 15 | Aliyun Maven Repository Mirror 16 | https://maven.aliyun.com/repository/releases 17 | 18 | 19 | snapshots 20 | aliyun-snapshots 21 | Aliyun Maven Repository Mirror 22 | https://maven.aliyun.com/repository/snapshots 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/exceptions/UnsupportedJT808MessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | 5 | /** 6 | * 不支持协议消息异常 7 | */ 8 | public class UnsupportedJT808MessageException extends RuntimeException { 9 | static final long serialVersionUID = -7212162636270609070L; 10 | 11 | public UnsupportedJT808MessageException() { 12 | this("暂不支持该协议消息"); 13 | } 14 | 15 | public UnsupportedJT808MessageException(IMessageId messageId) { 16 | this(String.format("暂不支持该协议消息: %s / %s / %s ", 17 | messageId.getName(), messageId.getDescription(), messageId.getSince())); 18 | } 19 | 20 | public UnsupportedJT808MessageException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808MessageException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808MessageException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/exceptions/UnsupportedJT809MessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | 5 | /** 6 | * 不支持协议消息异常 7 | */ 8 | public class UnsupportedJT809MessageException extends RuntimeException { 9 | static final long serialVersionUID = -6340343831567081202L; 10 | 11 | public UnsupportedJT809MessageException() { 12 | this("暂不支持该协议消息"); 13 | } 14 | 15 | public UnsupportedJT809MessageException(IMessageId messageId) { 16 | this(String.format("暂不支持该协议消息: %s / %s / %s ", 17 | messageId.getName(), messageId.getDescription(), messageId.getSince())); 18 | } 19 | 20 | public UnsupportedJT809MessageException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT809MessageException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT809MessageException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/utils/StringsConverter.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.utils; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | 5 | import java.nio.ByteBuffer; 6 | 7 | /** 8 | * 字符串转换器 9 | */ 10 | public final class StringsConverter { 11 | 12 | /** 13 | * 将Byte数组转化为字符串 14 | * 15 | * @param x Byte数组 16 | * @return 字符串 17 | */ 18 | public static String toString(IVersionedSpecificationContext ctx, byte[] x) { 19 | if (x == null) 20 | throw new IllegalArgumentException("Invalid byte array."); 21 | return ctx.getCharset().decode(ByteBuffer.wrap(x, 0, x.length)).toString(); 22 | } 23 | 24 | /** 25 | * 将字符串转化为Byte数组 26 | * 27 | * @param x 字符串 28 | * @return Byte数组 29 | */ 30 | public static byte[] toBytes(IVersionedSpecificationContext ctx, String x) { 31 | if (x == null) 32 | throw new IllegalArgumentException("Invalid string."); 33 | return x.getBytes(ctx.getCharset()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/ISpecificationContext.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.memory.IBufferPool; 4 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809MessageContentEncryptionOptions; 5 | 6 | import java.nio.ByteOrder; 7 | import java.nio.charset.Charset; 8 | 9 | /** 10 | * 协议上下文 11 | */ 12 | public interface ISpecificationContext extends Cloneable { 13 | 14 | /** 15 | * 获取字节序 16 | *

17 | * 大端(Big-Endian)字节序:高字节存于内存低地址,低字节存于内存高地址。 18 | * 小端(Little-Endian)字节序:低字节存于内存低地址,高字节存于内存高地址。 19 | * 20 | * @return 字节序 21 | */ 22 | ByteOrder getByteOrder(); 23 | 24 | /** 25 | * 获取字符集 26 | * 27 | * @return 字符集 28 | */ 29 | Charset getCharset(); 30 | 31 | /** 32 | * 获取消息体加密参数 33 | * 34 | * @return 消息体加密参数 35 | */ 36 | JT809MessageContentEncryptionOptions getMessageContentEncryptionOptions(); 37 | 38 | /** 39 | * 获取数组池 40 | * 41 | * @return 数组池 42 | */ 43 | IBufferPool getBufferPool(); 44 | } 45 | -------------------------------------------------------------------------------- /jt1078/src/main/java/ai/sangmado/gbprotocol/jt1078/protocol/exceptions/UnsupportedJT1078MessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt1078.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808MessageException; 5 | 6 | /** 7 | * 不支持协议消息异常 8 | */ 9 | public class UnsupportedJT1078MessageException extends UnsupportedJT808MessageException { 10 | static final long serialVersionUID = -8734858167378108984L; 11 | 12 | public UnsupportedJT1078MessageException() { 13 | this("暂不支持该协议消息"); 14 | } 15 | 16 | public UnsupportedJT1078MessageException(IMessageId messageId) { 17 | this("暂不支持该协议消息: " + messageId.getName()); 18 | } 19 | 20 | public UnsupportedJT1078MessageException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT1078MessageException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT1078MessageException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Dennis Gao 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /jt1078/doc/jt1078-message-flow.plantuml: -------------------------------------------------------------------------------- 1 | @startuml 2 | skinparam backgroundColor White 3 | skinparam handwritten false 4 | 5 | title JT1078实时视频传输流程 6 | 7 | actor Client #blue 8 | boundary WebServer 9 | participant JT1078Server 10 | participant VideoServer 11 | entity Device #green 12 | 13 | == 发起流程 == 14 | 15 | Client -> WebServer : 实时视频传输请求 16 | WebServer -> JT1078Server : 实时视频传输请求 17 | JT1078Server -> VideoServer : 实时视频传输请求(开启端口监听) 18 | VideoServer --> JT1078Server : 实时视频传输响应(收流地址,直播地址) 19 | JT1078Server -> Device : 0x9101实时视频传输请求 20 | JT1078Server -> WebServer : 实时视频传输响应(直播地址) 21 | WebServer -> Client : 实时视频传输响应(直播地址) 22 | 23 | == 传输流程 == 24 | 25 | Device -[#red]> VideoServer : 实时视频传输(RTP流) 26 | Client -[#red]> VideoServer : 实时视频播放请求 27 | VideoServer -[#red]> Client : 实时视频播放响应(HLS) 28 | 29 | == 状态通知 == 30 | 31 | VideoServer -[#green]> JT1078Server : 实时视频传输状态通知 32 | JT1078Server -[#green]> Device : 0x9105实时视频传输状态通知 33 | 34 | == 关闭流程 == 35 | 36 | Client -[#0000FF]> WebServer : 关闭实时视频传输 37 | WebServer -[#0000FF]> JT1078Server : 关闭实时视频传输 38 | JT1078Server -[#0000FF]> VideoServer : 关闭实时视频传输 39 | JT1078Server -[#0000FF]> Device : 0x9102实时视频传输控制(关闭) 40 | 41 | @enduml 42 | -------------------------------------------------------------------------------- /jt808db32t3610/src/main/java/ai/sangmado/gbprotocol/jt808db32t3610/protocol/exceptions/UnsupportedJT808DB32T3610MessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db32t3610.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808MessageException; 5 | 6 | /** 7 | * 不支持协议消息异常 8 | */ 9 | public class UnsupportedJT808DB32T3610MessageException extends UnsupportedJT808MessageException { 10 | static final long serialVersionUID = 4035581577857292065L; 11 | 12 | public UnsupportedJT808DB32T3610MessageException() { 13 | this("暂不支持该协议消息"); 14 | } 15 | 16 | public UnsupportedJT808DB32T3610MessageException(IMessageId messageId) { 17 | this("暂不支持该协议消息: " + messageId.getName()); 18 | } 19 | 20 | public UnsupportedJT808DB32T3610MessageException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808DB32T3610MessageException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808DB32T3610MessageException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt809db32t3610/src/main/java/ai/sangmado/gbprotocol/jt809db32t3610/protocol/exceptions/UnsupportedJT809DB32T3610MessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809db32t3610.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | import ai.sangmado.gbprotocol.jt809.protocol.exceptions.UnsupportedJT809MessageException; 5 | 6 | /** 7 | * 不支持协议消息异常 8 | */ 9 | public class UnsupportedJT809DB32T3610MessageException extends UnsupportedJT809MessageException { 10 | static final long serialVersionUID = 9021922586133290705L; 11 | 12 | public UnsupportedJT809DB32T3610MessageException() { 13 | this("暂不支持该协议消息"); 14 | } 15 | 16 | public UnsupportedJT809DB32T3610MessageException(IMessageId messageId) { 17 | this("暂不支持该协议消息: " + messageId.getName()); 18 | } 19 | 20 | public UnsupportedJT809DB32T3610MessageException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT809DB32T3610MessageException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT809DB32T3610MessageException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt1078/src/main/java/ai/sangmado/gbprotocol/jt1078/protocol/exceptions/UnsupportedJT1078ProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt1078.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808ProtocolVersionException; 5 | 6 | /** 7 | * 不支持协议版本异常 8 | */ 9 | public class UnsupportedJT1078ProtocolVersionException extends UnsupportedJT808ProtocolVersionException { 10 | static final long serialVersionUID = -8186572467563833501L; 11 | 12 | public UnsupportedJT1078ProtocolVersionException() { 13 | this("暂不支持该协议版本"); 14 | } 15 | 16 | public UnsupportedJT1078ProtocolVersionException(IProtocolVersion protocolVersion) { 17 | this("暂不支持该协议版本: " + protocolVersion); 18 | } 19 | 20 | public UnsupportedJT1078ProtocolVersionException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT1078ProtocolVersionException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT1078ProtocolVersionException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt808db22jibiao/src/main/java/ai/sangmado/gbprotocol/jt808db22jibiao/protocol/exceptions/UnsupportedJT808DB22JiBiaoMessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db22jibiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808MessageException; 5 | 6 | /** 7 | * 不支持协议消息异常 8 | */ 9 | public class UnsupportedJT808DB22JiBiaoMessageException extends UnsupportedJT808MessageException { 10 | static final long serialVersionUID = 80737643803696666L; 11 | 12 | public UnsupportedJT808DB22JiBiaoMessageException() { 13 | this("暂不支持该协议消息"); 14 | } 15 | 16 | public UnsupportedJT808DB22JiBiaoMessageException(IMessageId messageId) { 17 | this("暂不支持该协议消息: " + messageId.getName()); 18 | } 19 | 20 | public UnsupportedJT808DB22JiBiaoMessageException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808DB22JiBiaoMessageException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808DB22JiBiaoMessageException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt808db37lubiao/src/main/java/ai/sangmado/gbprotocol/jt808db37lubiao/protocol/exceptions/UnsupportedJT808DB37LuBiaoMessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db37lubiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808MessageException; 5 | 6 | /** 7 | * 不支持协议消息异常 8 | */ 9 | public class UnsupportedJT808DB37LuBiaoMessageException extends UnsupportedJT808MessageException { 10 | static final long serialVersionUID = -3780609898848634088L; 11 | 12 | public UnsupportedJT808DB37LuBiaoMessageException() { 13 | this("暂不支持该协议消息"); 14 | } 15 | 16 | public UnsupportedJT808DB37LuBiaoMessageException(IMessageId messageId) { 17 | this("暂不支持该协议消息: " + messageId.getName()); 18 | } 19 | 20 | public UnsupportedJT808DB37LuBiaoMessageException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808DB37LuBiaoMessageException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808DB37LuBiaoMessageException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt808db23heibiao/src/main/java/ai/sangmado/gbprotocol/jt808db23heibiao/protocol/exceptions/UnsupportedJT808DB23HeiBiaoMessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db23heibiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808MessageException; 5 | 6 | /** 7 | * 不支持协议消息异常 8 | */ 9 | public class UnsupportedJT808DB23HeiBiaoMessageException extends UnsupportedJT808MessageException { 10 | static final long serialVersionUID = -3780609898848634088L; 11 | 12 | public UnsupportedJT808DB23HeiBiaoMessageException() { 13 | this("暂不支持该协议消息"); 14 | } 15 | 16 | public UnsupportedJT808DB23HeiBiaoMessageException(IMessageId messageId) { 17 | this("暂不支持该协议消息: " + messageId.getName()); 18 | } 19 | 20 | public UnsupportedJT808DB23HeiBiaoMessageException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808DB23HeiBiaoMessageException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808DB23HeiBiaoMessageException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt808db51chuanbiao/src/main/java/ai/sangmado/gbprotocol/jt808db51chuanbiao/protocol/exceptions/UnsupportedJT808DB51ChuanBiaoMessageException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db51chuanbiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808MessageException; 5 | 6 | /** 7 | * 不支持协议消息异常 8 | */ 9 | public class UnsupportedJT808DB51ChuanBiaoMessageException extends UnsupportedJT808MessageException { 10 | static final long serialVersionUID = -3780609898848634088L; 11 | 12 | public UnsupportedJT808DB51ChuanBiaoMessageException() { 13 | this("暂不支持该协议消息"); 14 | } 15 | 16 | public UnsupportedJT808DB51ChuanBiaoMessageException(IMessageId messageId) { 17 | this("暂不支持该协议消息: " + messageId.getName()); 18 | } 19 | 20 | public UnsupportedJT808DB51ChuanBiaoMessageException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808DB51ChuanBiaoMessageException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808DB51ChuanBiaoMessageException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt808db32t3610/doc/warning-file-upload-flow.plantuml: -------------------------------------------------------------------------------- 1 | @startuml 2 | skinparam backgroundColor #EEEBDC 3 | skinparam handwritten false 4 | 5 | title 苏标报警附件文件上传流程 6 | 7 | entity Device #red 8 | boundary MessageServer 9 | boundary StorageServer 10 | 11 | ==下发上传指令和服务间服务器地址== 12 | 13 | Device -> MessageServer : 0x0200 位置附件信息上传(苏标主动安全扩展) 14 | MessageServer -> Device : 0x8001 平台通用应答 15 | MessageServer -> Device : 0x9208 报警附件上传指令(包含附件服务器地址) 16 | Device -> MessageServer : 0x0001 终端通用应答 17 | 18 | ==连接并上传文件至附件服务器== 19 | 20 | Device -> StorageServer : 0x1210 报警附件信息消息(包含附件数量和描述信息) 21 | StorageServer -> Device : 0x8001 平台通用应答 22 | ||| 23 | loop n个文件 24 | Device -> StorageServer : 0x1211 文件信息上传(包含文件描述信息) 25 | StorageServer -> Device : 0x8001 平台通用应答 26 | ||| 27 | Device -[#0000FF]-> StorageServer : 文件数据上传(文件码流负载包格式) 28 | activate StorageServer #DarkSalmon 29 | Device -[#0000FF]-> StorageServer : 文件数据上传(文件码流负载包格式) 30 | Device -[#0000FF]-> StorageServer : 文件数据上传(文件码流负载包格式) 31 | deactivate StorageServer 32 | ||| 33 | Device -> StorageServer : 0x1212 文件上传完成消息(包含文件描述信息) 34 | StorageServer -> Device : 0x9212 文件上传完成消息应答(包含上传结果) 35 | end 36 | ||| 37 | Device -[#red]> StorageServer !! : 全部文件发送完成后,终端主动与附件服务器断开连接 38 | 39 | @enduml 40 | -------------------------------------------------------------------------------- /jt808db32t3610/src/main/java/ai/sangmado/gbprotocol/jt808db32t3610/protocol/exceptions/UnsupportedJT808DB32T3610ProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db32t3610.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808ProtocolVersionException; 5 | 6 | /** 7 | * 不支持协议版本异常 8 | */ 9 | public class UnsupportedJT808DB32T3610ProtocolVersionException extends UnsupportedJT808ProtocolVersionException { 10 | static final long serialVersionUID = 562928058618468335L; 11 | 12 | public UnsupportedJT808DB32T3610ProtocolVersionException() { 13 | this("暂不支持该协议版本"); 14 | } 15 | 16 | public UnsupportedJT808DB32T3610ProtocolVersionException(IProtocolVersion protocolVersion) { 17 | this("暂不支持该协议版本: " + protocolVersion); 18 | } 19 | 20 | public UnsupportedJT808DB32T3610ProtocolVersionException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808DB32T3610ProtocolVersionException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808DB32T3610ProtocolVersionException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt809db32t3610/src/main/java/ai/sangmado/gbprotocol/jt809db32t3610/protocol/exceptions/UnsupportedJT809DB32T3610ProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809db32t3610.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | import ai.sangmado.gbprotocol.jt809.protocol.exceptions.UnsupportedJT809ProtocolVersionException; 5 | 6 | /** 7 | * 不支持协议版本异常 8 | */ 9 | public class UnsupportedJT809DB32T3610ProtocolVersionException extends UnsupportedJT809ProtocolVersionException { 10 | static final long serialVersionUID = 8538689346582680149L; 11 | 12 | public UnsupportedJT809DB32T3610ProtocolVersionException() { 13 | this("暂不支持该协议版本"); 14 | } 15 | 16 | public UnsupportedJT809DB32T3610ProtocolVersionException(IProtocolVersion protocolVersion) { 17 | this("暂不支持该协议版本: " + protocolVersion); 18 | } 19 | 20 | public UnsupportedJT809DB32T3610ProtocolVersionException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT809DB32T3610ProtocolVersionException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT809DB32T3610ProtocolVersionException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt809db32t3610/src/main/java/ai/sangmado/gbprotocol/jt809db32t3610/protocol/message/extension/JT809DB32T3610MessageExtension.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809db32t3610.protocol.message.extension; 2 | 3 | import ai.sangmado.gbprotocol.jt809db32t3610.protocol.enums.JT809DB32T3610MessageId; 4 | import ai.sangmado.gbprotocol.jt809db32t3610.protocol.message.content.JT809DB32T3610_Message_Content_0x1240; 5 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809MessageId; 6 | import ai.sangmado.gbprotocol.jt809.protocol.message.content.JT809MessageContentRegistration; 7 | 8 | import java.util.ArrayList; 9 | 10 | /** 11 | * 江苏省地方标准 DB32/T3610 协议扩展 12 | */ 13 | public class JT809DB32T3610MessageExtension { 14 | 15 | /** 16 | * DB32/T3610 协议扩展 17 | */ 18 | public static void extend() { 19 | extend_Message_Content_Definitions(); 20 | } 21 | 22 | /** 23 | * DB32/T3610 协议扩展消息体定义 24 | */ 25 | private static void extend_Message_Content_Definitions() { 26 | JT809MessageId.putExtensions(new ArrayList<>(JT809DB32T3610MessageId.get_JT809DB32T3610MessageId_List())); 27 | 28 | JT809MessageContentRegistration.registerDecoder(JT809DB32T3610_Message_Content_0x1240.MESSAGE_ID, JT809DB32T3610_Message_Content_0x1240::decode); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /jt808db22jibiao/src/main/java/ai/sangmado/gbprotocol/jt808db22jibiao/protocol/exceptions/UnsupportedJT808DB22JiBiaoProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db22jibiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808ProtocolVersionException; 5 | 6 | /** 7 | * 不支持协议版本异常 8 | */ 9 | public class UnsupportedJT808DB22JiBiaoProtocolVersionException extends UnsupportedJT808ProtocolVersionException { 10 | static final long serialVersionUID = -4831769289167241634L; 11 | 12 | public UnsupportedJT808DB22JiBiaoProtocolVersionException() { 13 | this("暂不支持该协议版本"); 14 | } 15 | 16 | public UnsupportedJT808DB22JiBiaoProtocolVersionException(IProtocolVersion protocolVersion) { 17 | this("暂不支持该协议版本: " + protocolVersion); 18 | } 19 | 20 | public UnsupportedJT808DB22JiBiaoProtocolVersionException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808DB22JiBiaoProtocolVersionException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808DB22JiBiaoProtocolVersionException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt808db37lubiao/src/main/java/ai/sangmado/gbprotocol/jt808db37lubiao/protocol/exceptions/UnsupportedJT808DB37LuBiaoProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db37lubiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808ProtocolVersionException; 5 | 6 | /** 7 | * 不支持协议版本异常 8 | */ 9 | public class UnsupportedJT808DB37LuBiaoProtocolVersionException extends UnsupportedJT808ProtocolVersionException { 10 | static final long serialVersionUID = -3762866559506311257L; 11 | 12 | public UnsupportedJT808DB37LuBiaoProtocolVersionException() { 13 | this("暂不支持该协议版本"); 14 | } 15 | 16 | public UnsupportedJT808DB37LuBiaoProtocolVersionException(IProtocolVersion protocolVersion) { 17 | this("暂不支持该协议版本: " + protocolVersion); 18 | } 19 | 20 | public UnsupportedJT808DB37LuBiaoProtocolVersionException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808DB37LuBiaoProtocolVersionException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808DB37LuBiaoProtocolVersionException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt808db23heibiao/src/main/java/ai/sangmado/gbprotocol/jt808db23heibiao/protocol/exceptions/UnsupportedJT808DB23HeiBiaoProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db23heibiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808ProtocolVersionException; 5 | 6 | /** 7 | * 不支持协议版本异常 8 | */ 9 | public class UnsupportedJT808DB23HeiBiaoProtocolVersionException extends UnsupportedJT808ProtocolVersionException { 10 | static final long serialVersionUID = -3762866559506311257L; 11 | 12 | public UnsupportedJT808DB23HeiBiaoProtocolVersionException() { 13 | this("暂不支持该协议版本"); 14 | } 15 | 16 | public UnsupportedJT808DB23HeiBiaoProtocolVersionException(IProtocolVersion protocolVersion) { 17 | this("暂不支持该协议版本: " + protocolVersion); 18 | } 19 | 20 | public UnsupportedJT808DB23HeiBiaoProtocolVersionException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808DB23HeiBiaoProtocolVersionException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808DB23HeiBiaoProtocolVersionException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /gbcommon/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | ai.sangmado.gbprotocol 8 | gbprotocol-parent 9 | 1378.1-SNAPSHOT 10 | 11 | gbcommon 12 | gbcommon 13 | A library for protocol standard common utils. 14 | 15 | 16 | 17 | 18 | 19 | org.slf4j 20 | slf4j-api 21 | 22 | 23 | 24 | 25 | com.fasterxml.jackson.datatype 26 | jackson-datatype-jdk8 27 | 28 | 29 | com.fasterxml.jackson.datatype 30 | jackson-datatype-jsr310 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/header/JT808MessageHeaderMessageContentProperty.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.header; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageContentEncryptionMode; 4 | import lombok.*; 5 | 6 | /** 7 | * JT808 消息头中消息体属性 8 | */ 9 | @Getter 10 | @Setter 11 | @AllArgsConstructor(access = AccessLevel.PROTECTED) 12 | @NoArgsConstructor(access = AccessLevel.PROTECTED) 13 | public abstract class JT808MessageHeaderMessageContentProperty implements Cloneable { 14 | 15 | /** 16 | * 是否分包 17 | */ 18 | private Boolean isMultiplePackets; 19 | 20 | /** 21 | * 加密方式 22 | */ 23 | private JT808MessageContentEncryptionMode encryptionMode; 24 | 25 | /** 26 | * 消息体长度 27 | */ 28 | private Integer contentLength; 29 | 30 | /** 31 | * 克隆对象 32 | * 33 | * @return 克隆对象 34 | */ 35 | @Override 36 | public abstract JT808MessageHeaderMessageContentProperty clone(); 37 | 38 | /** 39 | * 将当前对象序列化至包装整型值 40 | * 41 | * @return 包装整型值 42 | */ 43 | public abstract Integer marshal(); 44 | 45 | /** 46 | * 将包装整型值解构为当前对象 47 | * 48 | * @param value 包装整型值 49 | */ 50 | public abstract void release(Integer value); 51 | } 52 | -------------------------------------------------------------------------------- /jt808db51chuanbiao/src/main/java/ai/sangmado/gbprotocol/jt808db51chuanbiao/protocol/exceptions/UnsupportedJT808DB51ChuanBiaoProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db51chuanbiao.protocol.exceptions; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IProtocolVersion; 4 | import ai.sangmado.gbprotocol.jt808.protocol.exceptions.UnsupportedJT808ProtocolVersionException; 5 | 6 | /** 7 | * 不支持协议版本异常 8 | */ 9 | public class UnsupportedJT808DB51ChuanBiaoProtocolVersionException extends UnsupportedJT808ProtocolVersionException { 10 | static final long serialVersionUID = -3762866559506311257L; 11 | 12 | public UnsupportedJT808DB51ChuanBiaoProtocolVersionException() { 13 | this("暂不支持该协议版本"); 14 | } 15 | 16 | public UnsupportedJT808DB51ChuanBiaoProtocolVersionException(IProtocolVersion protocolVersion) { 17 | this("暂不支持该协议版本: " + protocolVersion); 18 | } 19 | 20 | public UnsupportedJT808DB51ChuanBiaoProtocolVersionException(String message) { 21 | super(message); 22 | } 23 | 24 | public UnsupportedJT808DB51ChuanBiaoProtocolVersionException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public UnsupportedJT808DB51ChuanBiaoProtocolVersionException(Throwable cause) { 29 | super(cause); 30 | } 31 | } -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/message/header/JT905MessageHeader.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol.message.header; 2 | 3 | import ai.sangmado.gbprotocol.jt905.protocol.enums.JT905MessageId; 4 | import ai.sangmado.gbprotocol.jt905.protocol.enums.JT905ProtocolVersion; 5 | import ai.sangmado.gbprotocol.jt905.protocol.serialization.IJT905MessageFormatter; 6 | import lombok.*; 7 | 8 | /** 9 | * JT905 消息头 10 | */ 11 | @Getter 12 | @Setter 13 | @NoArgsConstructor(access = AccessLevel.PROTECTED) 14 | @AllArgsConstructor(access = AccessLevel.PROTECTED) 15 | public abstract class JT905MessageHeader implements IJT905MessageFormatter, Cloneable { 16 | 17 | /** 18 | * 获取协议版本 19 | * 20 | * @return 协议版本 21 | */ 22 | public abstract JT905ProtocolVersion getProtocolVersion(); 23 | 24 | /** 25 | * 消息ID 26 | */ 27 | private JT905MessageId messageId; 28 | 29 | /** 30 | * 消息体长度 31 | */ 32 | private Integer contentLength; 33 | 34 | /** 35 | * ISU标识 36 | */ 37 | private String isu; 38 | 39 | /** 40 | * 消息流水号 41 | */ 42 | private Integer serialNumber; 43 | 44 | /** 45 | * 克隆对象 46 | * 47 | * @return 克隆对象 48 | */ 49 | @Override 50 | public abstract JT905MessageHeader clone(); 51 | } 52 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/extension/GB19056MessageExtension.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.extension; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.message.jt808.JT808_Message_Content_0x0700; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.jt808.JT808_Message_Content_0x8700; 5 | import ai.sangmado.gbprotocol.gb19056.protocol.message.jt808.JT808_Message_Content_0x8701; 6 | import ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808MessageContentRegistration; 7 | 8 | /** 9 | * GB19056 协议扩展 10 | */ 11 | public class GB19056MessageExtension { 12 | 13 | /** 14 | * GB19056 协议扩展 15 | */ 16 | public static void extend() { 17 | extend_JT808_Message_Definitions(); 18 | } 19 | 20 | /** 21 | * JT808 消息定义 22 | */ 23 | private static void extend_JT808_Message_Definitions() { 24 | JT808MessageContentRegistration.registerDecoder(JT808_Message_Content_0x8700.MESSAGE_ID, JT808_Message_Content_0x8700::decode); 25 | JT808MessageContentRegistration.registerDecoder(JT808_Message_Content_0x8701.MESSAGE_ID, JT808_Message_Content_0x8701::decode); 26 | JT808MessageContentRegistration.registerDecoder(JT808_Message_Content_0x0700.MESSAGE_ID, JT808_Message_Content_0x0700::decode); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/message/content/JT809MessageContentRegistration.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt809.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt809.protocol.serialization.IJT809MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809MessageId; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | import java.util.function.BiFunction; 10 | 11 | /** 12 | * JT809 消息体注册器 13 | */ 14 | public class JT809MessageContentRegistration { 15 | private static final Map> decoders = new HashMap<>(300); 16 | 17 | public static Map> getDecoders() { 18 | return decoders; 19 | } 20 | 21 | public static void registerDecoder(JT809MessageId messageId, BiFunction contentDecoder) { 22 | decoders.put(messageId, contentDecoder); 23 | } 24 | 25 | static { 26 | registerDecoder(JT809_Message_Content_0x1400.MESSAGE_ID, JT809_Message_Content_0x1400::decode); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/memory/PooledByteArray.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.memory; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.io.OutputStream; 6 | 7 | /** 8 | * 池化数组 9 | */ 10 | public class PooledByteArray { 11 | private byte[] bytes; 12 | 13 | public PooledByteArray(byte[] bytes) { 14 | this.bytes = bytes; 15 | } 16 | 17 | public byte[] array() { 18 | return bytes; 19 | } 20 | 21 | public int length() { 22 | return bytes.length; 23 | } 24 | 25 | public byte get(int index) { 26 | return bytes[index]; 27 | } 28 | 29 | public void set(int index, byte b) { 30 | bytes[index] = b; 31 | } 32 | 33 | public void copyTo(byte[] dst, int dstPos, int offset, int len) { 34 | System.arraycopy(bytes, offset, dst, dstPos, len); 35 | } 36 | 37 | public void copyFrom(byte[] src, int srcPos, int offset, int len) { 38 | System.arraycopy(src, srcPos, bytes, offset, len); 39 | } 40 | 41 | public void writeTo(OutputStream out, int offset, int len) throws IOException { 42 | out.write(bytes, offset, len); 43 | } 44 | 45 | public int readFrom(InputStream in, int offset, int len) throws IOException { 46 | return in.read(bytes, offset, len); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /jt1078/README.md: -------------------------------------------------------------------------------- 1 | # JT1078协议 2 | 3 | JT/T1078 Global navigation satellite system for operating vehicles - Video communication protocol 4 | 5 | JT/T1078 道路运输车辆卫星定位系统 视频通信协议 6 | 7 | ## 组件间交互图 8 | 9 | ![组件间交互图](doc/images/jt1078-component-flow.png) 10 | 11 | ## 实时音视频消息流程图 12 | 13 | ![JT1078实时视频传输流程](doc/images/jt1078-message-flow.png) 14 | 15 | ## 实时音视频流数据传输协议 16 | 17 | 实时音视频流数据的传输参考RTP协议,使用UDP或TCP承载。 18 | 19 | 负载包格式在 IETF RFC3550 RTP定义的基础上补充了消息流水号、SIM卡号、音视频通道号等字段,其负载包格式定义见表19。 20 | 表中定义的 bit 位按照大端模式(big-endian)进行填写。 21 | 22 | | 帧头标识 | VPXCCMPT | 包序号 | SIM 卡号 | 逻辑通道号 | 数据类型 | 时间戳 | Last I Frame Interval | Last Frame Interval | 数据体长度 | 数据体 | 23 | | :-------------: | :------: | :------------: | :------: | :----------------: | :------: | :-------: | :-------------------: | :-----------------: | :--------: | :----: | 24 | | FrameHeadMarker | VPXCCMPT | SequenceNumber | SIM | LogicChannelNumber | DateType | Timestamp | LastIFrameInterval | LastFrameInterval | BodyLength | Body | 25 | 26 | ### DateType 27 | 28 | | 数据类型 | 分包处理标记 | 29 | | :------: | :----------: | 30 | | DataType | PacketType | 31 | 32 | ### VPXCCMPT 33 | 34 | | RTP协议的版本号 | 填充标志 | 扩展标志 | CSRC计数器 | 标志位 | 负载类型 | 35 | | :-------------: | :------: | :------: | :--------: | :----: | :------: | 36 | | V | P | X | CC | M | PT | 37 | -------------------------------------------------------------------------------- /jt809/README.md: -------------------------------------------------------------------------------- 1 | # JT809协议 2 | 3 | JT/T809 GNSS system for operating vehicles - General specifications for data exchange between platforms. 4 | 5 | JT/T809 道路运输车辆卫星定位系统 平台数据交换 6 | 7 | ## JT809协议消息数据结构 8 | 9 | ### 消息结构 JT809MessagePackage 10 | 11 | | 头标识 | 数据头 | 数据体 | 校验码 | 尾标识 | 12 | | :---------: | :----------------: | :-----------------: | :------: | :-------: | 13 | | BeginMarker | JT809MessageHeader | JT809MessageContent | Checksum | EndMarker | 14 | | 5B | - | - | - | 5D | 15 | 16 | ### 消息头 JT809MessageHeader 2011 17 | 18 | | 数据长度 | 报文序列号 | 业务数据类型 | 下级平台接入码 | 协议版本号标识 | 报文加密标识位 | 数据加密密匙 | 19 | | :-----------: | :-------------------: | :----------: | :------------: | :------------: | :------------: | :-----------: | 20 | | messageLength | messageSequenceNumber | messageId | gnssCenterId | versionFlag | encryptionMode | encryptionKey | 21 | 22 | ### 消息头 JT809MessageHeader 2019 23 | 24 | | 数据长度 | 报文序列号 | 业务数据类型 | 下级平台接入码 | 协议版本号标识 | 报文加密标识位 | 数据加密密匙 | 时间戳 | 25 | | :-----------: | :-------------------: | :----------: | :------------: | :------------: | :------------: | :-----------: | :-------: | 26 | | messageLength | messageSequenceNumber | messageId | gnssCenterId | versionFlag | encryptionMode | encryptionKey | timestamp | 27 | -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/memory/PooledByteArrayFactory.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.memory; 2 | 3 | import java.util.Deque; 4 | import java.util.NoSuchElementException; 5 | import java.util.concurrent.ConcurrentLinkedDeque; 6 | 7 | /** 8 | * 池化数组工厂 9 | */ 10 | public class PooledByteArrayFactory implements IBufferPool { 11 | private final int arraySize; 12 | private final Deque pool = new ConcurrentLinkedDeque<>(); 13 | 14 | public PooledByteArrayFactory(int arraySize, int preAllocCount) { 15 | this.arraySize = arraySize; 16 | for (int i = 0; i < preAllocCount; i++) { 17 | pool.push(new byte[this.arraySize]); 18 | } 19 | } 20 | 21 | public int getArraySize() { 22 | return arraySize; 23 | } 24 | 25 | public PooledByteArray borrow() { 26 | byte[] array; 27 | 28 | try { 29 | if (pool.isEmpty()) { 30 | array = new byte[this.arraySize]; 31 | } else { 32 | array = pool.pop(); 33 | } 34 | } catch (NoSuchElementException ex) { 35 | array = new byte[this.arraySize]; 36 | } 37 | 38 | return new PooledByteArray(array); 39 | } 40 | 41 | public void recycle(PooledByteArray pooledByteArray) { 42 | pool.push(pooledByteArray.array()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/IJT808Message.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808ProtocolVersion; 5 | import ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808MessageContent; 6 | import ai.sangmado.gbprotocol.jt808.protocol.message.header.JT808MessageHeader; 7 | import com.fasterxml.jackson.annotation.JsonIgnore; 8 | 9 | /** 10 | * JT808 消息通用接口 11 | * 12 | * @param 消息头类型 13 | * @param 消息体类型 14 | */ 15 | public interface IJT808Message extends IJT808VersioningMessage { 16 | /** 17 | * 获取协议版本 18 | * 19 | * @return 协议版本 20 | */ 21 | @Override 22 | @JsonIgnore 23 | default JT808ProtocolVersion getProtocolVersion() { 24 | return this.getHeader().getProtocolVersion(); 25 | } 26 | 27 | /** 28 | * 获取消息ID 29 | * 30 | * @return 消息ID 31 | */ 32 | @Override 33 | @JsonIgnore 34 | default JT808MessageId getMessageId() { 35 | return this.getHeader().getMessageId(); 36 | } 37 | 38 | /** 39 | * 获取消息头 40 | * 41 | * @return 消息头 42 | */ 43 | H getHeader(); 44 | 45 | /** 46 | * 获取消息体 47 | * 48 | * @return 消息体 49 | */ 50 | C getContent(); 51 | } 52 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/message/IJT809Message.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.message; 2 | 3 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809MessageId; 4 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809ProtocolVersion; 5 | import ai.sangmado.gbprotocol.jt809.protocol.message.content.JT809MessageContent; 6 | import ai.sangmado.gbprotocol.jt809.protocol.message.header.JT809MessageHeader; 7 | import com.fasterxml.jackson.annotation.JsonIgnore; 8 | 9 | /** 10 | * JT809 消息通用接口 11 | * 12 | * @param 消息头类型 13 | * @param 消息体类型 14 | */ 15 | public interface IJT809Message extends IJT809VersioningMessage { 16 | /** 17 | * 获取协议版本 18 | * 19 | * @return 协议版本 20 | */ 21 | @Override 22 | @JsonIgnore 23 | default JT809ProtocolVersion getProtocolVersion() { 24 | return this.getHeader().getProtocolVersion(); 25 | } 26 | 27 | /** 28 | * 获取消息ID 29 | * 30 | * @return 消息ID 31 | */ 32 | @Override 33 | @JsonIgnore 34 | default JT809MessageId getMessageId() { 35 | return this.getHeader().getMessageId(); 36 | } 37 | 38 | /** 39 | * 获取消息头 40 | * 41 | * @return 消息头 42 | */ 43 | H getHeader(); 44 | 45 | /** 46 | * 获取消息体 47 | * 48 | * @return 消息体 49 | */ 50 | C getContent(); 51 | } 52 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/message/header/JT809MessageHeaderRegistration.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.message.header; 2 | 3 | import ai.sangmado.gbprotocol.jt809.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt809.protocol.serialization.IJT809MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809ProtocolVersion; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | import java.util.function.BiFunction; 10 | 11 | /** 12 | * JT809 消息头注册器 13 | */ 14 | public class JT809MessageHeaderRegistration { 15 | private static final Map> decoders = new HashMap<>(3); 16 | 17 | public static Map> getDecoders() { 18 | return decoders; 19 | } 20 | 21 | public static void register(JT809ProtocolVersion protocolVersion, BiFunction headerDecoder) { 22 | decoders.put(protocolVersion, headerDecoder); 23 | } 24 | 25 | static { 26 | register(JT809MessageHeader2011.PROTOCOL_VERSION, JT809MessageHeader2011::decode); 27 | register(JT809MessageHeader2019.PROTOCOL_VERSION, JT809MessageHeader2019::decode); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/message/header/device/GB32960DeviceMessageHeaderRegistration.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.message.header.device; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960ProtocolVersion; 5 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageBufferReader; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | import java.util.function.BiFunction; 10 | 11 | /** 12 | * GB32960 消息头注册器 (终端) 13 | */ 14 | public class GB32960DeviceMessageHeaderRegistration { 15 | private static final Map> decoders = new HashMap<>(3); 16 | 17 | public static Map> getDecoders() { 18 | return decoders; 19 | } 20 | 21 | public static void register(GB32960ProtocolVersion protocolVersion, BiFunction headerDecoder) { 22 | decoders.put(protocolVersion, headerDecoder); 23 | } 24 | 25 | static { 26 | register(GB32960DeviceMessageHeader2016.PROTOCOL_VERSION, GB32960DeviceMessageHeader2016::decode); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/message/header/platform/GB32960PlatformMessageHeaderRegistration.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.message.header.platform; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960ProtocolVersion; 5 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageBufferReader; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | import java.util.function.BiFunction; 10 | 11 | /** 12 | * GB32960 消息头注册器 (平台) 13 | */ 14 | public class GB32960PlatformMessageHeaderRegistration { 15 | private static final Map> decoders = new HashMap<>(3); 16 | 17 | public static Map> getDecoders() { 18 | return decoders; 19 | } 20 | 21 | public static void register(GB32960ProtocolVersion protocolVersion, BiFunction headerDecoder) { 22 | decoders.put(protocolVersion, headerDecoder); 23 | } 24 | 25 | static { 26 | register(GB32960PlatformMessageHeader2016.PROTOCOL_VERSION, GB32960PlatformMessageHeader2016::decode); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/serialization/IGB32960MessageBufferReader.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.serialization; 2 | 3 | /** 4 | * GB32960 消息Buffer读取器 5 | */ 6 | public interface IGB32960MessageBufferReader { 7 | 8 | /** 9 | * 标记当前读取位置 10 | */ 11 | void markIndex(); 12 | 13 | /** 14 | * 重置至已标记的读取位置 15 | */ 16 | void resetIndex(); 17 | 18 | /** 19 | * 是否还有可读数据 20 | * 21 | * @return 是否还有可读数据 22 | */ 23 | boolean isReadable(); 24 | 25 | /** 26 | * 是否还有可读数据 27 | * 28 | * @param size 可读数据最低长度 29 | * @return 是否还有可读数据 30 | */ 31 | boolean isReadable(int size); 32 | 33 | /** 34 | * 可读数据长度 35 | * 36 | * @return 可读数据长度 37 | */ 38 | int readableBytes(); 39 | 40 | /** 41 | * 读取 BYTE 无符号单字节整型 (字节,8位) 42 | */ 43 | byte readByte(); 44 | 45 | /** 46 | * 读取 WORD 无符号双字节整型 (字节,16位) 47 | */ 48 | int readWord(); 49 | 50 | /** 51 | * 读取 DWORD 无符号四字节整型 (字节,32位) 52 | */ 53 | long readDWord(); 54 | 55 | /** 56 | * 读取 n 字节数据 57 | * 58 | * @param length 读取长度 59 | */ 60 | byte[] readBytes(int length); 61 | 62 | /** 63 | * 读取 n 字节为字符串,GBK 编码 64 | * 65 | * @param length 读取长度 66 | */ 67 | String readString(int length); 68 | 69 | /** 70 | * 读取剩余字节为字符串,GBK 编码 71 | */ 72 | String readStringRemaining(); 73 | } 74 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/serialization/IGB32960MessageBufferWriter.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.serialization; 2 | 3 | import com.google.common.primitives.UnsignedLong; 4 | 5 | import java.nio.ByteBuffer; 6 | 7 | /** 8 | * GB32960 消息Buffer写入器 9 | */ 10 | public interface IGB32960MessageBufferWriter { 11 | 12 | /** 13 | * 写入 BYTE 无符号单字节整型 (字节,8位) 14 | * 15 | * @param x 写入数据 16 | */ 17 | void writeByte(byte x); 18 | 19 | /** 20 | * 写入 BYTE 无符号单字节整型 (字节,8位) 21 | * 22 | * @param x 写入数据 23 | */ 24 | void writeByte(int x); 25 | 26 | /** 27 | * 写入 WORD 无符号双字节整型 (字节,16位) 28 | * 29 | * @param x 写入数据 30 | */ 31 | void writeWord(int x); 32 | 33 | /** 34 | * 写入 DWORD 无符号四字节整型 (字节,32位) 35 | * 36 | * @param x 写入数据 37 | */ 38 | void writeDWord(long x); 39 | 40 | /** 41 | * 写入 n 字节数据 42 | * 43 | * @param x 写入数据 44 | */ 45 | void writeBytes(byte[] x); 46 | 47 | /** 48 | * 写入 n 字节数据 49 | * 50 | * @param x 写入数据 51 | * @param offset 开始位置 52 | * @param length 写入长度 53 | */ 54 | void writeBytes(byte[] x, int offset, int length); 55 | 56 | /** 57 | * 写入 n 字节数据 58 | * 59 | * @param x 写入数据 60 | */ 61 | void writeBytes(ByteBuffer x); 62 | 63 | /** 64 | * 写入 GBK 编码字符串数据,若无数据,置空 65 | * 66 | * @param x 写入数据 67 | */ 68 | void writeString(String x); 69 | } 70 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/header/JT808MessageHeaderRegistration.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.header; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808ProtocolVersion; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | import java.util.function.BiFunction; 10 | 11 | /** 12 | * JT808 消息头注册器 13 | */ 14 | public class JT808MessageHeaderRegistration { 15 | private static final Map> decoders = new HashMap<>(3); 16 | 17 | public static Map> getDecoders() { 18 | return decoders; 19 | } 20 | 21 | public static void register(JT808ProtocolVersion protocolVersion, BiFunction headerDecoder) { 22 | decoders.put(protocolVersion, headerDecoder); 23 | } 24 | 25 | static { 26 | register(JT808MessageHeader2011.PROTOCOL_VERSION, JT808MessageHeader2011::decode); 27 | register(JT808MessageHeader2013.PROTOCOL_VERSION, JT808MessageHeader2013::decode); 28 | register(JT808MessageHeader2019.PROTOCOL_VERSION, JT808MessageHeader2019::decode); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/serialization/IJT808MessageBufferWriter.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.serialization; 2 | 3 | import java.nio.ByteBuffer; 4 | 5 | /** 6 | * JT808 消息Buffer写入器 7 | */ 8 | public interface IJT808MessageBufferWriter { 9 | 10 | /** 11 | * 写入 BYTE 无符号单字节整型 (字节,8位) 12 | * 13 | * @param x 写入数据 14 | */ 15 | void writeByte(byte x); 16 | 17 | /** 18 | * 写入 BYTE 无符号单字节整型 (字节,8位) 19 | * 20 | * @param x 写入数据 21 | */ 22 | void writeByte(int x); 23 | 24 | /** 25 | * 写入 WORD 无符号双字节整型 (字节,16位) 26 | * 27 | * @param x 写入数据 28 | */ 29 | void writeWord(int x); 30 | 31 | /** 32 | * 写入 DWORD 无符号四字节整型 (字节,32位) 33 | * 34 | * @param x 写入数据 35 | */ 36 | void writeDWord(long x); 37 | 38 | /** 39 | * 写入 n 字节数据 40 | * 41 | * @param x 写入数据 42 | */ 43 | void writeBytes(byte[] x); 44 | 45 | /** 46 | * 写入 n 字节数据 47 | * 48 | * @param x 写入数据 49 | * @param offset 开始位置 50 | * @param length 写入长度 51 | */ 52 | void writeBytes(byte[] x, int offset, int length); 53 | 54 | /** 55 | * 写入 n 字节数据 56 | * 57 | * @param x 写入数据 58 | */ 59 | void writeBytes(ByteBuffer x); 60 | 61 | /** 62 | * 写入 8421 码,n 字节 63 | * 64 | * @param x 写入数据 65 | */ 66 | void writeBCD(String x); 67 | 68 | /** 69 | * 写入 GBK 编码字符串数据,若无数据,置空 70 | * 71 | * @param x 写入数据 72 | */ 73 | void writeString(String x); 74 | } 75 | -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/serialization/IJT905MessageBufferWriter.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol.serialization; 2 | 3 | import java.nio.ByteBuffer; 4 | 5 | /** 6 | * JT905 消息Buffer写入器 7 | */ 8 | public interface IJT905MessageBufferWriter { 9 | 10 | /** 11 | * 写入 BYTE 无符号单字节整型 (字节,8位) 12 | * 13 | * @param x 写入数据 14 | */ 15 | void writeByte(byte x); 16 | 17 | /** 18 | * 写入 BYTE 无符号单字节整型 (字节,8位) 19 | * 20 | * @param x 写入数据 21 | */ 22 | void writeByte(int x); 23 | 24 | /** 25 | * 写入 WORD 无符号双字节整型 (字节,16位) 26 | * 27 | * @param x 写入数据 28 | */ 29 | void writeWord(int x); 30 | 31 | /** 32 | * 写入 DWORD 无符号四字节整型 (字节,32位) 33 | * 34 | * @param x 写入数据 35 | */ 36 | void writeDWord(long x); 37 | 38 | /** 39 | * 写入 n 字节数据 40 | * 41 | * @param x 写入数据 42 | */ 43 | void writeBytes(byte[] x); 44 | 45 | /** 46 | * 写入 n 字节数据 47 | * 48 | * @param x 写入数据 49 | * @param offset 开始位置 50 | * @param length 写入长度 51 | */ 52 | void writeBytes(byte[] x, int offset, int length); 53 | 54 | /** 55 | * 写入 n 字节数据 56 | * 57 | * @param x 写入数据 58 | */ 59 | void writeBytes(ByteBuffer x); 60 | 61 | /** 62 | * 写入 8421 码,n 字节 63 | * 64 | * @param x 写入数据 65 | */ 66 | void writeBCD(String x); 67 | 68 | /** 69 | * 写入 GBK 编码字符串数据,若无数据,置空 70 | * 71 | * @param x 写入数据 72 | */ 73 | void writeString(String x); 74 | } 75 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/message/content/JT809_Message_Content_0x1400_Sub/JT809_Message_Content_0x1400_SubMessageRegistration.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.message.content.JT809_Message_Content_0x1400_Sub; 2 | 3 | import ai.sangmado.gbprotocol.jt809.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt809.protocol.serialization.IJT809MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809SubMessageId; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | import java.util.function.BiFunction; 10 | 11 | /** 12 | * 主链路报警信息交互消息 UP_WARN_MSG - 子消息 - 注册器 13 | */ 14 | public class JT809_Message_Content_0x1400_SubMessageRegistration { 15 | 16 | private static final Map> decoders = new HashMap<>(300); 17 | 18 | public static Map> getDecoders() { 19 | return decoders; 20 | } 21 | 22 | public static void registerDecoder(JT809SubMessageId messageId, BiFunction contentDecoder) { 23 | decoders.put(messageId, contentDecoder); 24 | } 25 | 26 | static { 27 | registerDecoder(JT809_Message_Content_0x1400_Sub_0x1402.SUB_MESSAGE_ID, JT809_Message_Content_0x1400_Sub_0x1402::decode); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/enums/JT809VersionFlag.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.enums; 2 | 3 | import lombok.*; 4 | 5 | /** 6 | * 协议版本号标识 7 | */ 8 | @Getter 9 | @Setter 10 | @NoArgsConstructor 11 | @AllArgsConstructor 12 | @Builder 13 | public class JT809VersionFlag { 14 | public static final int MajorIndex = 0; 15 | public static final int MinorIndex = 1; 16 | public static final int BuildIndex = 2; 17 | public static final int FixedByteLength = 3; 18 | 19 | private byte majorVersion; 20 | 21 | private byte minorVersion; 22 | 23 | private byte buildVersion; 24 | 25 | public JT809VersionFlag(int majorVersion, int minorVersion, int buildVersion) { 26 | this.majorVersion = (byte) majorVersion; 27 | this.minorVersion = (byte) minorVersion; 28 | this.buildVersion = (byte) buildVersion; 29 | } 30 | 31 | public JT809VersionFlag(byte[] array) { 32 | this.majorVersion = array[MajorIndex]; 33 | this.minorVersion = array[MinorIndex]; 34 | this.buildVersion = array[BuildIndex]; 35 | } 36 | 37 | public byte[] toArray() { 38 | byte[] array = new byte[FixedByteLength]; 39 | array[MajorIndex] = getMajorVersion(); 40 | array[MinorIndex] = getMinorVersion(); 41 | array[BuildIndex] = getBuildVersion(); 42 | return array; 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return String.format("%s.%s.%s", 48 | getMajorVersion(), getMinorVersion(), getBuildVersion()); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/message/content/device/GB32960DeviceMessageContentRegistration.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.message.content.device; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960DeviceCommandId; 5 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageBufferReader; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | import java.util.function.BiFunction; 10 | 11 | /** 12 | * GB32960 数据单元注册器 (终端) 13 | */ 14 | public class GB32960DeviceMessageContentRegistration { 15 | private static final Map> decoders = new HashMap<>(300); 16 | 17 | public static Map> getDecoders() { 18 | return decoders; 19 | } 20 | 21 | public static void registerDecoder(GB32960DeviceCommandId commandId, BiFunction contentDecoder) { 22 | decoders.put(commandId, contentDecoder); 23 | } 24 | 25 | static { 26 | registerDecoder(GB32960_Device_Message_Content_0x01.COMMAND_ID, GB32960_Device_Message_Content_0x01::decode); 27 | registerDecoder(GB32960_Device_Message_Content_0x04.COMMAND_ID, GB32960_Device_Message_Content_0x04::decode); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/message/content/JT809MessageContent.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.memory.PooledByteArray; 4 | import ai.sangmado.gbprotocol.jt809.protocol.serialization.IJT809MessageBufferWriter; 5 | import ai.sangmado.gbprotocol.jt809.protocol.serialization.IJT809MessageFormatter; 6 | import ai.sangmado.gbprotocol.jt809.protocol.IVersionedSpecificationContext; 7 | import ai.sangmado.gbprotocol.jt809.protocol.serialization.impl.JT809MessageByteBufferWriter; 8 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809MessageId; 9 | 10 | import java.nio.ByteBuffer; 11 | 12 | /** 13 | * JT809 消息体 14 | */ 15 | public abstract class JT809MessageContent implements IJT809MessageFormatter { 16 | 17 | /** 18 | * 获取消息体定义的消息ID 19 | * 20 | * @return 消息ID 21 | */ 22 | public abstract JT809MessageId getMessageId(); 23 | 24 | /** 25 | * 获取消息体长度 26 | * 27 | * @param ctx 协议规范上下文 28 | * @return 消息体长度 29 | */ 30 | public int getContentLength(IVersionedSpecificationContext ctx) { 31 | PooledByteArray pba = ctx.getBufferPool().borrow(); 32 | try { 33 | ByteBuffer buf = ByteBuffer.wrap(pba.array()); 34 | IJT809MessageBufferWriter bufWriter = new JT809MessageByteBufferWriter(ctx, buf); 35 | this.serialize(ctx, bufWriter); 36 | buf.flip(); 37 | return buf.remaining(); 38 | } finally { 39 | ctx.getBufferPool().recycle(pba); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/serialization/IJT808MessageBufferReader.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.serialization; 2 | 3 | /** 4 | * JT808 消息Buffer读取器 5 | */ 6 | public interface IJT808MessageBufferReader { 7 | 8 | /** 9 | * 标记当前读取位置 10 | */ 11 | void markIndex(); 12 | 13 | /** 14 | * 重置至已标记的读取位置 15 | */ 16 | void resetIndex(); 17 | 18 | /** 19 | * 是否还有可读数据 20 | * 21 | * @return 是否还有可读数据 22 | */ 23 | boolean isReadable(); 24 | 25 | /** 26 | * 是否还有可读数据 27 | * 28 | * @param size 可读数据最低长度 29 | * @return 是否还有可读数据 30 | */ 31 | boolean isReadable(int size); 32 | 33 | /** 34 | * 可读数据长度 35 | * 36 | * @return 可读数据长度 37 | */ 38 | int readableBytes(); 39 | 40 | /** 41 | * 读取 BYTE 无符号单字节整型 (字节,8位) 42 | */ 43 | byte readByte(); 44 | 45 | /** 46 | * 读取 WORD 无符号双字节整型 (字节,16位) 47 | */ 48 | int readWord(); 49 | 50 | /** 51 | * 读取 DWORD 无符号四字节整型 (字节,32位) 52 | */ 53 | long readDWord(); 54 | 55 | /** 56 | * 读取 n 字节数据 57 | * 58 | * @param length 读取长度 59 | */ 60 | byte[] readBytes(int length); 61 | 62 | /** 63 | * 读取 n 字节为 8421 码 64 | * 65 | * @param length 读取长度 66 | */ 67 | String readBCD(int length); 68 | 69 | /** 70 | * 读取 n 字节为字符串,GBK 编码 71 | * 72 | * @param length 读取长度 73 | */ 74 | String readString(int length); 75 | 76 | /** 77 | * 读取剩余字节为字符串,GBK 编码 78 | */ 79 | String readStringRemaining(); 80 | } 81 | -------------------------------------------------------------------------------- /jt905/src/main/java/ai/sangmado/gbprotocol/jt905/protocol/serialization/IJT905MessageBufferReader.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt905.protocol.serialization; 2 | 3 | /** 4 | * JT905 消息Buffer读取器 5 | */ 6 | public interface IJT905MessageBufferReader { 7 | 8 | /** 9 | * 标记当前读取位置 10 | */ 11 | void markIndex(); 12 | 13 | /** 14 | * 重置至已标记的读取位置 15 | */ 16 | void resetIndex(); 17 | 18 | /** 19 | * 是否还有可读数据 20 | * 21 | * @return 是否还有可读数据 22 | */ 23 | boolean isReadable(); 24 | 25 | /** 26 | * 是否还有可读数据 27 | * 28 | * @param size 可读数据最低长度 29 | * @return 是否还有可读数据 30 | */ 31 | boolean isReadable(int size); 32 | 33 | /** 34 | * 可读数据长度 35 | * 36 | * @return 可读数据长度 37 | */ 38 | int readableBytes(); 39 | 40 | /** 41 | * 读取 BYTE 无符号单字节整型 (字节,8位) 42 | */ 43 | byte readByte(); 44 | 45 | /** 46 | * 读取 WORD 无符号双字节整型 (字节,16位) 47 | */ 48 | int readWord(); 49 | 50 | /** 51 | * 读取 DWORD 无符号四字节整型 (字节,32位) 52 | */ 53 | long readDWord(); 54 | 55 | /** 56 | * 读取 n 字节数据 57 | * 58 | * @param length 读取长度 59 | */ 60 | byte[] readBytes(int length); 61 | 62 | /** 63 | * 读取 n 字节为 8421 码 64 | * 65 | * @param length 读取长度 66 | */ 67 | String readBCD(int length); 68 | 69 | /** 70 | * 读取 n 字节为字符串,GBK 编码 71 | * 72 | * @param length 读取长度 73 | */ 74 | String readString(int length); 75 | 76 | /** 77 | * 读取剩余字节为字符串,GBK 编码 78 | */ 79 | String readStringRemaining(); 80 | } 81 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x0002.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | * 终端心跳 14 | */ 15 | @Getter 16 | @Setter 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x0002 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x0002; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | @Override 28 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 29 | // 终端心跳数据消息体为空 30 | } 31 | 32 | @Override 33 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 34 | // 终端心跳数据消息体为空 35 | } 36 | 37 | public static JT808_Message_Content_0x0002 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | JT808_Message_Content_0x0002 content = new JT808_Message_Content_0x0002(); 39 | content.deserialize(ctx, reader); 40 | return content; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x0003.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | * 终端注销 14 | */ 15 | @Getter 16 | @Setter 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x0003 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x0003; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | @Override 28 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 29 | // 终端注销数据消息体为空 30 | } 31 | 32 | @Override 33 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 34 | // 终端注销数据消息体为空 35 | } 36 | 37 | public static JT808_Message_Content_0x0003 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | JT808_Message_Content_0x0003 content = new JT808_Message_Content_0x0003(); 39 | content.deserialize(ctx, reader); 40 | return content; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/message/content/platform/GB32960PlatformMessageContentRegistration.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.message.content.platform; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960PlatformCommandId; 5 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageBufferReader; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | import java.util.function.BiFunction; 10 | 11 | /** 12 | * GB32960 数据单元注册器 (平台) 13 | */ 14 | public class GB32960PlatformMessageContentRegistration { 15 | private static final Map> decoders = new HashMap<>(300); 16 | 17 | public static Map> getDecoders() { 18 | return decoders; 19 | } 20 | 21 | public static void registerDecoder(GB32960PlatformCommandId commandId, BiFunction contentDecoder) { 22 | decoders.put(commandId, contentDecoder); 23 | } 24 | 25 | static { 26 | registerDecoder(GB32960_Platform_Message_Content_0x01.COMMAND_ID, GB32960_Platform_Message_Content_0x01::decode); 27 | registerDecoder(GB32960_Platform_Message_Content_0x04.COMMAND_ID, GB32960_Platform_Message_Content_0x04::decode); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x8104.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | * 平台查询终端参数 14 | */ 15 | @Getter 16 | @Setter 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x8104 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x8104; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | @Override 28 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 29 | // 查询终端参数消息体为空 30 | } 31 | 32 | @Override 33 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 34 | // 查询终端参数消息体为空 35 | } 36 | 37 | public static JT808_Message_Content_0x8104 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | JT808_Message_Content_0x8104 content = new JT808_Message_Content_0x8104(); 39 | content.deserialize(ctx, reader); 40 | return content; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x8201.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | * 平台位置信息查询 14 | */ 15 | @Getter 16 | @Setter 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x8201 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x8201; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | @Override 28 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 29 | // 位置信息查询消息体为空 30 | } 31 | 32 | @Override 33 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 34 | // 位置信息查询消息体为空 35 | } 36 | 37 | public static JT808_Message_Content_0x8201 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | JT808_Message_Content_0x8201 content = new JT808_Message_Content_0x8201(); 39 | content.deserialize(ctx, reader); 40 | return content; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x8204.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | * 平台终端链路检测指令 14 | */ 15 | @Getter 16 | @Setter 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x8204 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x8204; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | @Override 28 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 29 | // 链路检测消息体为空 30 | } 31 | 32 | @Override 33 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 34 | // 链路检测消息体为空 35 | } 36 | 37 | public static JT808_Message_Content_0x8204 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | JT808_Message_Content_0x8204 content = new JT808_Message_Content_0x8204(); 39 | content.deserialize(ctx, reader); 40 | return content; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x0004.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | * 终端查询服务器时间请求 14 | */ 15 | @Getter 16 | @Setter 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x0004 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x0004; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | @Override 28 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 29 | // 终端查询服务器时间请求数据消息体为空 30 | } 31 | 32 | @Override 33 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 34 | // 终端查询服务器时间请求数据消息体为空 35 | } 36 | 37 | public static JT808_Message_Content_0x0004 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | JT808_Message_Content_0x0004 content = new JT808_Message_Content_0x0004(); 39 | content.deserialize(ctx, reader); 40 | return content; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x8107.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | * 平台查询终端属性 14 | * 15 | * @since V2013 16 | */ 17 | @Getter 18 | @Setter 19 | @AllArgsConstructor 20 | @Builder 21 | public class JT808_Message_Content_0x8107 extends JT808MessageContent { 22 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x8107; 23 | 24 | @Override 25 | public JT808MessageId getMessageId() { 26 | return MESSAGE_ID; 27 | } 28 | 29 | @Override 30 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 31 | // 查询终端属性消息体为空 32 | } 33 | 34 | @Override 35 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 36 | // 查询终端属性消息体为空 37 | } 38 | 39 | public static JT808_Message_Content_0x8107 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 40 | JT808_Message_Content_0x8107 content = new JT808_Message_Content_0x8107(); 41 | content.deserialize(ctx, reader); 42 | return content; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/reply/GB19056_Reply_Message_Block_0x03.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content.reply; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.enums.GB19056ReplyMessageId; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.content.GB19056MessageBlock; 5 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | * 采集累计行驶里程 13 | */ 14 | @Getter 15 | @Setter 16 | public class GB19056_Reply_Message_Block_0x03 extends GB19056MessageBlock { 17 | public static final GB19056ReplyMessageId MESSAGE_ID = GB19056ReplyMessageId.GB19056_Message_Reply_0x03; 18 | 19 | @Override 20 | public GB19056ReplyMessageId getMessageId() { 21 | return MESSAGE_ID; 22 | } 23 | 24 | @Override 25 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 26 | 27 | } 28 | 29 | @Override 30 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 31 | 32 | } 33 | 34 | public static GB19056_Reply_Message_Block_0x03 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | GB19056_Reply_Message_Block_0x03 content = new GB19056_Reply_Message_Block_0x03(); 36 | content.deserialize(ctx, reader); 37 | return content; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/reply/GB19056_Reply_Message_Block_0x00.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content.reply; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.enums.GB19056ReplyMessageId; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.content.GB19056MessageBlock; 5 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | * 采集记录仪执行标准版本 13 | */ 14 | @Getter 15 | @Setter 16 | public class GB19056_Reply_Message_Block_0x00 extends GB19056MessageBlock { 17 | public static final GB19056ReplyMessageId MESSAGE_ID = GB19056ReplyMessageId.GB19056_Message_Reply_0x00; 18 | 19 | @Override 20 | public GB19056ReplyMessageId getMessageId() { 21 | return MESSAGE_ID; 22 | } 23 | 24 | @Override 25 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 26 | 27 | } 28 | 29 | @Override 30 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 31 | 32 | } 33 | 34 | public static GB19056_Reply_Message_Block_0x00 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | GB19056_Reply_Message_Block_0x00 content = new GB19056_Reply_Message_Block_0x00(); 36 | content.deserialize(ctx, reader); 37 | return content; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/reply/GB19056_Reply_Message_Block_0x01.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content.reply; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.enums.GB19056ReplyMessageId; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.content.GB19056MessageBlock; 5 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | * 采集当前驾驶人信息 13 | */ 14 | @Getter 15 | @Setter 16 | public class GB19056_Reply_Message_Block_0x01 extends GB19056MessageBlock { 17 | public static final GB19056ReplyMessageId MESSAGE_ID = GB19056ReplyMessageId.GB19056_Message_Reply_0x01; 18 | 19 | @Override 20 | public GB19056ReplyMessageId getMessageId() { 21 | return MESSAGE_ID; 22 | } 23 | 24 | @Override 25 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 26 | 27 | } 28 | 29 | @Override 30 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 31 | 32 | } 33 | 34 | public static GB19056_Reply_Message_Block_0x01 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | GB19056_Reply_Message_Block_0x01 content = new GB19056_Reply_Message_Block_0x01(); 36 | content.deserialize(ctx, reader); 37 | return content; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/reply/GB19056_Reply_Message_Block_0x02.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content.reply; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.enums.GB19056ReplyMessageId; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.content.GB19056MessageBlock; 5 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | * 采集记录仪实时时间 13 | */ 14 | @Getter 15 | @Setter 16 | public class GB19056_Reply_Message_Block_0x02 extends GB19056MessageBlock { 17 | public static final GB19056ReplyMessageId MESSAGE_ID = GB19056ReplyMessageId.GB19056_Message_Reply_0x02; 18 | 19 | @Override 20 | public GB19056ReplyMessageId getMessageId() { 21 | return MESSAGE_ID; 22 | } 23 | 24 | @Override 25 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 26 | 27 | } 28 | 29 | @Override 30 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 31 | 32 | } 33 | 34 | public static GB19056_Reply_Message_Block_0x02 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | GB19056_Reply_Message_Block_0x02 content = new GB19056_Reply_Message_Block_0x02(); 36 | content.deserialize(ctx, reader); 37 | return content; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/reply/GB19056_Reply_Message_Block_0x04.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content.reply; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.enums.GB19056ReplyMessageId; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.content.GB19056MessageBlock; 5 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | * 采集记录仪脉冲系数 13 | */ 14 | @Getter 15 | @Setter 16 | public class GB19056_Reply_Message_Block_0x04 extends GB19056MessageBlock { 17 | public static final GB19056ReplyMessageId MESSAGE_ID = GB19056ReplyMessageId.GB19056_Message_Reply_0x04; 18 | 19 | @Override 20 | public GB19056ReplyMessageId getMessageId() { 21 | return MESSAGE_ID; 22 | } 23 | 24 | @Override 25 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 26 | 27 | } 28 | 29 | @Override 30 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 31 | 32 | } 33 | 34 | public static GB19056_Reply_Message_Block_0x04 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | GB19056_Reply_Message_Block_0x04 content = new GB19056_Reply_Message_Block_0x04(); 36 | content.deserialize(ctx, reader); 37 | return content; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /jt808/README.md: -------------------------------------------------------------------------------- 1 | # JT808协议 2 | 3 | JT/T808 Global navigation satellite system for vehicle engaged in road transport - 4 | General specifications for vehicle terminal communication protocol and data format. 5 | 6 | JT/T808 道路运输车辆卫星定位系统 终端通信协议及数据格式 7 | 8 | ## JT808协议消息数据结构 9 | 10 | ### 消息结构 JT808MessagePackage 11 | 12 | 每条消息由标识位、消息头、消息体、校验码组成。 13 | 14 | | 头标识 | 消息头 | 消息体 | 校验码 | 尾标识 | 15 | | :---------: | :----------------: | :-----------------: | :------: | :-------: | 16 | | BeginMarker | JT808MessageHeader | JT808MessageContent | Checksum | EndMarker | 17 | | 7E | - | - | - | 7E | 18 | 19 | ### 消息头 JT808MessageHeader 20 | 21 | | 消息ID | 消息体属性 | 协议版本号 | 终端手机号 | 消息流水号 | 消息包封装项 | 22 | | :-------: | :--------------------------------------: | :-------------: | :---------: | :----------: | :-------------------------------------: | 23 | | MessageId | JT808MessageHeaderMessageContentProperty | ProtocolVersion | PhoneNumber | SerialNumber | JT808MessageHeaderMessagePacketProperty | 24 | 25 | 消息包封装项:如果消息体属性中相关标识位确定消息分包处理,则该项有内容,否则无该项。 26 | 27 | #### 消息头中消息体属性 JT808MessageHeaderMessageContentProperty 28 | 29 | | 保留位 | 版本标识 | 是否分包 | 加密方式 | 消息体长度 | 30 | | :------: | :---------------: | :---------------: | :------------: | :-----------: | 31 | | Reserved | VersionIdentifier | IsMultiplePackets | EncryptionMode | ContentLength | 32 | 33 | #### 消息头中消息包封装项 JT808MessageHeaderMessagePacketProperty 34 | 35 | | 消息总包数 | 包序号 | 36 | | :----------: | :------------: | 37 | | TotalPackets | PacketSequence | 38 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x8702.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.AllArgsConstructor; 8 | import lombok.Builder; 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | * 平台上报驾驶员身份信息请求 14 | * 15 | * @since V2013 16 | */ 17 | @Getter 18 | @Setter 19 | @AllArgsConstructor 20 | @Builder 21 | public class JT808_Message_Content_0x8702 extends JT808MessageContent { 22 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x8702; 23 | 24 | @Override 25 | public JT808MessageId getMessageId() { 26 | return MESSAGE_ID; 27 | } 28 | 29 | @Override 30 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 31 | // 上报驾驶员身份信息请求消息体为空。 32 | } 33 | 34 | @Override 35 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 36 | // 上报驾驶员身份信息请求消息体为空。 37 | } 38 | 39 | public static JT808_Message_Content_0x8702 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 40 | JT808_Message_Content_0x8702 content = new JT808_Message_Content_0x8702(); 41 | content.deserialize(ctx, reader); 42 | return content; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/message/content/device/GB32960DeviceMessageContent.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.message.content.device; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960DeviceCommandId; 5 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageBufferWriter; 6 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageFormatter; 7 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.impl.GB32960MessageByteBufferWriter; 8 | import ai.sangmado.gbprotocol.gbcommon.memory.PooledByteArray; 9 | 10 | import java.nio.ByteBuffer; 11 | 12 | /** 13 | * GB32960 数据单元 (终端) 14 | */ 15 | public abstract class GB32960DeviceMessageContent implements IGB32960MessageFormatter { 16 | 17 | /** 18 | * 获取命令ID 19 | * 20 | * @return 命令ID 21 | */ 22 | public abstract GB32960DeviceCommandId getCommandId(); 23 | 24 | /** 25 | * 获取数据单元长度 26 | * 27 | * @param ctx 协议规范上下文 28 | * @return 数据单元长度 29 | */ 30 | public int getContentLength(IVersionedSpecificationContext ctx) { 31 | PooledByteArray pba = ctx.getBufferPool().borrow(); 32 | try { 33 | ByteBuffer buf = ByteBuffer.wrap(pba.array()); 34 | IGB32960MessageBufferWriter bufWriter = new GB32960MessageByteBufferWriter(ctx, buf); 35 | this.serialize(ctx, bufWriter); 36 | buf.flip(); 37 | return buf.remaining(); 38 | } finally { 39 | ctx.getBufferPool().recycle(pba); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /jt1078/src/main/java/ai/sangmado/gbprotocol/jt1078/protocol/message/content/JT1078_Message_Content_0x9003.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt1078.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt1078.protocol.enums.JT1078MessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808MessageContent; 8 | import lombok.AllArgsConstructor; 9 | import lombok.Builder; 10 | import lombok.Getter; 11 | import lombok.Setter; 12 | 13 | /** 14 | * 平台查询终端音视频属性 15 | */ 16 | @Getter 17 | @Setter 18 | @AllArgsConstructor 19 | @Builder 20 | public class JT1078_Message_Content_0x9003 extends JT808MessageContent { 21 | public static final JT1078MessageId MESSAGE_ID = JT1078MessageId.JT1078_Message_0x9003; 22 | 23 | @Override 24 | public JT1078MessageId getMessageId() { 25 | return MESSAGE_ID; 26 | } 27 | 28 | @Override 29 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 30 | } 31 | 32 | @Override 33 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 34 | } 35 | 36 | public static JT1078_Message_Content_0x9003 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 37 | JT1078_Message_Content_0x9003 content = new JT1078_Message_Content_0x9003(); 38 | content.deserialize(ctx, reader); 39 | return content; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_Passthrough_Message/JT808_Message_Content_0x0900_Registration.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808_Message_Content_Passthrough_Message; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | import java.util.function.BiFunction; 9 | 10 | /** 11 | * 透传消息注册器 12 | */ 13 | public class JT808_Message_Content_0x0900_Registration { 14 | 15 | private static final Map> decoders = new HashMap<>(300); 16 | 17 | public static Map> getDecoders() { 18 | return decoders; 19 | } 20 | 21 | public static void registerDecoder(JT808_Message_Content_Passthrough_MessageType messageType, BiFunction contentDecoder) { 22 | decoders.put(messageType, contentDecoder); 23 | } 24 | 25 | static { 26 | registerDecoder(JT808_Message_Content_0x0900_Message_0x00.MESSAGE_TYPE, JT808_Message_Content_0x0900_Message_0x00::decode); 27 | registerDecoder(JT808_Message_Content_0x0900_Message_0x0B.MESSAGE_TYPE, JT808_Message_Content_0x0900_Message_0x0B::decode); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/message/content/platform/GB32960PlatformMessageContent.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.message.content.platform; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960PlatformCommandId; 5 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageBufferWriter; 6 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageFormatter; 7 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.impl.GB32960MessageByteBufferWriter; 8 | import ai.sangmado.gbprotocol.gbcommon.memory.PooledByteArray; 9 | 10 | import java.nio.ByteBuffer; 11 | 12 | /** 13 | * GB32960 数据单元 (平台) 14 | */ 15 | public abstract class GB32960PlatformMessageContent implements IGB32960MessageFormatter { 16 | 17 | /** 18 | * 获取命令ID 19 | * 20 | * @return 命令ID 21 | */ 22 | public abstract GB32960PlatformCommandId getCommandId(); 23 | 24 | /** 25 | * 获取数据单元长度 26 | * 27 | * @param ctx 协议规范上下文 28 | * @return 数据单元长度 29 | */ 30 | public int getContentLength(IVersionedSpecificationContext ctx) { 31 | PooledByteArray pba = ctx.getBufferPool().borrow(); 32 | try { 33 | ByteBuffer buf = ByteBuffer.wrap(pba.array()); 34 | IGB32960MessageBufferWriter bufWriter = new GB32960MessageByteBufferWriter(ctx, buf); 35 | this.serialize(ctx, bufWriter); 36 | buf.flip(); 37 | return buf.remaining(); 38 | } finally { 39 | ctx.getBufferPool().recycle(pba); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/command/GB19056_Command_Message_Block_0x00.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content.command; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.enums.GB19056CommandMessageId; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.content.GB19056MessageBlock; 5 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | * 采集记录仪执行标准版本 13 | */ 14 | @Getter 15 | @Setter 16 | public class GB19056_Command_Message_Block_0x00 extends GB19056MessageBlock { 17 | public static final GB19056CommandMessageId MESSAGE_ID = GB19056CommandMessageId.GB19056_Message_Command_0x00; 18 | 19 | @Override 20 | public GB19056CommandMessageId getMessageId() { 21 | return MESSAGE_ID; 22 | } 23 | 24 | @Override 25 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 26 | 27 | } 28 | 29 | @Override 30 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 31 | 32 | } 33 | 34 | public static GB19056_Command_Message_Block_0x00 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | GB19056_Command_Message_Block_0x00 content = new GB19056_Command_Message_Block_0x00(); 36 | content.deserialize(ctx, reader); 37 | return content; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/command/GB19056_Command_Message_Block_0x01.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content.command; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.enums.GB19056CommandMessageId; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.content.GB19056MessageBlock; 5 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | * 采集当前驾驶人信息 13 | */ 14 | @Getter 15 | @Setter 16 | public class GB19056_Command_Message_Block_0x01 extends GB19056MessageBlock { 17 | public static final GB19056CommandMessageId MESSAGE_ID = GB19056CommandMessageId.GB19056_Message_Command_0x01; 18 | 19 | @Override 20 | public GB19056CommandMessageId getMessageId() { 21 | return MESSAGE_ID; 22 | } 23 | 24 | @Override 25 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 26 | 27 | } 28 | 29 | @Override 30 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 31 | 32 | } 33 | 34 | public static GB19056_Command_Message_Block_0x01 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | GB19056_Command_Message_Block_0x01 content = new GB19056_Command_Message_Block_0x01(); 36 | content.deserialize(ctx, reader); 37 | return content; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/command/GB19056_Command_Message_Block_0x02.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content.command; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.enums.GB19056CommandMessageId; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.content.GB19056MessageBlock; 5 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | * 采集记录仪实时时间 13 | */ 14 | @Getter 15 | @Setter 16 | public class GB19056_Command_Message_Block_0x02 extends GB19056MessageBlock { 17 | public static final GB19056CommandMessageId MESSAGE_ID = GB19056CommandMessageId.GB19056_Message_Command_0x02; 18 | 19 | @Override 20 | public GB19056CommandMessageId getMessageId() { 21 | return MESSAGE_ID; 22 | } 23 | 24 | @Override 25 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 26 | 27 | } 28 | 29 | @Override 30 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 31 | 32 | } 33 | 34 | public static GB19056_Command_Message_Block_0x02 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | GB19056_Command_Message_Block_0x02 content = new GB19056_Command_Message_Block_0x02(); 36 | content.deserialize(ctx, reader); 37 | return content; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/command/GB19056_Command_Message_Block_0x03.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content.command; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.enums.GB19056CommandMessageId; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.content.GB19056MessageBlock; 5 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | * 采集累计行驶里程 13 | */ 14 | @Getter 15 | @Setter 16 | public class GB19056_Command_Message_Block_0x03 extends GB19056MessageBlock { 17 | public static final GB19056CommandMessageId MESSAGE_ID = GB19056CommandMessageId.GB19056_Message_Command_0x03; 18 | 19 | @Override 20 | public GB19056CommandMessageId getMessageId() { 21 | return MESSAGE_ID; 22 | } 23 | 24 | @Override 25 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 26 | 27 | } 28 | 29 | @Override 30 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 31 | 32 | } 33 | 34 | public static GB19056_Command_Message_Block_0x03 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | GB19056_Command_Message_Block_0x03 content = new GB19056_Command_Message_Block_0x03(); 36 | content.deserialize(ctx, reader); 37 | return content; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/command/GB19056_Command_Message_Block_0x04.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content.command; 2 | 3 | import ai.sangmado.gbprotocol.gb19056.protocol.enums.GB19056CommandMessageId; 4 | import ai.sangmado.gbprotocol.gb19056.protocol.message.content.GB19056MessageBlock; 5 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** 12 | * 采集记录仪脉冲系数 13 | */ 14 | @Getter 15 | @Setter 16 | public class GB19056_Command_Message_Block_0x04 extends GB19056MessageBlock { 17 | public static final GB19056CommandMessageId MESSAGE_ID = GB19056CommandMessageId.GB19056_Message_Command_0x04; 18 | 19 | @Override 20 | public GB19056CommandMessageId getMessageId() { 21 | return MESSAGE_ID; 22 | } 23 | 24 | @Override 25 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 26 | 27 | } 28 | 29 | @Override 30 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 31 | 32 | } 33 | 34 | public static GB19056_Command_Message_Block_0x04 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | GB19056_Command_Message_Block_0x04 content = new GB19056_Command_Message_Block_0x04(); 36 | content.deserialize(ctx, reader); 37 | return content; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /jt808db32t3610/src/main/java/ai/sangmado/gbprotocol/jt808db32t3610/protocol/message/content/JT808DB32T3610_WarningFileDescription.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db32t3610.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 7 | import lombok.*; 8 | 9 | /** 10 | * 报警附件文件描述 11 | */ 12 | @Getter 13 | @Setter 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | @Builder 17 | public class JT808DB32T3610_WarningFileDescription implements IJT808MessageFormatter { 18 | 19 | /** 20 | * 文件名称长度 21 | */ 22 | private Integer fileNameLength; 23 | /** 24 | * 文件名称 25 | *

26 | * 文件名称命名规则为: 文件类型_通道号_报警类型_序号_报警编号_后缀名 27 | */ 28 | private String fileName; 29 | /** 30 | * 文件大小 31 | */ 32 | private Long fileSize; 33 | 34 | @Override 35 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 36 | 37 | } 38 | 39 | @Override 40 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 41 | 42 | } 43 | 44 | public static JT808DB32T3610_WarningFileDescription decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 45 | JT808DB32T3610_WarningFileDescription content = new JT808DB32T3610_WarningFileDescription(); 46 | content.deserialize(ctx, reader); 47 | return content; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x0A00.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.*; 8 | 9 | /** 10 | * 终端RSA公钥 11 | * 12 | * @since V2011 13 | */ 14 | @Getter 15 | @Setter 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x0A00 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x0A00; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | /** 28 | * 终端RSA公钥 {e,n} 中的 e 29 | */ 30 | private Long E; 31 | /** 32 | * 终端RSA公钥 {e,n} 中的 n 33 | */ 34 | private byte[] N; 35 | 36 | @Override 37 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 38 | 39 | } 40 | 41 | @Override 42 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 43 | 44 | } 45 | 46 | public static JT808_Message_Content_0x0A00 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 47 | JT808_Message_Content_0x0A00 content = new JT808_Message_Content_0x0A00(); 48 | content.deserialize(ctx, reader); 49 | return content; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x8A00.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.*; 8 | 9 | /** 10 | * 平台RSA公钥 11 | * 12 | * @since V2011 13 | */ 14 | @Getter 15 | @Setter 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x8A00 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x8A00; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | /** 28 | * 平台RSA公钥 {e,n} 中的 e 29 | */ 30 | private Long E; 31 | /** 32 | * 平台RSA公钥 {e,n} 中的 n 33 | */ 34 | private byte[] N; 35 | 36 | @Override 37 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 38 | 39 | } 40 | 41 | @Override 42 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 43 | 44 | } 45 | 46 | public static JT808_Message_Content_0x8A00 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 47 | JT808_Message_Content_0x8A00 content = new JT808_Message_Content_0x8A00(); 48 | content.deserialize(ctx, reader); 49 | return content; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /jt808db22jibiao/src/main/java/ai/sangmado/gbprotocol/jt808db22jibiao/protocol/message/content/JT808DB22JiBiao_WarningFileDescription.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db22jibiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 7 | import lombok.*; 8 | 9 | /** 10 | * 报警附件文件描述 11 | */ 12 | @Getter 13 | @Setter 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | @Builder 17 | public class JT808DB22JiBiao_WarningFileDescription implements IJT808MessageFormatter { 18 | 19 | /** 20 | * 文件名称长度 21 | */ 22 | private Integer fileNameLength; 23 | /** 24 | * 文件名称 25 | *

26 | * 文件名称命名规则为: 文件类型_通道号_报警类型_序号_报警编号_后缀名 27 | */ 28 | private String fileName; 29 | /** 30 | * 文件大小 31 | */ 32 | private Long fileSize; 33 | 34 | @Override 35 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 36 | 37 | } 38 | 39 | @Override 40 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 41 | 42 | } 43 | 44 | public static JT808DB22JiBiao_WarningFileDescription decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 45 | JT808DB22JiBiao_WarningFileDescription content = new JT808DB22JiBiao_WarningFileDescription(); 46 | content.deserialize(ctx, reader); 47 | return content; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /jt808db37lubiao/src/main/java/ai/sangmado/gbprotocol/jt808db37lubiao/protocol/message/content/JT808DB37LuBiao_WarningFileDescription.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db37lubiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 7 | import lombok.*; 8 | 9 | /** 10 | * 报警附件文件描述 11 | */ 12 | @Getter 13 | @Setter 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | @Builder 17 | public class JT808DB37LuBiao_WarningFileDescription implements IJT808MessageFormatter { 18 | 19 | /** 20 | * 文件名称长度 21 | */ 22 | private Integer fileNameLength; 23 | /** 24 | * 文件名称 25 | *

26 | * 文件名称命名规则为: 文件类型_通道号_报警类型_序号_报警编号_后缀名 27 | */ 28 | private String fileName; 29 | /** 30 | * 文件大小 31 | */ 32 | private Long fileSize; 33 | 34 | @Override 35 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 36 | 37 | } 38 | 39 | @Override 40 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 41 | 42 | } 43 | 44 | public static JT808DB37LuBiao_WarningFileDescription decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 45 | JT808DB37LuBiao_WarningFileDescription content = new JT808DB37LuBiao_WarningFileDescription(); 46 | content.deserialize(ctx, reader); 47 | return content; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /jt808db23heibiao/src/main/java/ai/sangmado/gbprotocol/jt808db23heibiao/protocol/message/content/JT808DB23HeiBiao_WarningFileDescription.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db23heibiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 7 | import lombok.*; 8 | 9 | /** 10 | * 报警附件文件描述 11 | */ 12 | @Getter 13 | @Setter 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | @Builder 17 | public class JT808DB23HeiBiao_WarningFileDescription implements IJT808MessageFormatter { 18 | 19 | /** 20 | * 文件名称长度 21 | */ 22 | private Integer fileNameLength; 23 | /** 24 | * 文件名称 25 | *

26 | * 文件名称命名规则为: 文件类型_通道号_报警类型_序号_报警编号_后缀名 27 | */ 28 | private String fileName; 29 | /** 30 | * 文件大小 31 | */ 32 | private Long fileSize; 33 | 34 | @Override 35 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 36 | 37 | } 38 | 39 | @Override 40 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 41 | 42 | } 43 | 44 | public static JT808DB23HeiBiao_WarningFileDescription decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 45 | JT808DB23HeiBiao_WarningFileDescription content = new JT808DB23HeiBiao_WarningFileDescription(); 46 | content.deserialize(ctx, reader); 47 | return content; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /jt808db51chuanbiao/src/main/java/ai/sangmado/gbprotocol/jt808db51chuanbiao/protocol/message/content/JT808DB51ChuanBiao_WarningFileDescription.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db51chuanbiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 7 | import lombok.*; 8 | 9 | /** 10 | * 报警附件文件描述 11 | */ 12 | @Getter 13 | @Setter 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | @Builder 17 | public class JT808DB51ChuanBiao_WarningFileDescription implements IJT808MessageFormatter { 18 | 19 | /** 20 | * 文件名称长度 21 | */ 22 | private Integer fileNameLength; 23 | /** 24 | * 文件名称 25 | *

26 | * 文件名称命名规则为: 文件类型_通道号_报警类型_序号_报警编号_后缀名 27 | */ 28 | private String fileName; 29 | /** 30 | * 文件大小 31 | */ 32 | private Long fileSize; 33 | 34 | @Override 35 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 36 | 37 | } 38 | 39 | @Override 40 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 41 | 42 | } 43 | 44 | public static JT808DB51ChuanBiao_WarningFileDescription decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 45 | JT808DB51ChuanBiao_WarningFileDescription content = new JT808DB51ChuanBiao_WarningFileDescription(); 46 | content.deserialize(ctx, reader); 47 | return content; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x8805.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.*; 8 | 9 | /** 10 | * 平台单条存储多媒体数据检索上传命令 11 | * 12 | * @since V2013 13 | */ 14 | @Getter 15 | @Setter 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x8805 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x8805; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | /** 28 | * 多媒体数据ID 29 | */ 30 | private Long mediaDataId; 31 | /** 32 | * 删除标志 33 | *

34 | * 0:保留;1:删除; 35 | */ 36 | private Boolean deletedFlag; 37 | 38 | @Override 39 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 40 | 41 | } 42 | 43 | @Override 44 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 45 | 46 | } 47 | 48 | public static JT808_Message_Content_0x8805 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 49 | JT808_Message_Content_0x8805 content = new JT808_Message_Content_0x8805(); 50 | content.deserialize(ctx, reader); 51 | return content; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x0901.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.*; 8 | 9 | /** 10 | * 终端数据压缩上报 11 | * 12 | * @since V2011 13 | */ 14 | @Getter 15 | @Setter 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x0901 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x0901; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | /** 28 | * 压缩消息长度 29 | */ 30 | private Long compressedDataLength; 31 | 32 | /** 33 | * 压缩消息体 34 | *

35 | * 压缩消息体为需要压缩的消息经过GZIP压缩算法后的消息 36 | */ 37 | private byte[] compressedData; 38 | 39 | @Override 40 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 41 | 42 | } 43 | 44 | @Override 45 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 46 | 47 | } 48 | 49 | public static JT808_Message_Content_0x0901 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 50 | JT808_Message_Content_0x0901 content = new JT808_Message_Content_0x0901(); 51 | content.deserialize(ctx, reader); 52 | return content; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/serialization/IJT809MessageBufferReader.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.serialization; 2 | 3 | import com.google.common.primitives.UnsignedLong; 4 | 5 | /** 6 | * JT809 消息Buffer读取器 7 | */ 8 | public interface IJT809MessageBufferReader { 9 | 10 | /** 11 | * 标记当前读取位置 12 | */ 13 | void markIndex(); 14 | 15 | /** 16 | * 重置至已标记的读取位置 17 | */ 18 | void resetIndex(); 19 | 20 | /** 21 | * 是否还有可读数据 22 | * 23 | * @return 是否还有可读数据 24 | */ 25 | boolean isReadable(); 26 | 27 | /** 28 | * 是否还有可读数据 29 | * 30 | * @param size 可读数据最低长度 31 | * @return 是否还有可读数据 32 | */ 33 | boolean isReadable(int size); 34 | 35 | /** 36 | * 可读数据长度 37 | * 38 | * @return 可读数据长度 39 | */ 40 | int readableBytes(); 41 | 42 | /** 43 | * 读取 BYTE 无符号单字节整型 (字节,8位) 44 | */ 45 | byte readByte(); 46 | 47 | /** 48 | * 读取 UINT16 无符号双字节整型 (字节,16位) 49 | */ 50 | int readUInt16(); 51 | 52 | /** 53 | * 读取 UINT32 无符号四字节整型 (字节,32位) 54 | */ 55 | long readUInt32(); 56 | 57 | /** 58 | * 读取 UINT64 无符号四字节整型 (字节,64位) 59 | */ 60 | UnsignedLong readUInt64(); 61 | 62 | /** 63 | * 读取 n 字节数据 64 | * 65 | * @param length 读取长度 66 | */ 67 | byte[] readBytes(int length); 68 | 69 | /** 70 | * 读取 n 字节为 8421 码 71 | * 72 | * @param length 读取长度 73 | */ 74 | String readBCD(int length); 75 | 76 | /** 77 | * 读取 n 字节为字符串,GBK 编码 78 | * 79 | * @param length 读取长度 80 | */ 81 | String readString(int length); 82 | 83 | /** 84 | * 读取剩余字节为字符串,GBK 编码 85 | */ 86 | String readStringRemaining(); 87 | } 88 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/message/content/JT809_Message_Content_0x1400_Sub/JT809_Message_Content_0x1400_SubMessage.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.message.content.JT809_Message_Content_0x1400_Sub; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.memory.PooledByteArray; 4 | import ai.sangmado.gbprotocol.jt809.protocol.serialization.IJT809MessageBufferWriter; 5 | import ai.sangmado.gbprotocol.jt809.protocol.serialization.IJT809MessageFormatter; 6 | import ai.sangmado.gbprotocol.jt809.protocol.IVersionedSpecificationContext; 7 | import ai.sangmado.gbprotocol.jt809.protocol.serialization.impl.JT809MessageByteBufferWriter; 8 | import ai.sangmado.gbprotocol.jt809.protocol.enums.JT809SubMessageId; 9 | import lombok.NoArgsConstructor; 10 | 11 | import java.nio.ByteBuffer; 12 | 13 | /** 14 | * 主链路报警信息交互消息 UP_WARN_MSG - 子消息 15 | */ 16 | @NoArgsConstructor 17 | public abstract class JT809_Message_Content_0x1400_SubMessage implements IJT809MessageFormatter { 18 | 19 | /** 20 | * 获取子消息ID 21 | * 22 | * @return 子消息ID 23 | */ 24 | public abstract JT809SubMessageId getSubMessageId(); 25 | 26 | /** 27 | * 获取子消息体长度 28 | * 29 | * @param ctx 协议规范上下文 30 | * @return 子消息体长度 31 | */ 32 | public int getContentLength(IVersionedSpecificationContext ctx) { 33 | PooledByteArray pba = ctx.getBufferPool().borrow(); 34 | try { 35 | ByteBuffer buf = ByteBuffer.wrap(pba.array()); 36 | IJT809MessageBufferWriter bufWriter = new JT809MessageByteBufferWriter(ctx, buf); 37 | this.serialize(ctx, bufWriter); 38 | buf.flip(); 39 | return buf.remaining(); 40 | } finally { 41 | ctx.getBufferPool().recycle(pba); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /jt809/src/main/java/ai/sangmado/gbprotocol/jt809/protocol/serialization/IJT809MessageBufferWriter.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt809.protocol.serialization; 2 | 3 | import com.google.common.primitives.UnsignedLong; 4 | 5 | import java.nio.ByteBuffer; 6 | 7 | /** 8 | * JT809 消息Buffer写入器 9 | */ 10 | public interface IJT809MessageBufferWriter { 11 | 12 | /** 13 | * 写入 BYTE 无符号单字节整型 (字节,8位) 14 | * 15 | * @param x 写入数据 16 | */ 17 | void writeByte(byte x); 18 | 19 | /** 20 | * 写入 BYTE 无符号单字节整型 (字节,8位) 21 | * 22 | * @param x 写入数据 23 | */ 24 | void writeByte(int x); 25 | 26 | /** 27 | * 写入 UINT16 无符号双字节整型 (字节,16位) 28 | * 29 | * @param x 写入数据 30 | */ 31 | void writeUInt16(int x); 32 | 33 | /** 34 | * 写入 UINT32 无符号四字节整型 (字节,32位) 35 | * 36 | * @param x 写入数据 37 | */ 38 | void writeUInt32(long x); 39 | 40 | /** 41 | * 写入 UINT64 无符号四字节整型 (字节,64位) 42 | * 43 | * @param x 写入数据 44 | */ 45 | void writeUInt64(UnsignedLong x); 46 | 47 | /** 48 | * 写入 n 字节数据 49 | * 50 | * @param x 写入数据 51 | */ 52 | void writeBytes(byte[] x); 53 | 54 | /** 55 | * 写入 n 字节数据 56 | * 57 | * @param x 写入数据 58 | * @param offset 开始位置 59 | * @param length 写入长度 60 | */ 61 | void writeBytes(byte[] x, int offset, int length); 62 | 63 | /** 64 | * 写入 n 字节数据 65 | * 66 | * @param x 写入数据 67 | */ 68 | void writeBytes(ByteBuffer x); 69 | 70 | /** 71 | * 写入 8421 码,n 字节 72 | * 73 | * @param x 写入数据 74 | */ 75 | void writeBCD(String x); 76 | 77 | /** 78 | * 写入 GBK 编码字符串数据,若无数据,置空 79 | * 80 | * @param x 写入数据 81 | */ 82 | void writeString(String x); 83 | } 84 | -------------------------------------------------------------------------------- /jt808db37lubiao/src/main/java/ai/sangmado/gbprotocol/jt808db37lubiao/protocol/message/content/JT808DB37LuBiao_Message_Content_0x0E10.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db37lubiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808MessageContent; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import ai.sangmado.gbprotocol.jt808db37lubiao.protocol.enums.JT808DB37LuBiaoMessageId; 8 | import lombok.*; 9 | 10 | /** 11 | * 驾驶员比对结果上报 12 | */ 13 | @Getter 14 | @Setter 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @Builder 18 | public class JT808DB37LuBiao_Message_Content_0x0E10 extends JT808MessageContent { 19 | public static final JT808DB37LuBiaoMessageId MESSAGE_ID = JT808DB37LuBiaoMessageId.JT808DB37LuBiao_Message_0x0E10; 20 | 21 | @Override 22 | public JT808DB37LuBiaoMessageId getMessageId() { 23 | return MESSAGE_ID; 24 | } 25 | 26 | /** 27 | * xxx 28 | */ 29 | private String xxx; 30 | 31 | @Override 32 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 33 | 34 | } 35 | 36 | @Override 37 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | 39 | } 40 | 41 | public static JT808DB37LuBiao_Message_Content_0x0E10 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 42 | JT808DB37LuBiao_Message_Content_0x0E10 content = new JT808DB37LuBiao_Message_Content_0x0E10(); 43 | content.deserialize(ctx, reader); 44 | return content; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /jt808db37lubiao/src/main/java/ai/sangmado/gbprotocol/jt808db37lubiao/protocol/message/content/JT808DB37LuBiao_Message_Content_0x0E11.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db37lubiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808MessageContent; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import ai.sangmado.gbprotocol.jt808db37lubiao.protocol.enums.JT808DB37LuBiaoMessageId; 8 | import lombok.*; 9 | 10 | /** 11 | * 驾驶员图片下载应答 12 | */ 13 | @Getter 14 | @Setter 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @Builder 18 | public class JT808DB37LuBiao_Message_Content_0x0E11 extends JT808MessageContent { 19 | public static final JT808DB37LuBiaoMessageId MESSAGE_ID = JT808DB37LuBiaoMessageId.JT808DB37LuBiao_Message_0x0E11; 20 | 21 | @Override 22 | public JT808DB37LuBiaoMessageId getMessageId() { 23 | return MESSAGE_ID; 24 | } 25 | 26 | /** 27 | * xxx 28 | */ 29 | private String xxx; 30 | 31 | @Override 32 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 33 | 34 | } 35 | 36 | @Override 37 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | 39 | } 40 | 41 | public static JT808DB37LuBiao_Message_Content_0x0E11 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 42 | JT808DB37LuBiao_Message_Content_0x0E11 content = new JT808DB37LuBiao_Message_Content_0x0E11(); 43 | content.deserialize(ctx, reader); 44 | return content; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /jt808db37lubiao/src/main/java/ai/sangmado/gbprotocol/jt808db37lubiao/protocol/message/content/JT808DB37LuBiao_Message_Content_0x0E12.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db37lubiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808MessageContent; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import ai.sangmado.gbprotocol.jt808db37lubiao.protocol.enums.JT808DB37LuBiaoMessageId; 8 | import lombok.*; 9 | 10 | /** 11 | * 驾驶员信息应答 12 | */ 13 | @Getter 14 | @Setter 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @Builder 18 | public class JT808DB37LuBiao_Message_Content_0x0E12 extends JT808MessageContent { 19 | public static final JT808DB37LuBiaoMessageId MESSAGE_ID = JT808DB37LuBiaoMessageId.JT808DB37LuBiao_Message_0x0E12; 20 | 21 | @Override 22 | public JT808DB37LuBiaoMessageId getMessageId() { 23 | return MESSAGE_ID; 24 | } 25 | 26 | /** 27 | * xxx 28 | */ 29 | private String xxx; 30 | 31 | @Override 32 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 33 | 34 | } 35 | 36 | @Override 37 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | 39 | } 40 | 41 | public static JT808DB37LuBiao_Message_Content_0x0E12 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 42 | JT808DB37LuBiao_Message_Content_0x0E12 content = new JT808DB37LuBiao_Message_Content_0x0E12(); 43 | content.deserialize(ctx, reader); 44 | return content; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /jt808db37lubiao/src/main/java/ai/sangmado/gbprotocol/jt808db37lubiao/protocol/message/content/JT808DB37LuBiao_Message_Content_0x8E11.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db37lubiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808MessageContent; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import ai.sangmado.gbprotocol.jt808db37lubiao.protocol.enums.JT808DB37LuBiaoMessageId; 8 | import lombok.*; 9 | 10 | /** 11 | * 驾驶员图片信息设置 12 | */ 13 | @Getter 14 | @Setter 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @Builder 18 | public class JT808DB37LuBiao_Message_Content_0x8E11 extends JT808MessageContent { 19 | public static final JT808DB37LuBiaoMessageId MESSAGE_ID = JT808DB37LuBiaoMessageId.JT808DB37LuBiao_Message_0x8E11; 20 | 21 | @Override 22 | public JT808DB37LuBiaoMessageId getMessageId() { 23 | return MESSAGE_ID; 24 | } 25 | 26 | /** 27 | * xxx 28 | */ 29 | private String xxx; 30 | 31 | @Override 32 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 33 | 34 | } 35 | 36 | @Override 37 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | 39 | } 40 | 41 | public static JT808DB37LuBiao_Message_Content_0x8E11 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 42 | JT808DB37LuBiao_Message_Content_0x8E11 content = new JT808DB37LuBiao_Message_Content_0x8E11(); 43 | content.deserialize(ctx, reader); 44 | return content; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /jt808db37lubiao/src/main/java/ai/sangmado/gbprotocol/jt808db37lubiao/protocol/message/content/JT808DB37LuBiao_Message_Content_0x8E12.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db37lubiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808MessageContent; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import ai.sangmado.gbprotocol.jt808db37lubiao.protocol.enums.JT808DB37LuBiaoMessageId; 8 | import lombok.*; 9 | 10 | /** 11 | * 驾驶员信息查询 12 | */ 13 | @Getter 14 | @Setter 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @Builder 18 | public class JT808DB37LuBiao_Message_Content_0x8E12 extends JT808MessageContent { 19 | public static final JT808DB37LuBiaoMessageId MESSAGE_ID = JT808DB37LuBiaoMessageId.JT808DB37LuBiao_Message_0x8E12; 20 | 21 | @Override 22 | public JT808DB37LuBiaoMessageId getMessageId() { 23 | return MESSAGE_ID; 24 | } 25 | 26 | /** 27 | * xxx 28 | */ 29 | private String xxx; 30 | 31 | @Override 32 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 33 | 34 | } 35 | 36 | @Override 37 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | 39 | } 40 | 41 | public static JT808DB37LuBiao_Message_Content_0x8E12 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 42 | JT808DB37LuBiao_Message_Content_0x8E12 content = new JT808DB37LuBiao_Message_Content_0x8E12(); 43 | content.deserialize(ctx, reader); 44 | return content; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /jt808db37lubiao/src/main/java/ai/sangmado/gbprotocol/jt808db37lubiao/protocol/message/content/JT808DB37LuBiao_Message_Content_0x8E10.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db37lubiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808MessageContent; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import ai.sangmado.gbprotocol.jt808db37lubiao.protocol.enums.JT808DB37LuBiaoMessageId; 8 | import lombok.*; 9 | 10 | /** 11 | * 驾驶员比对结果上报应答 12 | */ 13 | @Getter 14 | @Setter 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @Builder 18 | public class JT808DB37LuBiao_Message_Content_0x8E10 extends JT808MessageContent { 19 | public static final JT808DB37LuBiaoMessageId MESSAGE_ID = JT808DB37LuBiaoMessageId.JT808DB37LuBiao_Message_0x8E10; 20 | 21 | @Override 22 | public JT808DB37LuBiaoMessageId getMessageId() { 23 | return MESSAGE_ID; 24 | } 25 | 26 | /** 27 | * xxx 28 | */ 29 | private String xxx; 30 | 31 | @Override 32 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 33 | 34 | } 35 | 36 | @Override 37 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 38 | 39 | } 40 | 41 | public static JT808DB37LuBiao_Message_Content_0x8E10 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 42 | JT808DB37LuBiao_Message_Content_0x8E10 content = new JT808DB37LuBiao_Message_Content_0x8E10(); 43 | content.deserialize(ctx, reader); 44 | return content; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /gb19056/src/main/java/ai/sangmado/gbprotocol/gb19056/protocol/message/content/GB19056MessagePacket.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb19056.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.gbcommon.enums.IMessageId; 4 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageFormatter; 8 | import lombok.Getter; 9 | import lombok.NoArgsConstructor; 10 | import lombok.Setter; 11 | import lombok.extern.slf4j.Slf4j; 12 | 13 | /** 14 | * GB19056 消息包 15 | */ 16 | @Slf4j 17 | @NoArgsConstructor 18 | public class GB19056MessagePacket implements IJT808MessageFormatter { 19 | 20 | /** 21 | * 头标识 22 | */ 23 | @Getter 24 | @Setter 25 | private int beginMarker = 0x557A; 26 | /** 27 | * 命令字 28 | */ 29 | @Getter 30 | @Setter 31 | private T messageId; 32 | /** 33 | * 保留字段 34 | */ 35 | @Getter 36 | @Setter 37 | private int reservedField = 0x00; 38 | /** 39 | * 数据块长度 40 | */ 41 | @Getter 42 | @Setter 43 | private int blockLength; 44 | /** 45 | * 数据块 46 | */ 47 | @Getter 48 | @Setter 49 | private GB19056MessageBlock block; 50 | /** 51 | * 校验码 52 | */ 53 | @Getter 54 | @Setter 55 | private int checksum; 56 | 57 | @Override 58 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 59 | 60 | } 61 | 62 | @Override 63 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /jt808db22jibiao/src/main/java/ai/sangmado/gbprotocol/jt808db22jibiao/protocol/message/content/JT808DB22JiBiao_Message_Content_0x8E12.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808db22jibiao.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808MessageContent; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import ai.sangmado.gbprotocol.jt808db22jibiao.protocol.enums.JT808DB22JiBiaoMessageId; 8 | import lombok.AllArgsConstructor; 9 | import lombok.Builder; 10 | import lombok.Getter; 11 | import lombok.Setter; 12 | 13 | /** 14 | * 驾驶员身份库信息查询 15 | */ 16 | @Getter 17 | @Setter 18 | @AllArgsConstructor 19 | @Builder 20 | public class JT808DB22JiBiao_Message_Content_0x8E12 extends JT808MessageContent { 21 | public static final JT808DB22JiBiaoMessageId MESSAGE_ID = JT808DB22JiBiaoMessageId.JT808DB22JiBiao_Message_0x8E12; 22 | 23 | @Override 24 | public JT808DB22JiBiaoMessageId getMessageId() { 25 | return MESSAGE_ID; 26 | } 27 | 28 | @Override 29 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 30 | // 消息体为空 31 | } 32 | 33 | @Override 34 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 35 | // 消息体为空 36 | } 37 | 38 | public static JT808DB22JiBiao_Message_Content_0x8E12 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 39 | JT808DB22JiBiao_Message_Content_0x8E12 content = new JT808DB22JiBiao_Message_Content_0x8E12(); 40 | content.deserialize(ctx, reader); 41 | return content; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /gbcommon/src/main/java/ai/sangmado/gbprotocol/gbcommon/utils/CRC16.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gbcommon.utils; 2 | 3 | import java.nio.ByteBuffer; 4 | 5 | /** 6 | * CRC16校验类 7 | */ 8 | public class CRC16 { 9 | 10 | public static int CRC16_CCITT(byte[] buffer) { 11 | return CRC16_CCITT(buffer, 0, buffer.length); 12 | } 13 | 14 | public static int CRC16_CCITT(byte[] buffer, int offset, int length) { 15 | int crc = 0xFFFF; // initial value 16 | int polynomial = 0x1021; // 0001 0000 0010 0001 (0, 5, 12) 17 | 18 | for (int j = 0; j < length; ++j) { 19 | byte b = buffer[offset + j]; 20 | for (int i = 0; i < 8; i++) { 21 | boolean bit = ((b >> (7 - i) & 1) == 1); 22 | boolean c15 = ((crc >> 15 & 1) == 1); 23 | crc <<= 1; 24 | if (c15 ^ bit) crc ^= polynomial; 25 | } 26 | } 27 | 28 | crc &= 0xFFFF; 29 | return crc; 30 | } 31 | 32 | public static int CRC16_CCITT(ByteBuffer buf) { 33 | return CRC16_CCITT(buf, 0, buf.limit()); 34 | } 35 | 36 | public static int CRC16_CCITT(ByteBuffer buf, int offset, int length) { 37 | int crc = 0xFFFF; // initial value 38 | int polynomial = 0x1021; // 0001 0000 0010 0001 (0, 5, 12) 39 | 40 | buf.position(offset); 41 | while (buf.hasRemaining() && (buf.position() < offset + length)) { 42 | byte b = buf.get(); 43 | for (int i = 0; i < 8; i++) { 44 | boolean bit = ((b >> (7 - i) & 1) == 1); 45 | boolean c15 = ((crc >> 15 & 1) == 1); 46 | crc <<= 1; 47 | if (c15 ^ bit) crc ^= polynomial; 48 | } 49 | } 50 | 51 | crc &= 0xFFFF; 52 | return crc; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /gb32960/src/main/java/ai/sangmado/gbprotocol/gb32960/protocol/message/content/device/GB32960_Device_Message_Content_0x04.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.gb32960.protocol.message.content.device; 2 | 3 | import ai.sangmado.gbprotocol.gb32960.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.gb32960.protocol.enums.GB32960DeviceCommandId; 5 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageBufferReader; 6 | import ai.sangmado.gbprotocol.gb32960.protocol.serialization.IGB32960MessageBufferWriter; 7 | import lombok.*; 8 | 9 | import java.time.LocalDateTime; 10 | 11 | /** 12 | * 车辆登出 13 | */ 14 | @Getter 15 | @Setter 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | @Builder 19 | public class GB32960_Device_Message_Content_0x04 extends GB32960DeviceMessageContent { 20 | public static final GB32960DeviceCommandId COMMAND_ID = GB32960DeviceCommandId.GB32960_Device_Command_0x04; 21 | 22 | @Override 23 | public GB32960DeviceCommandId getCommandId() { 24 | return COMMAND_ID; 25 | } 26 | 27 | /** 28 | * 登出时间 29 | */ 30 | private LocalDateTime dataCollectionTime; 31 | 32 | /** 33 | * 登出流水号 34 | */ 35 | private Integer serialNumber; 36 | 37 | @Override 38 | public void serialize(IVersionedSpecificationContext ctx, IGB32960MessageBufferWriter writer) { 39 | 40 | } 41 | 42 | @Override 43 | public void deserialize(IVersionedSpecificationContext ctx, IGB32960MessageBufferReader reader) { 44 | 45 | } 46 | 47 | public static GB32960_Device_Message_Content_0x04 decode(IVersionedSpecificationContext ctx, IGB32960MessageBufferReader reader) { 48 | GB32960_Device_Message_Content_0x04 content = new GB32960_Device_Message_Content_0x04(); 49 | content.deserialize(ctx, reader); 50 | return content; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_0x0108.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.enums.JT808MessageId; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 6 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 7 | import lombok.*; 8 | 9 | /** 10 | * 终端升级结果通知 11 | * 12 | * @since V2013 终端在升级完成并重新连接后使用该命令通知监控中心。 13 | */ 14 | @Getter 15 | @Setter 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | @Builder 19 | public class JT808_Message_Content_0x0108 extends JT808MessageContent { 20 | public static final JT808MessageId MESSAGE_ID = JT808MessageId.JT808_Message_0x0108; 21 | 22 | @Override 23 | public JT808MessageId getMessageId() { 24 | return MESSAGE_ID; 25 | } 26 | 27 | /** 28 | * 升级类型 29 | *

30 | * 0:终端 31 | * 12:道路运输证IC卡读卡器 32 | * 52:北斗卫星定位模块 33 | */ 34 | private Integer upgradeTarget; 35 | /** 36 | * 升级结果 37 | *

38 | * 0:成功,1:失败,2:取消 39 | */ 40 | private Integer upgradeResult; 41 | 42 | @Override 43 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 44 | 45 | } 46 | 47 | @Override 48 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 49 | 50 | } 51 | 52 | public static JT808_Message_Content_0x0108 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 53 | JT808_Message_Content_0x0108 content = new JT808_Message_Content_0x0108(); 54 | content.deserialize(ctx, reader); 55 | return content; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_Passthrough_Message/JT808_Message_Content_0x0900_Message_0x0B.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808_Message_Content_Passthrough_Message; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | 10 | /** 11 | * 透传消息 - 道路运输证IC卡信息 12 | */ 13 | @NoArgsConstructor 14 | public class JT808_Message_Content_0x0900_Message_0x0B extends JT808_Message_Content_0x0900_Base { 15 | public static final JT808_Message_Content_Passthrough_MessageType MESSAGE_TYPE = 16 | JT808_Message_Content_Passthrough_MessageType.JT808_Passthrough_Message_0x0B; 17 | 18 | @Override 19 | public JT808_Message_Content_Passthrough_MessageType getPassthroughMessageType() { 20 | return MESSAGE_TYPE; 21 | } 22 | 23 | /** 24 | * xxx 25 | */ 26 | @Getter 27 | @Setter 28 | private Integer xxx; 29 | 30 | @Override 31 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 32 | 33 | } 34 | 35 | @Override 36 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 37 | 38 | } 39 | 40 | public static JT808_Message_Content_0x0900_Message_0x0B decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 41 | JT808_Message_Content_0x0900_Message_0x0B content = new JT808_Message_Content_0x0900_Message_0x0B(); 42 | content.deserialize(ctx, reader); 43 | return content; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /jt808/src/main/java/ai/sangmado/gbprotocol/jt808/protocol/message/content/JT808_Message_Content_Passthrough_Message/JT808_Message_Content_0x0900_Message_0x00.java: -------------------------------------------------------------------------------- 1 | package ai.sangmado.gbprotocol.jt808.protocol.message.content.JT808_Message_Content_Passthrough_Message; 2 | 3 | import ai.sangmado.gbprotocol.jt808.protocol.IVersionedSpecificationContext; 4 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferReader; 5 | import ai.sangmado.gbprotocol.jt808.protocol.serialization.IJT808MessageBufferWriter; 6 | import lombok.Getter; 7 | import lombok.NoArgsConstructor; 8 | import lombok.Setter; 9 | 10 | /** 11 | * 透传消息 - GNSS模块详细定位数据 12 | */ 13 | @NoArgsConstructor 14 | public class JT808_Message_Content_0x0900_Message_0x00 extends JT808_Message_Content_0x0900_Base { 15 | public static final JT808_Message_Content_Passthrough_MessageType MESSAGE_TYPE = 16 | JT808_Message_Content_Passthrough_MessageType.JT808_Passthrough_Message_0x00; 17 | 18 | @Override 19 | public JT808_Message_Content_Passthrough_MessageType getPassthroughMessageType() { 20 | return MESSAGE_TYPE; 21 | } 22 | 23 | /** 24 | * xxx 25 | */ 26 | @Getter 27 | @Setter 28 | private Integer xxx; 29 | 30 | @Override 31 | public void serialize(IVersionedSpecificationContext ctx, IJT808MessageBufferWriter writer) { 32 | 33 | } 34 | 35 | @Override 36 | public void deserialize(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 37 | 38 | } 39 | 40 | public static JT808_Message_Content_0x0900_Message_0x00 decode(IVersionedSpecificationContext ctx, IJT808MessageBufferReader reader) { 41 | JT808_Message_Content_0x0900_Message_0x00 content = new JT808_Message_Content_0x0900_Message_0x00(); 42 | content.deserialize(ctx, reader); 43 | return content; 44 | } 45 | } 46 | --------------------------------------------------------------------------------