SettingBaseBeaconRequest.java
5.12 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package com.sunvote.cmd.basestation;
import com.sunvote.cmd.BaseCmd;
import com.sunvote.cmd.ICmd;
import java.io.ByteArrayOutputStream;
/**
* Created by Elvis on 2017/8/30.
* Email:Eluis@psunsky.com
* 版权所有:长沙中天电子设计开发有限公司
* Description:平板模块键盘投票功能模块
* 电脑发给基站:
* 字节 标识符 描述
* 1 BASECMD 0x60 基站类指令
* 2 BASEID 指定的基站编号
* 3 CMDTYPE 基站命令类型
* 1 读取信标,后继的参数无意义
* 2 设置信标
* 4,5 AUTHCODE 授权号,2字节,高位在前,0-0xFFFF
* =0时候不使用授权模式,表决器可以参与表决
* >0时候,表决器保存的授权号相同才能参与表决
* 6 LOGIN 登录申请模式(后台签到模式)
* 具体含义同表决器协议
* 7 REPORT 表决器报告状态模式
* 具体含义同表决器协议
* 8 OFFTIME 自动关机时间
* 0xFF不关机 0使用硬件缺省 其他:按分钟为单位关机
* 9 ATTRIB 表决器特性
* 具体含义同表决器协议
* 10-11 NOWT 时标值(用于计时)
* 12 MOREINFO 从此字节起,设置参数无效,基站发出的信标内容NOWT后由基站自己组织,不由基础信标设置指令设置。
* 00 后面参数无意义(老版本)
* 03 设置的议案信息(V5.0)
* 13-14 CONFID 2字节,会议资料UID编号,1-65535,高位字节在前
* (对应系统使用后创见的会议文件的唯一编号)
* 15 INFOID 议题编号或索引(1-255),对应到具体用户可以浏览的议案文件内容
* 16-29 空,不可设置
*/
public class SettingBaseBeaconRequest extends BaseCmd {
/**
* @return
*/
public static final byte CMD = 0x60;
public static final byte CMD_TYPE_READ = 0x01;
public static final byte CMD_TYPE_WRITE = 0x02;
/**
* BASECMD 0xE0 基站类指令应答
*/
private byte basecmd = CMD;
/**
* 应答的基站的编号
*/
private byte baseid;
/**
* 应答类型 1 当前信标内容
*/
private byte cmdtype;
/**
* AUTHCODE 授权号
*/
private byte[] authcode = new byte[2];
private byte login;
private byte report;
private byte offtime;
private byte attrib;
private byte[] nowt = new byte[2];
private byte moreinfo;
private byte[] confid = new byte[2];
private byte infoid;
private byte[] data = new byte[14];
@Override
public byte[] toBytes() {
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
outputStream.write(getBasecmd());
outputStream.write(getBaseid());
outputStream.write(getCmdtype());
outputStream.write(getAuthcode());
outputStream.write(getLogin());
outputStream.write(getReport());
outputStream.write(getOfftime());
outputStream.write(getAttrib());
outputStream.write(getNowt());
outputStream.write(getMoreinfo());
outputStream.write(getConfid());
outputStream.write(getInfoid());
outputStream.write(getData());
return outputStream.toByteArray();
} catch (Exception ex) {
ex.printStackTrace();
}
return new byte[0];
}
@Override
public ICmd parseCmd(byte[] source, int start) {
return null;
}
public byte getBasecmd() {
return basecmd;
}
public void setBasecmd(byte basecmd) {
this.basecmd = basecmd;
}
public byte getBaseid() {
return baseid;
}
public void setBaseid(byte baseid) {
this.baseid = baseid;
}
public byte getCmdtype() {
return cmdtype;
}
public void setCmdtype(byte cmdtype) {
this.cmdtype = cmdtype;
}
public byte[] getAuthcode() {
return authcode;
}
public void setAuthcode(byte[] authcode) {
this.authcode = authcode;
}
public byte getLogin() {
return login;
}
public void setLogin(byte login) {
this.login = login;
}
public byte getReport() {
return report;
}
public void setReport(byte report) {
this.report = report;
}
public byte getOfftime() {
return offtime;
}
public void setOfftime(byte offtime) {
this.offtime = offtime;
}
public byte getAttrib() {
return attrib;
}
public void setAttrib(byte attrib) {
this.attrib = attrib;
}
public byte[] getNowt() {
return nowt;
}
public void setNowt(byte[] nowt) {
this.nowt = nowt;
}
public byte getMoreinfo() {
return moreinfo;
}
public void setMoreinfo(byte moreinfo) {
this.moreinfo = moreinfo;
}
public byte[] getConfid() {
return confid;
}
public void setConfid(byte[] confid) {
this.confid = confid;
}
public byte getInfoid() {
return infoid;
}
public void setInfoid(byte infoid) {
this.infoid = infoid;
}
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
}