Message82.java
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package com.bsth.socket.protocol;
import org.joda.time.DateTime;
/**
* @author Hill
* 车载终端控制
*/
public class Message82 implements IMessageBody {
/**
* byte[6]
* 数据采集时间
*/
private long timestamp;
/**
* 命令ID
*/
private byte commandId;
/**
* 命令参数
*/
private IMessage82Param message82Param;
@Override
public void read(byte[] bytes) {
// TODO Auto-generated method stub
}
@Override
public byte[] write() {
// TODO Auto-generated method stub
return new byte[0];
}
public long getTimestamp() {
return timestamp;
}
@Override
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public byte getCommandId() {
return commandId;
}
public void setCommandId(byte commandId) {
this.commandId = commandId;
}
public IMessage82Param getMessage82Param() {
return message82Param;
}
public void setMessage82Param(IMessage82Param message82Param) {
this.message82Param = message82Param;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(" 数据采集时间:").append(new DateTime(timestamp).toString("yyyy-MM-dd HH:mm:ss"))
.append(" 命令ID:").append(String.format("%02x", commandId))
.append(" 命令参数:").append(message82Param);
return sb.toString();
}
}