| | |
| | | * 日月年 |
| | | */ |
| | | @Field(type = FieldType.Integer) |
| | | private int date; |
| | | private String date; |
| | | /** |
| | | * 时分秒 |
| | | */ |
| | | @Field(type = FieldType.Integer) |
| | | private int time; |
| | | private String time; |
| | | /** |
| | | * 经度 |
| | | */ |
| | |
| | | */ |
| | | public GnssData decode(ByteBuf byteBuf) { |
| | | this.encrypt = byteBuf.readByte(); |
| | | this.date = byteBuf.readInt(); |
| | | ByteBuf byteBuf1 = byteBuf.readBytes(3); |
| | | StringBuilder t = new StringBuilder(); |
| | | for (int i = 0; i < 3; i++) { |
| | | t.append(byteBuf1.getByte(i)); |
| | | } |
| | | this.time = Integer.valueOf(t.toString()); |
| | | int d = byteBuf.readByte(); |
| | | int m = byteBuf.readByte(); |
| | | int y = byteBuf.readShort(); |
| | | this.date = y + "-" + String.format("%02d", m) + "-" + String.format("%02d", d); |
| | | int h = byteBuf.readByte(); |
| | | int mi = byteBuf.readByte(); |
| | | int s = byteBuf.readByte(); |
| | | this.time = String.format("%02d", h) + ":" + String.format("%02d", mi) + ":" + String.format("%02d", s); |
| | | this.lon = byteBuf.readInt(); |
| | | this.lat = byteBuf.readInt(); |
| | | this.vec1 = byteBuf.readShort(); |