diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0900.java b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0900.java new file mode 100644 index 000000000..c5b6c65f0 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0900.java @@ -0,0 +1,66 @@ +package com.genersoft.iot.vmp.jt1078.proc.request; + +import com.genersoft.iot.vmp.jt1078.annotation.MsgId; +import com.genersoft.iot.vmp.jt1078.proc.Header; +import com.genersoft.iot.vmp.jt1078.proc.response.J8001; +import com.genersoft.iot.vmp.jt1078.proc.response.Rs; +import com.genersoft.iot.vmp.jt1078.service.Ijt1078Service; +import com.genersoft.iot.vmp.jt1078.session.Session; +import com.genersoft.iot.vmp.jt1078.session.SessionManager; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import org.springframework.context.ApplicationEvent; + +/** + * 数据上行透传 + */ +@MsgId(id = "0900") +public class J0900 extends Re { + + /** + * 透传消息类型, 0x00: GNSS 模块详细定位数据, 0X0B: 道路运输证 IC卡信息, 0X41: 串口1 透传, 0X42: 串口2 透传, 0XF0 ~ 0XFF: 用户自定义透传 + */ + private Integer type; + + /** + * 透传消息内容 + */ + private byte[] content; + + @Override + protected Rs decode0(ByteBuf buf, Header header, Session session) { + type = (int)buf.readUnsignedByte(); + byte[] content = new byte[buf.readableBytes()]; + buf.readBytes(content); + return null; + } + + @Override + protected Rs handler(Header header, Session session, Ijt1078Service service) { + J8001 j8001 = new J8001(); + j8001.setRespNo(header.getSn()); + j8001.setRespId(header.getMsgId()); + return null; + } + + @Override + public ApplicationEvent getEvent() { + return null; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public byte[] getContent() { + return content; + } + + public void setContent(byte[] content) { + this.content = content; + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0901.java b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0901.java new file mode 100644 index 000000000..c310dba4d --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0901.java @@ -0,0 +1,64 @@ +package com.genersoft.iot.vmp.jt1078.proc.request; + +import com.genersoft.iot.vmp.jt1078.annotation.MsgId; +import com.genersoft.iot.vmp.jt1078.proc.Header; +import com.genersoft.iot.vmp.jt1078.proc.response.J8001; +import com.genersoft.iot.vmp.jt1078.proc.response.Rs; +import com.genersoft.iot.vmp.jt1078.service.Ijt1078Service; +import com.genersoft.iot.vmp.jt1078.session.Session; +import io.netty.buffer.ByteBuf; +import org.springframework.context.ApplicationEvent; + +/** + * 数据压缩上报 + */ +@MsgId(id = "0901") +public class J0901 extends Re { + + /** + * 平台 RSA公钥{e ,n}中的 e + */ + private Long e; + + /** + * RSA公钥{e ,n}中的 n + */ + private byte[] n; + + @Override + protected Rs decode0(ByteBuf buf, Header header, Session session) { + e = buf.readUnsignedInt(); + byte[] content = new byte[buf.readableBytes()]; + buf.readBytes(content); + return null; + } + + @Override + protected Rs handler(Header header, Session session, Ijt1078Service service) { + J8001 j8001 = new J8001(); + j8001.setRespNo(header.getSn()); + j8001.setRespId(header.getMsgId()); + return null; + } + + @Override + public ApplicationEvent getEvent() { + return null; + } + + public Long getE() { + return e; + } + + public void setE(Long e) { + this.e = e; + } + + public byte[] getN() { + return n; + } + + public void setN(byte[] n) { + this.n = n; + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0A00.java b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0A00.java new file mode 100644 index 000000000..1b48687db --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0A00.java @@ -0,0 +1,64 @@ +package com.genersoft.iot.vmp.jt1078.proc.request; + +import com.genersoft.iot.vmp.jt1078.annotation.MsgId; +import com.genersoft.iot.vmp.jt1078.proc.Header; +import com.genersoft.iot.vmp.jt1078.proc.response.J8001; +import com.genersoft.iot.vmp.jt1078.proc.response.Rs; +import com.genersoft.iot.vmp.jt1078.service.Ijt1078Service; +import com.genersoft.iot.vmp.jt1078.session.Session; +import io.netty.buffer.ByteBuf; +import org.springframework.context.ApplicationEvent; + +/** + * 终端 RSA公钥 + */ +@MsgId(id = "0900") +public class J0A00 extends Re { + + /** + * 透传消息类型, 0x00: GNSS 模块详细定位数据, 0X0B: 道路运输证 IC卡信息, 0X41: 串口1 透传, 0X42: 串口2 透传, 0XF0 ~ 0XFF: 用户自定义透传 + */ + private Integer type; + + /** + * 透传消息内容 + */ + private byte[] content; + + @Override + protected Rs decode0(ByteBuf buf, Header header, Session session) { + type = (int)buf.readUnsignedByte(); + byte[] content = new byte[buf.readableBytes()]; + buf.readBytes(content); + return null; + } + + @Override + protected Rs handler(Header header, Session session, Ijt1078Service service) { + J8001 j8001 = new J8001(); + j8001.setRespNo(header.getSn()); + j8001.setRespId(header.getMsgId()); + return null; + } + + @Override + public ApplicationEvent getEvent() { + return null; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public byte[] getContent() { + return content; + } + + public void setContent(byte[] content) { + this.content = content; + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/response/J8900.java b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/response/J8900.java new file mode 100644 index 000000000..6710f2882 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/response/J8900.java @@ -0,0 +1,46 @@ +package com.genersoft.iot.vmp.jt1078.proc.response; + +import com.genersoft.iot.vmp.jt1078.annotation.MsgId; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + +/** + * 数据下行透传 + */ +@MsgId(id = "8900") +public class J8900 extends Rs { + + /** + * 透传消息类型, 0x00: GNSS 模块详细定位数据, 0X0B: 道路运输证 IC卡信息, 0X41: 串口1 透传, 0X42: 串口2 透传, 0XF0 ~ 0XFF: 用户自定义透传 + */ + private Integer type; + + /** + * 透传消息内容 + */ + private byte[] content; + + @Override + public ByteBuf encode() { + ByteBuf byteBuf = Unpooled.buffer(); + byteBuf.writeByte(type); + byteBuf.writeBytes(content); + return byteBuf; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public byte[] getContent() { + return content; + } + + public void setContent(byte[] content) { + this.content = content; + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/response/J8A00.java b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/response/J8A00.java new file mode 100644 index 000000000..1fac26e3f --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/response/J8A00.java @@ -0,0 +1,46 @@ +package com.genersoft.iot.vmp.jt1078.proc.response; + +import com.genersoft.iot.vmp.jt1078.annotation.MsgId; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + +/** + * 平台 RSA公钥 + */ +@MsgId(id = "8A00") +public class J8A00 extends Rs { + + /** + * 平台 RSA公钥{e ,n}中的 e + */ + private Long e; + + /** + * RSA公钥{e ,n}中的 n + */ + private byte[] n; + + @Override + public ByteBuf encode() { + ByteBuf byteBuf = Unpooled.buffer(); + byteBuf.writeInt((int) (e & 0xffffffffL)); + byteBuf.writeBytes(n); + return byteBuf; + } + + public Long getE() { + return e; + } + + public void setE(Long e) { + this.e = e; + } + + public byte[] getN() { + return n; + } + + public void setN(byte[] n) { + this.n = n; + } +}