北斗短报文通信服务平台
This commit is contained in:
14
app/middleware/shunt/socketResult.js
Normal file
14
app/middleware/shunt/socketResult.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// 对数据包解析结果做类型判断,并根据不同类型返回不同结果
|
||||
module.exports = (data) => {
|
||||
for (let item in data) {
|
||||
if (data[item].typeNumber) {
|
||||
if (data[item].typeNumber.data == 4) {
|
||||
return { type: 4, data: data[item] };
|
||||
} else if (data[item].typeNumber.data == 5) {
|
||||
return { type: 5, data: data[item] };
|
||||
} else if (data[item].typeNumber.data == 99) {
|
||||
return { type: 99, data: data[item].authStatus };
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user