interface.js
3.73 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
/**
* @fileOverview 指令配置文件
* @author qiqi.zhou@yoho.cn
* @module interface
*/
/**
* @var {Object} 通用返回信息
*/
var commonMessage = {
'00': {
code: 1,
message: '操作成功'
},
'ffff': {
code: 0,
message: '没有响应'
},
'fffe': {
code: 3,
message: '读写器正忙'
},
'ff0': {
code: -1,
message: '操作失败'
}
};
/**
* 指令集枚举
* @exports default
*/
export default {
openUhf: {
directive: 'uhf',
input: 'A000000000',
output: {
'a0200': commonMessage['00'],
'a02ff0': commonMessage.ff0,
'a02f00': {
code: 2,
message: 'UHF模块已打开'
}
}
},
closeUhf: {
directive: 'uhf',
input: 'A100000000',
output: {
'a1200': commonMessage['00'],
'a12ff0': commonMessage.ff0
}
},
setPower: {
directive: 'config',
input: 'F3',
output: {
'f3200': commonMessage['00'],
'f32ffff': commonMessage.ffff,
'f32fffe': commonMessage.fffe,
'f32ff0': commonMessage.ff0
}
},
setFilter: {
directive: 'config',
input: 'B7',
output: {
'b7200': commonMessage['00'],
'b72ffff': commonMessage.ffff,
'b72fffe': commonMessage.fffe,
'b72ff0': commonMessage.ff0
}
},
setAntStayTime: {
directive: 'config',
input: 'CA',
output: {
'ca200': commonMessage['00'],
'ca2ffff': commonMessage.ffff,
'ca2fffe': commonMessage.fffe,
'ca2ff0': commonMessage.ff0
}
},
setFrequency: {
directive: 'config',
input: 'BF',
output: {
'bf200': commonMessage['00'],
'bf2ffff': commonMessage.ffff,
'bf2fffe': commonMessage.fffe,
'bf2ff0': commonMessage.ff0
}
},
getConfig: {
directive: 'uhf',
input: 'B300000000',
output: {
'b3200': commonMessage['00'],
'b32ffff': commonMessage.ffff,
'b32fffe': commonMessage.fffe,
'b316': {
code: 1,
message: '返回信息'
}
}
},
getVersion: {
directive: 'uhf',
input: 'B400000000',
output: {
'b4400': commonMessage['00'],
'b44ffff': commonMessage.ffff,
'b44fffe': commonMessage.fffe,
'b44ff0': commonMessage.ff0
}
},
startInventory: {
directive: 'inventory',
input: 'F100000000',
output: {
'f1200': commonMessage['00'],
'f12ffff': commonMessage.ffff,
'f12fffe': commonMessage.fffe,
'f1': {
code: 2,
message: '返回信息'
},
'f1239': {
code: 889,
message: '未知错误'
},
'f12014': {
code: 890,
message: '连接失败'
}
}
},
stopInventory: {
directive: 'inventory',
input: 'F200000000',
output: {
'f2200': commonMessage['00'],
'f22ffff': commonMessage.ffff,
'f22fffe': commonMessage.fffe,
'f22ff0': commonMessage.ff0
}
},
setInventoryTime: {
directive: 'inventory',
input: 'B0',
output: {
'b0200': commonMessage['00'],
'b02ffff': commonMessage.ffff,
'b02fffe': commonMessage.fffe,
'b02ff0': commonMessage.ff0
}
}
};