Commit d266a714053f92a03f08f2c92fa534c61f686696
1 parent
6beff445
feat: 只能手表标准协议全录
Showing
49 changed files
with
1773 additions
and
24 deletions
Bsth-admin/src/main/java/com/ruoyi/system/controller/DeviceCommandController.java
| 1 | 1 | package com.ruoyi.system.controller; |
| 2 | 2 | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 3 | 4 | import com.ruoyi.common.global.Result; |
| 4 | 5 | import com.ruoyi.system.domain.active.Sos; |
| 5 | 6 | import com.ruoyi.system.domain.active.UploadGpsTime; |
| 6 | 7 | import com.ruoyi.system.domain.active.WhiteListPeople; |
| 7 | 8 | import com.ruoyi.system.service.IDeviceService; |
| 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | -import org.springframework.web.bind.annotation.PostMapping; | |
| 10 | -import org.springframework.web.bind.annotation.RequestBody; | |
| 11 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 12 | -import org.springframework.web.bind.annotation.RestController; | |
| 10 | +import org.springframework.web.bind.annotation.*; | |
| 13 | 11 | |
| 14 | 12 | @RestController |
| 15 | 13 | @RequestMapping("/command/send") |
| ... | ... | @@ -32,4 +30,127 @@ public class DeviceCommandController { |
| 32 | 30 | public Result<?> settingGpsUploadTime(@RequestBody UploadGpsTime ugt) { |
| 33 | 31 | return deviceService.settingGpsUploadTime(ugt); |
| 34 | 32 | } |
| 33 | + | |
| 34 | + @PostMapping("/settingNowGps/{imei}") | |
| 35 | + public Result<?> settingNowGps(@PathVariable("imei") String imei) { | |
| 36 | + return deviceService.settingNowGps(imei); | |
| 37 | + } | |
| 38 | + | |
| 39 | + @PostMapping("/sendRecoveryReset/{imei}") | |
| 40 | + public Result<?> sendRecoveryReset(@PathVariable("imei") String imei) { | |
| 41 | + return deviceService.sendRecoveryReset(imei); | |
| 42 | + } | |
| 43 | + | |
| 44 | + @PostMapping("/sendRecoveryPower/{imei}") | |
| 45 | + public Result<?> sendRecoveryPower(@PathVariable("imei") String imei) { | |
| 46 | + return deviceService.sendRecoveryPower(imei); | |
| 47 | + } | |
| 48 | + | |
| 49 | + @PostMapping("/settingServerInfo") | |
| 50 | + public Result<?> settingServerInfo(@RequestBody String bean) { | |
| 51 | + JSONObject params = JSONObject.parseObject(bean); | |
| 52 | + return deviceService.settingServerInfo(params); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @PostMapping("/settingLanguageTime") | |
| 56 | + public Result<?> settingLanguageTime(@RequestBody String bean) { | |
| 57 | + JSONObject params = JSONObject.parseObject(bean); | |
| 58 | + return deviceService.settingLanguageTime(params); | |
| 59 | + } | |
| 60 | + | |
| 61 | + @PostMapping("/sendShutdown") | |
| 62 | + public Result<?> sendShutdown(@RequestBody String bean) { | |
| 63 | + JSONObject params = JSONObject.parseObject(bean); | |
| 64 | + return deviceService.sendShutdown(params); | |
| 65 | + } | |
| 66 | + | |
| 67 | + @PostMapping("/sendCallTel") | |
| 68 | + public Result<?> sendCallTel(@RequestBody String bean) { | |
| 69 | + JSONObject params = JSONObject.parseObject(bean); | |
| 70 | + return deviceService.sendCallTel(params); | |
| 71 | + } | |
| 72 | + | |
| 73 | + @PostMapping("/settingWorkMode") | |
| 74 | + public Result<?> settingWorkMode(@RequestBody String bean) { | |
| 75 | + JSONObject params = JSONObject.parseObject(bean); | |
| 76 | + return deviceService.settingWorkMode(params); | |
| 77 | + } | |
| 78 | + | |
| 79 | + @PostMapping("/settingShortcutCommand") | |
| 80 | + public Result<?> settingShortcutCommand(@RequestBody String bean) { | |
| 81 | + JSONObject params = JSONObject.parseObject(bean); | |
| 82 | + return deviceService.settingShortcutCommand(params); | |
| 83 | + } | |
| 84 | + | |
| 85 | + @PostMapping("/photograph") | |
| 86 | + public Result<?> photograph(@RequestBody String bean) { | |
| 87 | + JSONObject params = JSONObject.parseObject(bean); | |
| 88 | + return deviceService.photograph(params); | |
| 89 | + } | |
| 90 | + | |
| 91 | + @PostMapping("/heartCheck") | |
| 92 | + public Result<?> heartCheck(@RequestBody String bean) { | |
| 93 | + JSONObject params = JSONObject.parseObject(bean); | |
| 94 | + return deviceService.heartCheck(params); | |
| 95 | + } | |
| 96 | + | |
| 97 | + @PostMapping("/settingContactBook") | |
| 98 | + public Result<?> settingContactBook(@RequestBody String bean) { | |
| 99 | + JSONObject params = JSONObject.parseObject(bean); | |
| 100 | + return deviceService.settingContactBook(params); | |
| 101 | + } | |
| 102 | + | |
| 103 | + @PostMapping("/sendDelContactBookSingle") | |
| 104 | + public Result<?> sendDelContactBookSingle(@RequestBody String bean) { | |
| 105 | + JSONObject params = JSONObject.parseObject(bean); | |
| 106 | + return deviceService.sendDelContactBookSingle(params); | |
| 107 | + } | |
| 108 | + | |
| 109 | + @PostMapping("/settingWhiteButton") | |
| 110 | + public Result<?> settingWhiteButton(@RequestBody String bean) { | |
| 111 | + JSONObject params = JSONObject.parseObject(bean); | |
| 112 | + return deviceService.settingWhiteButton(params); | |
| 113 | + } | |
| 114 | + | |
| 115 | + @PostMapping("/sendFindClient") | |
| 116 | + public Result<?> sendFindClient(@RequestBody String bean) { | |
| 117 | + JSONObject params = JSONObject.parseObject(bean); | |
| 118 | + return deviceService.sendFindClient(params); | |
| 119 | + } | |
| 120 | + | |
| 121 | + @PostMapping("/sendMotionCheck") | |
| 122 | + public Result<?> sendMotionCheck(@RequestBody String bean) { | |
| 123 | + JSONObject params = JSONObject.parseObject(bean); | |
| 124 | + return deviceService.sendMotionCheck(params); | |
| 125 | + } | |
| 126 | + | |
| 127 | + @PostMapping("/sendSmsCommand") | |
| 128 | + public Result<?> sendSmsCommand(@RequestBody String bean) { | |
| 129 | + JSONObject params = JSONObject.parseObject(bean); | |
| 130 | + return deviceService.sendSmsCommand(params); | |
| 131 | + } | |
| 132 | + | |
| 133 | + @PostMapping("/sendHourlySystem") | |
| 134 | + public Result<?> sendHourlySystem(@RequestBody String bean) { | |
| 135 | + JSONObject params = JSONObject.parseObject(bean); | |
| 136 | + return deviceService.sendHourlySystem(params); | |
| 137 | + } | |
| 138 | + | |
| 139 | + @PostMapping("/sendClientBindContact") | |
| 140 | + public Result<?> sendClientBindContact(@RequestBody String bean) { | |
| 141 | + JSONObject params = JSONObject.parseObject(bean); | |
| 142 | + return deviceService.sendClientBindContact(params); | |
| 143 | + } | |
| 144 | + | |
| 145 | + @PostMapping("/sendHeartRateCheck") | |
| 146 | + public Result<?> sendHeartRateCheck(@RequestBody String bean) { | |
| 147 | + JSONObject params = JSONObject.parseObject(bean); | |
| 148 | + return deviceService.sendHeartRateCheck(params); | |
| 149 | + } | |
| 150 | + | |
| 151 | + @PostMapping("/sendBloodPressureCheck") | |
| 152 | + public Result<?> sendBloodPressureCheck(@RequestBody String bean) { | |
| 153 | + JSONObject params = JSONObject.parseObject(bean); | |
| 154 | + return deviceService.sendBloodPressureCheck(params); | |
| 155 | + } | |
| 35 | 156 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/ThinkraceUtil.java
| ... | ... | @@ -49,13 +49,11 @@ public class ThinkraceUtil { |
| 49 | 49 | public static String generatorSn() { |
| 50 | 50 | Long commandSn; |
| 51 | 51 | // 防止出现线程安全 重复覆盖值的情况 |
| 52 | - synchronized (ThinkraceUtil.class) { | |
| 53 | - // 指令流水号是6位的 不足补0 | |
| 54 | - commandSn = REDIS_CACHE.increment(COMMAND_SN); | |
| 55 | - if (commandSn == null || commandSn > SN_LENGTH) { | |
| 56 | - commandSn = 0L; | |
| 57 | - REDIS_CACHE.setCacheObject(COMMAND_SN, commandSn.intValue()); | |
| 58 | - } | |
| 52 | + // 指令流水号是6位的 不足补0 | |
| 53 | + commandSn = REDIS_CACHE.increment(COMMAND_SN); | |
| 54 | + if (commandSn == null || commandSn > SN_LENGTH) { | |
| 55 | + commandSn = 0L; | |
| 56 | + REDIS_CACHE.setCacheObject(COMMAND_SN, commandSn.intValue()); | |
| 59 | 57 | } |
| 60 | 58 | String commandSnStr = commandSn.toString(); |
| 61 | 59 | int snLen = (SN_LENGTH.toString().length() - 1) - commandSnStr.length(); |
| ... | ... | @@ -91,6 +89,7 @@ public class ThinkraceUtil { |
| 91 | 89 | public static final String GPS_REQ = "IWAP01"; |
| 92 | 90 | public static final String MORE_GPS_REQ = "IWAP02"; |
| 93 | 91 | public static final String KEEPLIVE_REQ = "IWAP03"; |
| 92 | + public static final String NOW_GPS_REQ = "IWAP15"; | |
| 94 | 93 | /** |
| 95 | 94 | * 电量报警 |
| 96 | 95 | */ |
| ... | ... | @@ -143,6 +142,26 @@ public class ThinkraceUtil { |
| 143 | 142 | |
| 144 | 143 | public static final String UPLOAD_GPS_TIME_REQ = "IWAP15"; |
| 145 | 144 | |
| 145 | + public static final String RECOVERY_RESET_REQ = "IWAP17"; | |
| 146 | + public static final String RESET_POWER_REQ = "IWAP18"; | |
| 147 | + public static final String SET_SERVER_INFO_REQ = "IWAP19"; | |
| 148 | + public static final String SET_LANGUAGE_TIME_REQ = "IWAP20"; | |
| 149 | + public static final String SHUTDOWN_REQ = "IWAP31"; | |
| 150 | + public static final String CALL_TEL_REQ = "IWAP32"; | |
| 151 | + public static final String WORK_MODE_REQ = "IWAP33"; | |
| 152 | + public static final String SHORTCUT_COMMAND = "IWAP40"; | |
| 153 | + public static final String PHOTOGRAPH_REQ = "IWAP46"; | |
| 154 | + public static final String HEART_CHECK_REQ = "IWAP50"; | |
| 155 | + public static final String CONTACT_BOOK_REQ = "IWAP51"; | |
| 156 | + public static final String DEL_CONTACT_BOOK_REQ = "IWAP52"; | |
| 157 | + public static final String WHITE_BUTTON_REQ = "IWAP84"; | |
| 158 | + public static final String FIND_CLIENT_REQ = "IWAP88"; | |
| 159 | + public static final String MOTION_CHECK_REQ = "IWAPMC"; | |
| 160 | + public static final String SMS_COMMAND_REQ = "IWAPSM"; | |
| 161 | + public static final String HOURLY_SYSTEM_REQ = "IWAPTF"; | |
| 162 | + public static final String CLIENT_BIND_CONTACT_REQ = "IWAPWL"; | |
| 163 | + public static final String HEART_RATE_CHECK_REQ = "IWAPXL"; | |
| 164 | + public static final String BLOOD_PRESSURE_CHECK_REQ = "IWAPXY"; | |
| 146 | 165 | } |
| 147 | 166 | |
| 148 | 167 | public static class RES { |
| ... | ... | @@ -203,8 +222,29 @@ public class ThinkraceUtil { |
| 203 | 222 | */ |
| 204 | 223 | public static class ACTIVE { |
| 205 | 224 | public static final String CONTACT_ACTIVE = "IWBP14"; |
| 225 | + public static final String RECOVERY_RESET_ACTIVE = "IWBP17"; | |
| 206 | 226 | public static final String UPLOAD_GPS_TIME_ACTIVE = "IWBP15"; |
| 207 | 227 | public static final String SOS_ACTIVE = "IWBP12"; |
| 228 | + public static final String NOW_GPS_ACTIVE = "IWBP16"; | |
| 229 | + public static final String RESET_POWER_ACTIVE = "IWBP18"; | |
| 230 | + public static final String SET_SERVER_INFO_ACTIVE = "IWBP19"; | |
| 231 | + public static final String SET_LANGUAGE_TIME_ACTIVE = "IWBP20"; | |
| 232 | + public static final String SHUTDOWN_ACTIVE = "IWBP31"; | |
| 233 | + public static final String CALL_TEL_ACTIVE = "IWBP32"; | |
| 234 | + public static final String WORK_MODE_ACTIVE = "IWBP33"; | |
| 235 | + public static final String SHORTCUT_COMMAND_ACTIVE = "IWBP40"; | |
| 236 | + public static final String PHOTOGRAPH_ACTIVE = "IWBP46"; | |
| 237 | + public static final String HEART_CHECK_ACTIVE = "IWBP50"; | |
| 238 | + public static final String CONTACT_BOOK_ACTIVE = "IWBP51"; | |
| 239 | + public static final String DEL_CONTACT_BOOK_ACTIVE = "IWBP52"; | |
| 240 | + public static final String WHITE_BUTTON_ACTIVE = "IWBP84"; | |
| 241 | + public static final String FIND_CLIENT_ACTIVE = "IWBP88"; | |
| 242 | + public static final String MOTION_CHECK_ACTIVE = "IWBPMC"; | |
| 243 | + public static final String SMS_COMMAND_ACTIVE = "IWBPSM"; | |
| 244 | + public static final String HOURLY_SYSTEM_ACTIVE = "IWBPTF"; | |
| 245 | + public static final String CLIENT_BIND_CONTACT_ACTIVE = "IWBPWL"; | |
| 246 | + public static final String HEART_RATE_CHECK_ACTIVE = "IWBPXL"; | |
| 247 | + public static final String BLOOD_PRESSURE_CHECK_ACTIVE = "IWBPXY"; | |
| 208 | 248 | } |
| 209 | 249 | |
| 210 | 250 | |
| ... | ... | @@ -228,8 +268,8 @@ public class ThinkraceUtil { |
| 228 | 268 | DeviceManager.sendCommand(imei, command); |
| 229 | 269 | } |
| 230 | 270 | |
| 231 | - public static boolean askCommand(String txt, String imei, String command, String commandSn, ICommandAdapter adapter) { | |
| 232 | - return DeviceManager.askCommand(txt, imei, command, commandSn, adapter); | |
| 271 | + public static boolean askCommand(String txt, String imei, String command, String commandSn) { | |
| 272 | + return DeviceManager.askCommand(txt, imei, command, commandSn); | |
| 233 | 273 | } |
| 234 | 274 | |
| 235 | 275 | public static void setDevice(String imei, ChannelHandlerContext ctx) { |
| ... | ... | @@ -326,10 +366,9 @@ public class ThinkraceUtil { |
| 326 | 366 | * @param imei 设备号 可以为 -- null |
| 327 | 367 | * @param command 指令 |
| 328 | 368 | * @param commandSn 指令流水号 |
| 329 | - * @param adapter 适配器 -- 调用适配器的更新方法 | |
| 330 | 369 | * @return obj 处理结果 |
| 331 | 370 | */ |
| 332 | - public static boolean askCommand(String txt, String imei, String command, String commandSn, ICommandAdapter adapter) { | |
| 371 | + public static boolean askCommand(String txt, String imei, String command, String commandSn) { | |
| 333 | 372 | log.info("{}:设备:{},命令流水号:{},响应命令:{}", txt, imei, commandSn, command); |
| 334 | 373 | // 通过事件通知 另外单独一个类通知 |
| 335 | 374 | String key = getCommandKey(imei, commandSn); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveBloodPressureCheckPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.BLOOD_PRESSURE_CHECK_ACTIVE) | |
| 10 | +public class IActiveBloodPressureCheckPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBPXY,IMEI,指令流水号# | |
| 19 | + //示例:IWBPXY,353456789012345,080835# | |
| 20 | + //说明: | |
| 21 | + //IW:包头标识符 | |
| 22 | + //BPXY:协议号 | |
| 23 | + //353456789012345:IMEI号,终端唯一ID | |
| 24 | + //080835 :指令流水号 | |
| 25 | + JSONObject jsonObject = (JSONObject) params; | |
| 26 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 27 | + String sn = generatorSn(); | |
| 28 | + StringBuilder command = new StringBuilder(); | |
| 29 | + command.append(ThinkraceUtil.ACTIVE.BLOOD_PRESSURE_CHECK_ACTIVE).append(","); | |
| 30 | + command.append(imei).append(","); | |
| 31 | + command.append(sn).append(ThinkraceUtil.END_SYMBOL); | |
| 32 | + return syncSendCommand(imei, sn, command.toString()); | |
| 33 | + } | |
| 34 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveCallTelPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.CALL_TEL_ACTIVE) | |
| 10 | +public class IActiveCallTelPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + // 格式:IWBP32,IMEI,指令流水号,电话号码# | |
| 19 | + //示例:IWBP32,353456789012345,080835,133xxxxxxxx# | |
| 20 | + JSONObject jsonObject = (JSONObject) params; | |
| 21 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 22 | + String tel = jsonObject.getString("tel"); | |
| 23 | + String sn = generatorSn(); | |
| 24 | + StringBuilder command = new StringBuilder(); | |
| 25 | + command.append(ThinkraceUtil.ACTIVE.CALL_TEL_ACTIVE).append(","); | |
| 26 | + command.append(imei).append(","); | |
| 27 | + command.append(sn).append(","); | |
| 28 | + command.append(tel).append(ThinkraceUtil.END_SYMBOL); | |
| 29 | + return syncSendCommand(imei, sn, command.toString()); | |
| 30 | + } | |
| 31 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveClientBindContactPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.CLIENT_BIND_CONTACT_ACTIVE) | |
| 10 | +public class IActiveClientBindContactPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + // 格式:IWBPWL, IMEI,指令流水号, 联系人1名称|联系人1电话|绑定终端的IMEI,联系人2名称|联系人2电话|绑定终端的IMEI,联系人3名称|联系人3电话|绑定终端的IMEI,联系人4名称|联系人4电话|绑定终端的IMEI,联系人5名称|联系人5电话|绑定终端的IMEI,联系人6名称|联系人6电话|绑定终端的IMEI,联系人7名称|联系人7电话|绑定终端的IMEI,联系人8名称|联系人8电话|绑定终端的IMEI,联系人9名称|联系人9电话|绑定终端的IMEI,联系人10名称|联系人10电话|绑定终端的IMEI# | |
| 19 | + //示例:IWBPWL,353456789012345,080835,D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx # | |
| 20 | + //说明: | |
| 21 | + //IW:包头标识符 | |
| 22 | + //BPWL:协议号 | |
| 23 | + //353456789012345:IMEI号,终端唯一ID | |
| 24 | + //080835 :指令流水号 | |
| 25 | + //D3590D54|135xxxxxxxxxx|9507xxxxxxxx : 一组联系人,使用|分隔名称和电话号码和与该联系人绑定的终端的IMEI号。名称使用UNICODE编码直接下发byte,多组之间使用逗号分隔,未填写的可为空,但位置仍需保留。 | |
| 26 | + JSONObject jsonObject = (JSONObject) params; | |
| 27 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 28 | + String sn = generatorSn(); | |
| 29 | + String commandValue = jsonObject.getString("commandValue"); | |
| 30 | + StringBuilder command = new StringBuilder(); | |
| 31 | + command.append(ThinkraceUtil.ACTIVE.CLIENT_BIND_CONTACT_ACTIVE).append(","); | |
| 32 | + command.append(imei).append(","); | |
| 33 | + command.append(sn).append(","); | |
| 34 | + command.append(commandValue).append(","); | |
| 35 | + return syncSendCommand(imei, sn, command.toString()); | |
| 36 | + } | |
| 37 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveContactBookPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.CONTACT_BOOK_ACTIVE) | |
| 10 | +public class IActiveContactBookPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBP51,IMEI,指令流水号,联系人名称,联系人电话# | |
| 19 | + //示例:IWBP51,353456789012345,080835, D3590D54,13333333333# | |
| 20 | + //说明: | |
| 21 | + //IW:包头标识符 | |
| 22 | + //BP51:协议号 | |
| 23 | + //353456789012345:IMEI号,终端唯一ID | |
| 24 | + //080835 :指令流水号 | |
| 25 | + //D3590D54: 联系人名称 | |
| 26 | + //13333333333: 电话号码 | |
| 27 | + JSONObject jsonObject = (JSONObject) params; | |
| 28 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 29 | + String sn = generatorSn(); | |
| 30 | + String contactBook = jsonObject.getString("contactBook"); | |
| 31 | + StringBuilder command = new StringBuilder(); | |
| 32 | + command.append(ThinkraceUtil.ACTIVE.CONTACT_BOOK_ACTIVE).append(","); | |
| 33 | + command.append(imei).append(","); | |
| 34 | + command.append(sn).append(","); | |
| 35 | + command.append(contactBook).append(ThinkraceUtil.END_SYMBOL); | |
| 36 | + return syncSendCommand(imei, sn, command.toString()); | |
| 37 | + } | |
| 38 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveDelContactBookPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | + | |
| 10 | +@Service(ThinkraceUtil.ACTIVE.DEL_CONTACT_BOOK_ACTIVE) | |
| 11 | +public class IActiveDelContactBookPacketAdapter extends ICommandAdapter { | |
| 12 | + @Override | |
| 13 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 14 | + return null; | |
| 15 | + } | |
| 16 | + | |
| 17 | + @Override | |
| 18 | + public CommandListen sendCommand(Object params) { | |
| 19 | + //格式:IWBP52,IMEI,指令流水号,电话号码# | |
| 20 | + //示例:IWBP52,353456789012345,080835,13333333333# | |
| 21 | + //说明: | |
| 22 | + //IW:包头标识符 | |
| 23 | + //BP52:协议号 | |
| 24 | + //353456789012345:IMEI号,终端唯一ID | |
| 25 | + //080835 :指令流水号 | |
| 26 | + //13333333333: 电话号码 | |
| 27 | + JSONObject jsonObject = (JSONObject) params; | |
| 28 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 29 | + String delContactBook = jsonObject.getString("delContactBook"); | |
| 30 | + String sn = generatorSn(); | |
| 31 | + StringBuilder command = new StringBuilder(); | |
| 32 | + command.append(ThinkraceUtil.ACTIVE.DEL_CONTACT_BOOK_ACTIVE).append(","); | |
| 33 | + command.append(imei).append(","); | |
| 34 | + command.append(sn).append(","); | |
| 35 | + command.append(delContactBook).append(ThinkraceUtil.END_SYMBOL); | |
| 36 | + return syncSendCommand(imei, sn, command.toString()); | |
| 37 | + } | |
| 38 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveFindClientPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.FIND_CLIENT_ACTIVE) | |
| 10 | +public class IActiveFindClientPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBP88,IMEI,指令流水号# | |
| 19 | + //示例:IWBP88,080835# | |
| 20 | + //说明: | |
| 21 | + //IW:包头标识符 | |
| 22 | + //BP88:协议号 | |
| 23 | + //080835 :指令流水号 | |
| 24 | + JSONObject jsonObject = (JSONObject) params; | |
| 25 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 26 | + String sn = generatorSn(); | |
| 27 | + StringBuilder command = new StringBuilder(); | |
| 28 | + command.append(ThinkraceUtil.ACTIVE.FIND_CLIENT_ACTIVE).append(","); | |
| 29 | + command.append(imei).append(","); | |
| 30 | + command.append(sn).append(ThinkraceUtil.END_SYMBOL); | |
| 31 | + return syncSendCommand(imei, sn, command.toString()); | |
| 32 | + } | |
| 33 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveHearCheckPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.HEART_CHECK_ACTIVE) | |
| 10 | +public class IActiveHearCheckPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + // 格式:IWBP50,IMEI,指令流水号# | |
| 19 | + //示例:IWBP50,353456789012345,080835# | |
| 20 | + //说明: | |
| 21 | + //IW:包头标识符 | |
| 22 | + //BP50:协议号 | |
| 23 | + //353456789012345:IMEI号,终端唯一ID | |
| 24 | + //080835 :指令流水号 | |
| 25 | + JSONObject jsonObject = (JSONObject) params; | |
| 26 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 27 | + String sn = generatorSn(); | |
| 28 | + StringBuilder command = new StringBuilder(); | |
| 29 | + command.append(ThinkraceUtil.ACTIVE.HEART_CHECK_ACTIVE).append(","); | |
| 30 | + command.append(imei).append(","); | |
| 31 | + command.append(sn).append(ThinkraceUtil.END_SYMBOL); | |
| 32 | + return syncSendCommand(imei, sn, command.toString()); | |
| 33 | + } | |
| 34 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveHeartRateCheckPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.HEART_RATE_CHECK_ACTIVE) | |
| 10 | +public class IActiveHeartRateCheckPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBPXL,IMEI,指令流水号# | |
| 19 | + //示例:IWBPXL,353456789012345,080835# | |
| 20 | + //说明: | |
| 21 | + //IW:包头标识符 | |
| 22 | + //BPXL:协议号 | |
| 23 | + //353456789012345:IMEI号,终端唯一ID | |
| 24 | + //080835 :指令流水号 | |
| 25 | + JSONObject jsonObject = (JSONObject) params; | |
| 26 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 27 | + String sn = generatorSn(); | |
| 28 | + StringBuilder command = new StringBuilder(); | |
| 29 | + command.append(ThinkraceUtil.ACTIVE.HEART_RATE_CHECK_ACTIVE).append(","); | |
| 30 | + command.append(imei).append(","); | |
| 31 | + command.append(sn).append(ThinkraceUtil.END_SYMBOL); | |
| 32 | + return syncSendCommand(imei, sn, command.toString()); | |
| 33 | + } | |
| 34 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveHourlySystemPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.HOURLY_SYSTEM_ACTIVE) | |
| 10 | +public class IActiveHourlySystemPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + // 格式:IWBPTF,IMEI,设置值# | |
| 19 | + //示例:IWBPTF,353456789012345,2# | |
| 20 | + //说明: | |
| 21 | + //IW:包头标识符 | |
| 22 | + //BPTF:协议号 | |
| 23 | + //1:设置值。取值为1代表24小时制,取值为2代表12小时制 | |
| 24 | + JSONObject jsonObject = (JSONObject) params; | |
| 25 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 26 | + String commandValue = jsonObject.getString("commandValue"); | |
| 27 | + StringBuilder command = new StringBuilder(); | |
| 28 | + command.append(ThinkraceUtil.ACTIVE.HOURLY_SYSTEM_ACTIVE).append(","); | |
| 29 | + command.append(imei).append(","); | |
| 30 | + command.append(commandValue).append(ThinkraceUtil.END_SYMBOL); | |
| 31 | + return syncSendCommand(imei, ThinkraceUtil.ACTIVE.HOURLY_SYSTEM_ACTIVE, command.toString()); | |
| 32 | + } | |
| 33 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveMotionCheckControPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.MOTION_CHECK_ACTIVE) | |
| 10 | +public class IActiveMotionCheckControPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBPMC,IMEI,指令流水号,设置值# | |
| 19 | + //示例:IWBPMC,353456789012345,0808351,1# | |
| 20 | + //说明: | |
| 21 | + //IW:包头标识符 | |
| 22 | + //BPMC:协议号 | |
| 23 | + //1:设置值:取值为0表示关闭,1表示打开,2表示获取当前的状态,不做设置,只返回。 | |
| 24 | + JSONObject jsonObject = (JSONObject) params; | |
| 25 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 26 | + String sn = generatorSn(); | |
| 27 | + String commandValue = jsonObject.getString("commandValue"); | |
| 28 | + StringBuilder command = new StringBuilder(); | |
| 29 | + command.append(ThinkraceUtil.ACTIVE.MOTION_CHECK_ACTIVE).append(","); | |
| 30 | + command.append(imei).append(","); | |
| 31 | + command.append(sn).append(","); | |
| 32 | + command.append(commandValue).append(ThinkraceUtil.END_SYMBOL); | |
| 33 | + return syncSendCommand(imei, sn, command.toString()); | |
| 34 | + } | |
| 35 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveNowGpsPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 立即定位指令 | |
| 10 | + */ | |
| 11 | +@Service(ThinkraceUtil.ACTIVE.NOW_GPS_ACTIVE) | |
| 12 | +public class IActiveNowGpsPacketAdapter extends ICommandAdapter { | |
| 13 | + @Override | |
| 14 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 15 | + return null; | |
| 16 | + } | |
| 17 | + | |
| 18 | + @Override | |
| 19 | + public CommandListen sendCommand(Object params) { | |
| 20 | + //格式:IWBP15,IMEI,指令流水号,定位间隔# | |
| 21 | + //示例:IWBP15,353456789012345,080835,300# | |
| 22 | + String imei = (String) params; | |
| 23 | + String sn = generatorSn(); | |
| 24 | + StringBuilder command = new StringBuilder(); | |
| 25 | + command.append(ThinkraceUtil.ACTIVE.NOW_GPS_ACTIVE).append(','); | |
| 26 | + command.append(imei).append(','); | |
| 27 | + command.append(sn).append(ThinkraceUtil.END_SYMBOL); | |
| 28 | + return syncSendCommand(imei, sn, command.toString()); | |
| 29 | + } | |
| 30 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActivePhotographPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.PHOTOGRAPH_ACTIVE) | |
| 10 | +public class IActivePhotographPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBP46,IMEI,指令流水号,指令值,参数# | |
| 19 | + //示例:IWBP46,353456789012345,080835,1,xx# | |
| 20 | + //说明: | |
| 21 | + //IW:包头标识符 | |
| 22 | + //BP46:协议号 | |
| 23 | + //353456789012345:IMEI号,终端唯一ID | |
| 24 | + //080835 :指令流水号 | |
| 25 | + //1:指令值,取值为1表示立即拍照 | |
| 26 | + //xx: 此为可选项。根据不同类型终端扩展 | |
| 27 | + JSONObject jsonObject = (JSONObject) params; | |
| 28 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 29 | + String sn = generatorSn(); | |
| 30 | + Integer commandValue = 1; | |
| 31 | + String clientType = "xx"; | |
| 32 | + // TODO | |
| 33 | + StringBuilder command = new StringBuilder(); | |
| 34 | + command.append(ThinkraceUtil.ACTIVE.PHOTOGRAPH_ACTIVE).append(","); | |
| 35 | + command.append(imei).append(","); | |
| 36 | + command.append(sn).append(","); | |
| 37 | + command.append(commandValue).append(","); | |
| 38 | + command.append(clientType).append(ThinkraceUtil.END_SYMBOL); | |
| 39 | + return syncSendCommand(imei, sn, command.toString()); | |
| 40 | + } | |
| 41 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveRecoveryResetPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | + | |
| 8 | +@Service(ThinkraceUtil.ACTIVE.RECOVERY_RESET_ACTIVE) | |
| 9 | +public class IActiveRecoveryResetPacketAdapter extends ICommandAdapter { | |
| 10 | + @Override | |
| 11 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 12 | + return null; | |
| 13 | + } | |
| 14 | + | |
| 15 | + @Override | |
| 16 | + public CommandListen sendCommand(Object params) { | |
| 17 | + // 格式:IWBP17,IMEI,指令流水号# | |
| 18 | + // 示例:IWBP17,353456789012345,080835# | |
| 19 | + String imei = (String) params; | |
| 20 | + String sn = generatorSn(); | |
| 21 | + StringBuilder command = new StringBuilder(); | |
| 22 | + command.append(ThinkraceUtil.ACTIVE.RECOVERY_RESET_ACTIVE).append(','); | |
| 23 | + command.append(imei).append(','); | |
| 24 | + command.append(sn).append(ThinkraceUtil.END_SYMBOL); | |
| 25 | + return syncSendCommand(imei, sn, command.toString()); | |
| 26 | + } | |
| 27 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveResetPowerPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * @author 20412 | |
| 10 | + */ | |
| 11 | +@Service(ThinkraceUtil.ACTIVE.RESET_POWER_ACTIVE) | |
| 12 | +public class IActiveResetPowerPacketAdapter extends ICommandAdapter { | |
| 13 | + @Override | |
| 14 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 15 | + return null; | |
| 16 | + } | |
| 17 | + | |
| 18 | + @Override | |
| 19 | + public CommandListen sendCommand(Object params) { | |
| 20 | + // 格式:IWBP18,IMEI,指令流水号# | |
| 21 | + // 示例:IWBP18,353456789012345,080835# | |
| 22 | + String imei = (String) params; | |
| 23 | + String sn = generatorSn(); | |
| 24 | + StringBuilder command = new StringBuilder(); | |
| 25 | + command.append(ThinkraceUtil.ACTIVE.RESET_POWER_ACTIVE).append(","); | |
| 26 | + command.append(imei).append(","); | |
| 27 | + command.append(sn).append(ThinkraceUtil.END_SYMBOL); | |
| 28 | + return syncSendCommand(imei, sn, command.toString()); | |
| 29 | + } | |
| 30 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveSettingLanguageTimePacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.SET_LANGUAGE_TIME_ACTIVE) | |
| 10 | +public class IActiveSettingLanguageTimePacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBP20,IMEI,指令流水号,语言,时区# | |
| 19 | + //示例:IWBP20,353456789012345,080835,0,8# | |
| 20 | + JSONObject jsonObject = (JSONObject) params; | |
| 21 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 22 | + String sn = generatorSn(); | |
| 23 | + Integer label = 0; | |
| 24 | + Integer timeZone = 8; | |
| 25 | + StringBuilder command = new StringBuilder(); | |
| 26 | + command.append(ThinkraceUtil.ACTIVE.SET_LANGUAGE_TIME_ACTIVE).append(","); | |
| 27 | + command.append(imei).append(","); | |
| 28 | + command.append(sn).append(","); | |
| 29 | + command.append(label).append(","); | |
| 30 | + command.append(timeZone).append(ThinkraceUtil.END_SYMBOL); | |
| 31 | + return syncSendCommand(imei, sn, command.toString()); | |
| 32 | + } | |
| 33 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveSettingServerInfoPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +import java.util.Map; | |
| 10 | + | |
| 11 | +@Service(ThinkraceUtil.ACTIVE.SET_SERVER_INFO_ACTIVE) | |
| 12 | +public class IActiveSettingServerInfoPacketAdapter extends ICommandAdapter { | |
| 13 | + @Override | |
| 14 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 15 | + return null; | |
| 16 | + } | |
| 17 | + | |
| 18 | + @Override | |
| 19 | + public CommandListen sendCommand(Object params) { | |
| 20 | + // 格式:IWBP19+IMEI,指令流水号,域名标志位,IP域名,端口# | |
| 21 | + // 示例:IWBP19,353456789012345,080835,0,127.0.0.1,8011# | |
| 22 | + // IW:包头标识符 | |
| 23 | + // BP19:协议号 | |
| 24 | + // 353456789012345:IMEI号,终端唯一ID | |
| 25 | + // 080835 :指令流水号 | |
| 26 | + // 0: 域名标志位,表示本指令是绑定IP还是域名。0为IP, 1 为域名 | |
| 27 | + // 127.0.0.1: 绑定的服务器IP地址,为 1 时该字段应为域名 | |
| 28 | + // 8011: 绑定的端口 | |
| 29 | + JSONObject jsonObject = (JSONObject) params; | |
| 30 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 31 | + String sn = generatorSn(); | |
| 32 | + Integer label = 0; | |
| 33 | + Integer port = 8989; | |
| 34 | + String ip = "127.0.0.1"; | |
| 35 | + StringBuilder command = new StringBuilder(); | |
| 36 | + command.append(ThinkraceUtil.ACTIVE.SET_SERVER_INFO_ACTIVE).append(","); | |
| 37 | + command.append(imei).append(","); | |
| 38 | + command.append(sn).append(","); | |
| 39 | + command.append(label).append(","); | |
| 40 | + command.append(ip).append(","); | |
| 41 | + command.append(port).append(ThinkraceUtil.END_SYMBOL); | |
| 42 | + return syncSendCommand(imei, sn, command.toString()); | |
| 43 | + } | |
| 44 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveShortcutCommandPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import com.ruoyi.utils.IUnicodeUtils; | |
| 7 | +import io.netty.channel.ChannelHandlerContext; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | + | |
| 10 | +@Service(ThinkraceUtil.ACTIVE.SHORTCUT_COMMAND_ACTIVE) | |
| 11 | +public class IActiveShortcutCommandPacketAdapter extends ICommandAdapter { | |
| 12 | + @Override | |
| 13 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 14 | + return null; | |
| 15 | + } | |
| 16 | + | |
| 17 | + @Override | |
| 18 | + public CommandListen sendCommand(Object params) { | |
| 19 | + //格式:IWBP40,IMEI,指令流水号,指令内容# | |
| 20 | + //示例:IWBP40,353456789012345,080835,xxxxxxxxxx# | |
| 21 | + //说明: | |
| 22 | + //IW:包头标识符 | |
| 23 | + //BP40:协议号 | |
| 24 | + //353456789012345:IMEI号,终端唯一ID | |
| 25 | + //080835 :指令流水号 | |
| 26 | + //xxxxxxxxxx : 指令内容详见下表。 | |
| 27 | + //指令 格式 | |
| 28 | + //发送文字消息 指令内容为GB2312编码的字符串 | |
| 29 | + //发送语音 设语音文件的URL为https://www.vip.com/123.mp3 | |
| 30 | + //指令内容是将该URL转换为GB2312编码的一串字符。 | |
| 31 | + //发送图片 设图片文件URL为 https://www.vip.com/123.jpg | |
| 32 | + //指令内容是将该URL转换为GB2312编码的一串字符。 | |
| 33 | + //设置WIFI >*wifi@SSID|密码*< | |
| 34 | + //指令内容是将该字符串转换为GB2312编码,即可设置WIFI的密码,该指令会自动打开WIFI,并且在搜索到对应SSID的Wifi热点时,设置WIFI密码并连接。不管连接成不成功设备都不会反馈连接结果给服务器。 | |
| 35 | + //打开工人模式 >*workmode@user|1*< | |
| 36 | + //指令内容是将该字符串转换为GB2312编码,即可打开工人模式。工人模式是指手表只显示时间、打卡、查阅消息等几个主要界面。 | |
| 37 | + //关闭工人模式 >*workmode@user|0*< | |
| 38 | + //指令内容是将该字符串转换为GB2312编码,即可打开工人模式。工人模式是指手表显示全部的功能界面。 | |
| 39 | + //设置蓝牙间隔 >*ble@3600*< | |
| 40 | + //指令内容是将该字符串转换为GB2312编码,即可设定蓝牙发送间隔为3600秒 。建议不要设置太短间隔,功耗会高。 | |
| 41 | + //关闭蓝牙 >*ble@0*< | |
| 42 | + //指令内容是将该字符串转换为GB2312编码,即可关闭蓝牙模块。 | |
| 43 | + //>*ble@60*< | |
| 44 | + //指令内容是将该字符串转换为GB2312编码,是打开蓝牙并设置蓝牙扫描间隔为60秒。这个指令并不设置APBL蓝牙数据包的上传间隔。 | |
| 45 | + //跌倒开关 >*fall@0*< 关闭跌倒开关 或 >*fall@1*<打开跌倒开关 | |
| 46 | + //指令内容是将该字符串转换为GB2312编码,即可打开/关闭跌倒报警功能。 | |
| 47 | + //跌倒阈值设置 >*fallconfig@1000*< | |
| 48 | + //指令内容是将该字符串转换为GB2312编码,即可设置跌倒报警的阈值。计算数值大于1000判定为跌倒,触发跌倒报警。 | |
| 49 | + //佩戴状态判断 >*wearconfig@1*< 打开佩戴状态判断功能 | |
| 50 | + //>*wearconfig@0*< 关闭佩戴状态判断功能 | |
| 51 | + //指令内容是将该字符串转换为GB2312编码,即可打开/关闭佩戴状态检测功能。关闭佩戴状态时,手表不论戴在手腕上还是摘下来静置,手表都会按照预设频率打开传感器测试健康数据,并且有可能测得健康数据。 | |
| 52 | + //自动返回主界面阈值设置 >*returnhome@180*< 单位为秒 | |
| 53 | + //指令内容是将该字符串转换为GB2312编码,即可设置从功能界面返回主界面的时间 | |
| 54 | + JSONObject jsonObject = (JSONObject) params; | |
| 55 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 56 | + String sn = generatorSn(); | |
| 57 | + String commandContent = jsonObject.getString("commandContent"); | |
| 58 | + StringBuilder command = new StringBuilder(); | |
| 59 | + command.append(ThinkraceUtil.ACTIVE.SHORTCUT_COMMAND_ACTIVE).append(","); | |
| 60 | + command.append(imei).append(","); | |
| 61 | + command.append(sn).append(","); | |
| 62 | + command.append(IUnicodeUtils.toUnicode(commandContent)).append(ThinkraceUtil.END_SYMBOL); | |
| 63 | + return syncSendCommand(imei, sn, command.toString()); | |
| 64 | + } | |
| 65 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveShutDownPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.SHUTDOWN_ACTIVE) | |
| 10 | +public class IActiveShutDownPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBP31,IMEI,指令流水号# | |
| 19 | + //示例:IWBP31,353456789012345,080835# | |
| 20 | + JSONObject jsonObject = (JSONObject) params; | |
| 21 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 22 | + String sn = generatorSn(); | |
| 23 | + StringBuilder command = new StringBuilder(); | |
| 24 | + command.append(ThinkraceUtil.ACTIVE.SHUTDOWN_ACTIVE).append(","); | |
| 25 | + command.append(imei).append(","); | |
| 26 | + command.append(sn).append(ThinkraceUtil.END_SYMBOL); | |
| 27 | + return syncSendCommand(imei, sn, command.toString()); | |
| 28 | + } | |
| 29 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveSmsCommandPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.SMS_COMMAND_ACTIVE) | |
| 10 | +public class IActiveSmsCommandPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBPSM,IMEI,指令流水号,指令内容# | |
| 19 | + //示例:IWBPSM,355932600021328,680835,@wifictl@=connect-123-12345678-psk# 或 | |
| 20 | + //IWBPSM,355932600011584,680835,@sos=64812855;+85264812855;85264812855@# | |
| 21 | + //说明: | |
| 22 | + //IW:包头标识符 | |
| 23 | + //BPSM:协议号 | |
| 24 | + //@wifictl@=connect-123-12345678-psk:指令内容,具体格式参看附录指令文档 | |
| 25 | + //指令内容中不能出现#和逗号,否则解析会混乱。 | |
| 26 | + JSONObject jsonObject = (JSONObject) params; | |
| 27 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 28 | + String sn = generatorSn(); | |
| 29 | + String commandValue = jsonObject.getString("commandValue"); | |
| 30 | + StringBuilder command = new StringBuilder(); | |
| 31 | + command.append(ThinkraceUtil.ACTIVE.SMS_COMMAND_ACTIVE).append(","); | |
| 32 | + command.append(imei).append(","); | |
| 33 | + command.append(sn).append(","); | |
| 34 | + command.append(commandValue).append(ThinkraceUtil.END_SYMBOL); | |
| 35 | + return syncSendCommand(imei, sn, command.toString()); | |
| 36 | + } | |
| 37 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveWhiteButtonPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.WHITE_BUTTON_ACTIVE) | |
| 10 | +public class IActiveWhiteButtonPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBP84,IMEI,指令流水号,设置值# | |
| 19 | + //示例:IWBP84,353456789012345,080835,1# | |
| 20 | + //说明: | |
| 21 | + //IW:包头标识符 | |
| 22 | + //BP84:协议号 | |
| 23 | + //353456789012345:IMEI号,终端唯一ID | |
| 24 | + //080835 :指令流水号 | |
| 25 | + //1: 设置值,取值为1表示打开白名单,0 表示关闭白名单。 | |
| 26 | + JSONObject jsonObject = (JSONObject) params; | |
| 27 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 28 | + String commandValue = jsonObject.getString("commandValue"); | |
| 29 | + String sn = generatorSn(); | |
| 30 | + StringBuilder command = new StringBuilder(); | |
| 31 | + command.append(ThinkraceUtil.ACTIVE.WHITE_BUTTON_ACTIVE).append(","); | |
| 32 | + command.append(imei).append(","); | |
| 33 | + command.append(sn).append(","); | |
| 34 | + command.append(commandValue).append(ThinkraceUtil.END_SYMBOL); | |
| 35 | + return syncSendCommand(imei, sn, command.toString()); | |
| 36 | + } | |
| 37 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/active/IActiveWorkModePacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.active; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 4 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 5 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 6 | +import io.netty.channel.ChannelHandlerContext; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.ACTIVE.WORK_MODE_ACTIVE) | |
| 10 | +public class IActiveWorkModePacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + return null; | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public CommandListen sendCommand(Object params) { | |
| 18 | + //格式:IWBP33,IMEI,指令流水号,工作模式# | |
| 19 | + //示例:IWBP33,353456789012345,080835,1# | |
| 20 | + //IW:包头标识符 | |
| 21 | + //BP33:协议号 | |
| 22 | + //353456789012345:IMEI号,终端唯一ID | |
| 23 | + //080835:指令流水号 | |
| 24 | + //1:终端的工作模式,1:正常模式,2:省电模式,3:紧急模式 | |
| 25 | + JSONObject jsonObject = (JSONObject) params; | |
| 26 | + String imei = jsonObject.getString(ThinkraceUtil.IMEI); | |
| 27 | + String sn = generatorSn(); | |
| 28 | + Integer workMode = 1; | |
| 29 | + StringBuilder command = new StringBuilder(); | |
| 30 | + command.append(ThinkraceUtil.ACTIVE.WORK_MODE_ACTIVE).append(","); | |
| 31 | + command.append(imei).append(","); | |
| 32 | + command.append(sn).append(","); | |
| 33 | + command.append(workMode).append(ThinkraceUtil.END_SYMBOL); | |
| 34 | + return syncSendCommand(imei, sn, command.toString()); | |
| 35 | + } | |
| 36 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackBloodPressureCheckPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.BLOOD_PRESSURE_CHECK_REQ) | |
| 10 | +public class ICallbackBloodPressureCheckPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAPXY,指令流水号# 终端响应示例: | |
| 15 | + //IWAPXY,080835# | |
| 16 | + //080835:指令流水号 | |
| 17 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 18 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 19 | + String sn = params[1]; | |
| 20 | + return ThinkraceUtil.askCommand("测量血压", imei, command, sn); | |
| 21 | + } | |
| 22 | + | |
| 23 | + @Override | |
| 24 | + public CommandListen sendCommand(Object params) { | |
| 25 | + return null; | |
| 26 | + } | |
| 27 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackCallTelPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.CALL_TEL_REQ) | |
| 10 | +public class ICallbackCallTelPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAP32,指令流水号,电话号码# | |
| 15 | + // 终端响应示例: | |
| 16 | + // IWAP32,080835,133xxxxxxxx# | |
| 17 | + //080835:指令流水号 | |
| 18 | + //133xxxxxxxx:设置信息,供服务器同步 | |
| 19 | + String[] params = command.split(","); | |
| 20 | + String sn = params[1]; | |
| 21 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 22 | + return ThinkraceUtil.askCommand("拨打电话", imei, command, sn); | |
| 23 | + } | |
| 24 | + | |
| 25 | + @Override | |
| 26 | + public CommandListen sendCommand(Object params) { | |
| 27 | + return null; | |
| 28 | + } | |
| 29 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackClientBindContactPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.CLIENT_BIND_CONTACT_REQ) | |
| 10 | +public class ICallbackClientBindContactPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + // 终端响应格式: | |
| 14 | + //格式:IWAPWL,指令流水号, 联系人1名称|联系人1电话|绑定终端的IMEI,联系人2名称|联系人2电话|绑定终端的IMEI,联系人3名称|联系人3电话|绑定终端的IMEI,联系人4名称|联系人4电话|绑定终端的IMEI,联系人5名称|联系人5电话|绑定终端的IMEI,联系人6名称|联系人6电话|绑定终端的IMEI,联系人7名称|联系人7电话|绑定终端的IMEI,联系人8名称|联系人8电话|绑定终端的IMEI,联系人9名称|联系人9电话|绑定终端的IMEI,联系人10名称|联系人10电话|绑定终端的IMEI# 终端响应示例: | |
| 15 | + //IWAPWL,080835, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx, D3590D54|135xxxxxxxxxx# | |
| 16 | + //080835: 终端响应的时候带上响应流水号 | |
| 17 | + //D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx, D3590D54|135xxxxxxxxxx|9507xxxxxxxx回复终端当前设置的主控号码供平台同步使用 | |
| 18 | + String[] params = command.split(","); | |
| 19 | + String sn = params[1]; | |
| 20 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 21 | + | |
| 22 | + return ThinkraceUtil.askCommand("设置与终端绑定的联系人白名单", imei, command, sn); | |
| 23 | + } | |
| 24 | + | |
| 25 | + @Override | |
| 26 | + public CommandListen sendCommand(Object params) { | |
| 27 | + return null; | |
| 28 | + } | |
| 29 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackContactBookPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.CONTACT_BOOK_REQ) | |
| 10 | +public class ICallbackContactBookPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAP51,指令流水号,执行结果# 终端响应示例: | |
| 15 | + //IWAP51,080835,1# | |
| 16 | + //080835:指令流水号 | |
| 17 | + //1:执行结果表示终端执行成功,0 表示终端执行失败 | |
| 18 | + //此指令每次下发一个电话号码信息,次数不限,由终端处理保存,服务器只保存上一次下发的号码。不进行完整电话本保存,APP只显示上一次下发号码,不保存完整电话本。 | |
| 19 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 20 | + String sn = params[1]; | |
| 21 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 22 | + // TODO | |
| 23 | + String result = params[2]; | |
| 24 | + return ThinkraceUtil.askCommand("下发电话本", imei, command, sn); | |
| 25 | + } | |
| 26 | + | |
| 27 | + @Override | |
| 28 | + public CommandListen sendCommand(Object params) { | |
| 29 | + return null; | |
| 30 | + } | |
| 31 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackContactPeopleWhitePacketAdapter.java
| ... | ... | @@ -18,7 +18,7 @@ public class ICallbackContactPeopleWhitePacketAdapter extends ICommandAdapter { |
| 18 | 18 | // IWAP14,080835, D3590D54|135xxxxxxxxxx, |
| 19 | 19 | String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); |
| 20 | 20 | String[] params = command.split(","); |
| 21 | - return ThinkraceUtil.askCommand("设置联系人白名单", imei, command, params[1], this); | |
| 21 | + return ThinkraceUtil.askCommand("设置联系人白名单", imei, command, params[1]); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | @Override | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackDelContackBookPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.DEL_CONTACT_BOOK_REQ) | |
| 10 | +public class ICallbackDelContackBookPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + // 终端响应格式: | |
| 14 | + //IWAP52,指令流水号,执行结果# 终端响应示例: | |
| 15 | + //IWAP52,080835,1# | |
| 16 | + //080835:指令流水号 | |
| 17 | + //1:表示终端执行成功,0 表示终端执行失败 | |
| 18 | + //此指令下发号码后。由终端匹配号码进行删除。 | |
| 19 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 20 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 21 | + String sn = params[1]; | |
| 22 | + String resultValue = params[2]; | |
| 23 | + //TODO | |
| 24 | + return ThinkraceUtil.askCommand("删除电话本,单条", imei, command, sn); | |
| 25 | + } | |
| 26 | + | |
| 27 | + @Override | |
| 28 | + public CommandListen sendCommand(Object params) { | |
| 29 | + return null; | |
| 30 | + } | |
| 31 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackFindClientPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.FIND_CLIENT_REQ) | |
| 10 | +public class ICallbackFindClientPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应: | |
| 14 | + //IWAP88,指令流水号# IWAP88,080835# | |
| 15 | + //080835:指令流水号 | |
| 16 | + //备注:终端响应后会响铃,以提醒帮助使用者找到终端 | |
| 17 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 18 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 19 | + String sn = params[1]; | |
| 20 | + return ThinkraceUtil.askCommand("寻找终端", imei, command, sn); | |
| 21 | + } | |
| 22 | + | |
| 23 | + @Override | |
| 24 | + public CommandListen sendCommand(Object params) { | |
| 25 | + return null; | |
| 26 | + } | |
| 27 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackHeartCheckPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.HEART_CHECK_REQ) | |
| 10 | +public class ICallbackHeartCheckPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAP50,指令流水号,执行结果# 终端响应示例: | |
| 15 | + //IWAP50,080835,1# | |
| 16 | + //080835:指令流水号 | |
| 17 | + //1:表示终端执行成功,0 表示终端执行失败 | |
| 18 | + //心跳数据检测完成后,终端使用 AP49 上传心跳检测数据 | |
| 19 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 20 | + String sn = params[1]; | |
| 21 | + // TODO | |
| 22 | + String result = params[2]; | |
| 23 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 24 | + return ThinkraceUtil.askCommand("下发心跳检测指令", imei, command, sn); | |
| 25 | + } | |
| 26 | + | |
| 27 | + @Override | |
| 28 | + public CommandListen sendCommand(Object params) { | |
| 29 | + return null; | |
| 30 | + } | |
| 31 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackHeartRateCheckPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.HEART_RATE_CHECK_REQ) | |
| 10 | +public class ICallbackHeartRateCheckPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAPXL,指令流水号# 终端响应示例: | |
| 15 | + //IWAPXL,080835# | |
| 16 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 17 | + String sn = params[1]; | |
| 18 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 19 | + return ThinkraceUtil.askCommand("测量心率", imei, command, sn); | |
| 20 | + } | |
| 21 | + | |
| 22 | + @Override | |
| 23 | + public CommandListen sendCommand(Object params) { | |
| 24 | + return null; | |
| 25 | + } | |
| 26 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackHourlySystemPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.HOURLY_SYSTEM_REQ) | |
| 10 | +public class ICallbackHourlySystemPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAPTF, 执行结果# 终端响应示例: | |
| 15 | + //IWAPTF,1# | |
| 16 | + //1 表示执行指令成功 | |
| 17 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 18 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 19 | + // TODO | |
| 20 | + String resultValue = params[1]; | |
| 21 | + return ThinkraceUtil.askCommand("时间制度", imei, command, ThinkraceUtil.ACTIVE.HOURLY_SYSTEM_ACTIVE); | |
| 22 | + } | |
| 23 | + | |
| 24 | + @Override | |
| 25 | + public CommandListen sendCommand(Object params) { | |
| 26 | + return null; | |
| 27 | + } | |
| 28 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackMotionCheckPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.MOTION_CHECK_REQ) | |
| 10 | +public class ICallbackMotionCheckPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAPMC,指令流水号,执行结果# 终端响应示例: | |
| 15 | + //IWAPMC,080835,true# 或 IWAPMC,080835,false# | |
| 16 | + //True 表示执行指令成功 | |
| 17 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 18 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 19 | + String sn = params[1]; | |
| 20 | + String resultValue = params[2]; | |
| 21 | + // TODO | |
| 22 | + return ThinkraceUtil.askCommand("运动检测控制", imei, command, sn); | |
| 23 | + } | |
| 24 | + | |
| 25 | + @Override | |
| 26 | + public CommandListen sendCommand(Object params) { | |
| 27 | + return null; | |
| 28 | + } | |
| 29 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackNowGpsPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.NOW_GPS_REQ) | |
| 10 | +public class ICallbackNowGpsPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 14 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 15 | + String sn = params[1]; | |
| 16 | + return ThinkraceUtil.askCommand("立即定位指令", imei, command, sn); | |
| 17 | + } | |
| 18 | + | |
| 19 | + @Override | |
| 20 | + public CommandListen sendCommand(Object params) { | |
| 21 | + return null; | |
| 22 | + } | |
| 23 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackPhotographPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.PHOTOGRAPH_REQ) | |
| 10 | +public class ICallbackPhotographPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAP46,指令流水号,指令执行结果# 终端响应示例: | |
| 15 | + //IWAP46,080835,1# | |
| 16 | + //080835:指令流水号 | |
| 17 | + //1:指令执行结果,取值为1表示终端执行成功,0 表示终端执行失败,5表示终端正在上传照片中。 | |
| 18 | + //回复本指令后终端拍照,然后使用 AP42包上传相应图片文件。 | |
| 19 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 20 | + String sn = params[1]; | |
| 21 | + String result = params[2]; | |
| 22 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 23 | + return ThinkraceUtil.askCommand("立即拍照", imei, command, sn); | |
| 24 | + } | |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public CommandListen sendCommand(Object params) { | |
| 28 | + return null; | |
| 29 | + } | |
| 30 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackRecoveryResetPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.RECOVERY_RESET_REQ) | |
| 10 | +public class ICallbackRecoveryResetPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + // 终端响应格式: | |
| 14 | + // IWAP17,指令流水号# | |
| 15 | + // 终端响应示例: IWAP17,080835# | |
| 16 | + // 080835:指令流水号 | |
| 17 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 18 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 19 | + return ThinkraceUtil.askCommand("恢复出厂设置", imei, command, params[1]); | |
| 20 | + } | |
| 21 | + | |
| 22 | + @Override | |
| 23 | + public CommandListen sendCommand(Object params) { | |
| 24 | + return null; | |
| 25 | + } | |
| 26 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackResetPowerPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.RESET_POWER_REQ) | |
| 10 | +public class ICallbackResetPowerPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + // 终端响应格式: | |
| 14 | + // IWAP18,指令流水号# | |
| 15 | + // 终端响应示例:IWAP18,080835# | |
| 16 | + // 080835:指令流水号 | |
| 17 | + // 响应指令后,终端重启 | |
| 18 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 19 | + String sn = params[1]; | |
| 20 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 21 | + return ThinkraceUtil.askCommand("重启终端", imei, command, sn); | |
| 22 | + } | |
| 23 | + | |
| 24 | + @Override | |
| 25 | + public CommandListen sendCommand(Object params) { | |
| 26 | + return null; | |
| 27 | + } | |
| 28 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackSettingLanguageTimePacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * @author 20412 | |
| 11 | + */ | |
| 12 | +@Service(ThinkraceUtil.REQ.SET_LANGUAGE_TIME_REQ) | |
| 13 | +public class ICallbackSettingLanguageTimePacketAdapter extends ICommandAdapter { | |
| 14 | + @Override | |
| 15 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 16 | + //终端响应格式: | |
| 17 | + //IWAP20,指令流水号,语言,时区# | |
| 18 | + //终端响应示例: | |
| 19 | + //IWAP20,080835,0,8# | |
| 20 | + //080835:指令流水号 | |
| 21 | + //0,8:为设置信息,供平台同步使用(此时区自己保存,供登录响应服务器对时使用) | |
| 22 | + String[] params = command.split(","); | |
| 23 | + String sn = params[1]; | |
| 24 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 25 | + return ThinkraceUtil.askCommand("设置终端语言与时区", imei, command, sn); | |
| 26 | + } | |
| 27 | + | |
| 28 | + @Override | |
| 29 | + public CommandListen sendCommand(Object params) { | |
| 30 | + return null; | |
| 31 | + } | |
| 32 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackSettingServerInfoPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.SET_SERVER_INFO_REQ) | |
| 10 | +public class ICallbackSettingServerInfoPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAP19,指令流水号# | |
| 15 | + //终端响应示例:IWAP19,080835# | |
| 16 | + //080835:指令流水号 | |
| 17 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 18 | + String sn = params[1]; | |
| 19 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 20 | + return ThinkraceUtil.askCommand("设置服务器信息", imei, command, sn); | |
| 21 | + } | |
| 22 | + | |
| 23 | + @Override | |
| 24 | + public CommandListen sendCommand(Object params) { | |
| 25 | + return null; | |
| 26 | + } | |
| 27 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackSettingSosPacketAdapter.java
| ... | ... | @@ -21,7 +21,7 @@ public class ICallbackSettingSosPacketAdapter extends ICommandAdapter { |
| 21 | 21 | String[] params = command.split(","); |
| 22 | 22 | String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); |
| 23 | 23 | // 命令确认应答 |
| 24 | - return ThinkraceUtil.askCommand("设置sos命令响应",imei, command, params[1], this); | |
| 24 | + return ThinkraceUtil.askCommand("设置sos命令响应",imei, command, params[1]); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | @Override | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackShortcutCommandPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.SHORTCUT_COMMAND) | |
| 10 | +public class ICallbackShortcutCommandPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAP40,指令流水号,接收标志# 终端响应示例: | |
| 15 | + //IWAP40,080835,1# | |
| 16 | + //080835:指令流水号 | |
| 17 | + //1:接受标志,取值1表示终端接受数据成功,0表示接受数据失败。 | |
| 18 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 19 | + String sn = params[1]; | |
| 20 | + String label = params[2]; | |
| 21 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 22 | + // TODO | |
| 23 | + return ThinkraceUtil.askCommand("快捷指令下发", imei, command, sn); | |
| 24 | + } | |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public CommandListen sendCommand(Object params) { | |
| 28 | + return null; | |
| 29 | + } | |
| 30 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackShutdownPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.SHUTDOWN_REQ) | |
| 10 | +public class ICallbackShutdownPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + // 终端响应格式: | |
| 14 | + //IWAP31,指令流水号# | |
| 15 | + //终端响应示例: | |
| 16 | + //IWAP31,080835# | |
| 17 | + //080835:指令流水号 | |
| 18 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 19 | + String sn = params[1]; | |
| 20 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 21 | + return ThinkraceUtil.askCommand("关机指令", imei, command, sn); | |
| 22 | + } | |
| 23 | + | |
| 24 | + @Override | |
| 25 | + public CommandListen sendCommand(Object params) { | |
| 26 | + return null; | |
| 27 | + } | |
| 28 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackSmsCommandPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.SMS_COMMAND_REQ) | |
| 10 | +public class ICallbackSmsCommandPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + // 终端响应格式: | |
| 14 | + //IWAPSM,指令流水号,指令执行结果# | |
| 15 | + // 终端响应示例: | |
| 16 | + //IWAPSM,680835,set and connect to Wifi SSID 123, WiFiPassword 12345678, encryptType psk!# | |
| 17 | + //IWAPSM,680835,set SOS number ok!# | |
| 18 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 19 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 20 | + String sn = params[1]; | |
| 21 | + // TODO | |
| 22 | + String resultValue = params[2]; | |
| 23 | + return ThinkraceUtil.askCommand("短信指令", imei, command, sn); | |
| 24 | + } | |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public CommandListen sendCommand(Object params) { | |
| 28 | + return null; | |
| 29 | + } | |
| 30 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackUploadGpsTimePacketAdapter.java
| ... | ... | @@ -18,7 +18,7 @@ public class ICallbackUploadGpsTimePacketAdapter extends ICommandAdapter { |
| 18 | 18 | String[] params = command.split(","); |
| 19 | 19 | String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); |
| 20 | 20 | // 命令确认应答 |
| 21 | - return ThinkraceUtil.askCommand("GPS定位数据上传时间间隔命令响应", imei, command, params[1], this); | |
| 21 | + return ThinkraceUtil.askCommand("GPS定位数据上传时间间隔命令响应", imei, command, params[1]); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | @Override | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackWhiteButtonPacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.WHITE_BUTTON_REQ) | |
| 10 | +public class ICallbackWhiteButtonPacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAP84,指令流水号,执行结果# 终端响应格式: | |
| 15 | + //IWAP84,080835,1# | |
| 16 | + //080835:指令流水号 | |
| 17 | + //1:执行结果,取值为1表示终端执行成功,0 表示终端执行失败。 | |
| 18 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 19 | + String[] params = command.replace(ThinkraceUtil.END_SYMBOL, "").split(","); | |
| 20 | + String sn = params[1]; | |
| 21 | + String resultValue = params[2]; | |
| 22 | + // TODO | |
| 23 | + return ThinkraceUtil.askCommand("白名单开关", imei, command, sn); | |
| 24 | + } | |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public CommandListen sendCommand(Object params) { | |
| 28 | + return null; | |
| 29 | + } | |
| 30 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/protocol/adapter/callback/ICallbackWordModePacketAdapter.java
0 → 100644
| 1 | +package com.ruoyi.system.protocol.adapter.callback; | |
| 2 | + | |
| 3 | +import com.ruoyi.system.protocol.ThinkraceUtil; | |
| 4 | +import com.ruoyi.system.protocol.adapter.ICommandAdapter; | |
| 5 | +import io.netty.channel.ChannelHandlerContext; | |
| 6 | +import io.netty.util.AttributeKey; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +@Service(ThinkraceUtil.REQ.WORK_MODE_REQ) | |
| 10 | +public class ICallbackWordModePacketAdapter extends ICommandAdapter { | |
| 11 | + @Override | |
| 12 | + public Object resolveCommand(String command, ChannelHandlerContext ctx) { | |
| 13 | + //终端响应格式: | |
| 14 | + //IWAP33,指令流水号,工作模式# 终端响应示例: | |
| 15 | + //IWAP33,080835,1# | |
| 16 | + //080835:指令流水号 | |
| 17 | + //1:设置信息,供服务器同步 | |
| 18 | + String[] params = command.split(","); | |
| 19 | + String sn = params[1]; | |
| 20 | + String imei = ctx.channel().attr(AttributeKey.valueOf(ThinkraceUtil.IMEI)).toString(); | |
| 21 | + return ThinkraceUtil.askCommand("工作模式", imei, command, sn); | |
| 22 | + } | |
| 23 | + | |
| 24 | + @Override | |
| 25 | + public CommandListen sendCommand(Object params) { | |
| 26 | + return null; | |
| 27 | + } | |
| 28 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/service/IDeviceService.java
| 1 | 1 | package com.ruoyi.system.service; |
| 2 | 2 | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 3 | 4 | import com.baomidou.mybatisplus.extension.service.IService; |
| 4 | 5 | import com.ruoyi.common.global.Result; |
| 5 | 6 | import com.ruoyi.system.domain.active.Sos; |
| ... | ... | @@ -21,4 +22,46 @@ public interface IDeviceService extends IService<Device> |
| 21 | 22 | Result<?> settingWhiteList(WhiteListPeople wlp); |
| 22 | 23 | |
| 23 | 24 | Result<?> settingGpsUploadTime(UploadGpsTime ugt); |
| 25 | + | |
| 26 | + Result<?> settingNowGps(String imei); | |
| 27 | + | |
| 28 | + Result<?> sendRecoveryReset(String imei); | |
| 29 | + | |
| 30 | + Result<?> sendRecoveryPower(String imei); | |
| 31 | + | |
| 32 | + Result<?> settingServerInfo(JSONObject params); | |
| 33 | + | |
| 34 | + Result<?> settingLanguageTime(JSONObject params); | |
| 35 | + | |
| 36 | + Result<?> sendShutdown(JSONObject params); | |
| 37 | + | |
| 38 | + Result<?> sendCallTel(JSONObject params); | |
| 39 | + | |
| 40 | + Result<?> settingWorkMode(JSONObject params); | |
| 41 | + | |
| 42 | + Result<?> settingShortcutCommand(JSONObject params); | |
| 43 | + | |
| 44 | + Result<?> photograph(JSONObject params); | |
| 45 | + | |
| 46 | + Result<?> heartCheck(JSONObject params); | |
| 47 | + | |
| 48 | + Result<?> settingContactBook(JSONObject params); | |
| 49 | + | |
| 50 | + Result<?> sendDelContactBookSingle(JSONObject params); | |
| 51 | + | |
| 52 | + Result<?> settingWhiteButton(JSONObject params); | |
| 53 | + | |
| 54 | + Result<?> sendFindClient(JSONObject params); | |
| 55 | + | |
| 56 | + Result<?> sendMotionCheck(JSONObject params); | |
| 57 | + | |
| 58 | + Result<?> sendSmsCommand(JSONObject params); | |
| 59 | + | |
| 60 | + Result<?> sendHourlySystem(JSONObject params); | |
| 61 | + | |
| 62 | + Result<?> sendClientBindContact(JSONObject params); | |
| 63 | + | |
| 64 | + Result<?> sendHeartRateCheck(JSONObject params); | |
| 65 | + | |
| 66 | + Result<?> sendBloodPressureCheck(JSONObject params); | |
| 24 | 67 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/system/service/impl/DeviceServiceImpl.java
| 1 | 1 | package com.ruoyi.system.service.impl; |
| 2 | + | |
| 3 | +import com.alibaba.fastjson2.JSONObject; | |
| 2 | 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| 3 | 5 | |
| 4 | 6 | import com.ruoyi.common.global.Result; |
| ... | ... | @@ -13,13 +15,12 @@ import org.springframework.stereotype.Service; |
| 13 | 15 | |
| 14 | 16 | /** |
| 15 | 17 | * deviceService业务层处理 |
| 16 | - * | |
| 18 | + * | |
| 17 | 19 | * @author bsth |
| 18 | 20 | * @date 2024-04-17 |
| 19 | 21 | */ |
| 20 | 22 | @Service |
| 21 | -public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements IDeviceService | |
| 22 | -{ | |
| 23 | +public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements IDeviceService { | |
| 23 | 24 | |
| 24 | 25 | |
| 25 | 26 | @Override |
| ... | ... | @@ -28,7 +29,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme |
| 28 | 29 | .getAdapter(ThinkraceUtil.ACTIVE.SOS_ACTIVE) |
| 29 | 30 | .sendCommand(sos) |
| 30 | 31 | .listenAsk(); |
| 31 | - return Result.OK((result ? "设备成功响应" :"设备无响应")); | |
| 32 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | @Override |
| ... | ... | @@ -37,7 +38,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme |
| 37 | 38 | .getAdapter(ThinkraceUtil.ACTIVE.CONTACT_ACTIVE) |
| 38 | 39 | .sendCommand(wlp) |
| 39 | 40 | .listenAsk(); |
| 40 | - return Result.OK((result ? "设备成功响应" :"设备无响应")); | |
| 41 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | @Override |
| ... | ... | @@ -46,6 +47,195 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme |
| 46 | 47 | .getAdapter(ThinkraceUtil.ACTIVE.UPLOAD_GPS_TIME_ACTIVE) |
| 47 | 48 | .sendCommand(ugt) |
| 48 | 49 | .listenAsk(); |
| 49 | - return Result.OK((result ? "设备成功响应" :"设备无响应")); | |
| 50 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + public Result<?> settingNowGps(String imei) { | |
| 55 | + boolean result = ThinkraceUtil | |
| 56 | + .getAdapter(ThinkraceUtil.ACTIVE.NOW_GPS_ACTIVE) | |
| 57 | + .sendCommand(imei) | |
| 58 | + .listenAsk(); | |
| 59 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public Result<?> sendRecoveryReset(String imei) { | |
| 64 | + boolean result = ThinkraceUtil | |
| 65 | + .getAdapter(ThinkraceUtil.ACTIVE.RECOVERY_RESET_ACTIVE) | |
| 66 | + .sendCommand(imei) | |
| 67 | + .listenAsk(); | |
| 68 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 69 | + } | |
| 70 | + | |
| 71 | + @Override | |
| 72 | + public Result<?> sendRecoveryPower(String imei) { | |
| 73 | + boolean result = ThinkraceUtil | |
| 74 | + .getAdapter(ThinkraceUtil.ACTIVE.RESET_POWER_ACTIVE) | |
| 75 | + .sendCommand(imei) | |
| 76 | + .listenAsk(); | |
| 77 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public Result<?> settingServerInfo(JSONObject params) { | |
| 82 | + boolean result = ThinkraceUtil | |
| 83 | + .getAdapter(ThinkraceUtil.ACTIVE.SET_SERVER_INFO_ACTIVE) | |
| 84 | + .sendCommand(params) | |
| 85 | + .listenAsk(); | |
| 86 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 87 | + } | |
| 88 | + | |
| 89 | + @Override | |
| 90 | + public Result<?> settingLanguageTime(JSONObject params) { | |
| 91 | + boolean result = ThinkraceUtil | |
| 92 | + .getAdapter(ThinkraceUtil.ACTIVE.SET_LANGUAGE_TIME_ACTIVE) | |
| 93 | + .sendCommand(params) | |
| 94 | + .listenAsk(); | |
| 95 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 96 | + } | |
| 97 | + | |
| 98 | + @Override | |
| 99 | + public Result<?> sendShutdown(JSONObject params) { | |
| 100 | + boolean result = ThinkraceUtil | |
| 101 | + .getAdapter(ThinkraceUtil.ACTIVE.SHUTDOWN_ACTIVE) | |
| 102 | + .sendCommand(params) | |
| 103 | + .listenAsk(); | |
| 104 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 105 | + } | |
| 106 | + | |
| 107 | + @Override | |
| 108 | + public Result<?> sendCallTel(JSONObject params) { | |
| 109 | + boolean result = ThinkraceUtil | |
| 110 | + .getAdapter(ThinkraceUtil.ACTIVE.CALL_TEL_ACTIVE) | |
| 111 | + .sendCommand(params) | |
| 112 | + .listenAsk(); | |
| 113 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 114 | + } | |
| 115 | + | |
| 116 | + @Override | |
| 117 | + public Result<?> settingWorkMode(JSONObject params) { | |
| 118 | + boolean result = ThinkraceUtil | |
| 119 | + .getAdapter(ThinkraceUtil.ACTIVE.WORK_MODE_ACTIVE) | |
| 120 | + .sendCommand(params) | |
| 121 | + .listenAsk(); | |
| 122 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 123 | + } | |
| 124 | + | |
| 125 | + @Override | |
| 126 | + public Result<?> settingShortcutCommand(JSONObject params) { | |
| 127 | + boolean result = ThinkraceUtil | |
| 128 | + .getAdapter(ThinkraceUtil.ACTIVE.SHORTCUT_COMMAND_ACTIVE) | |
| 129 | + .sendCommand(params) | |
| 130 | + .listenAsk(); | |
| 131 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 132 | + } | |
| 133 | + | |
| 134 | + @Override | |
| 135 | + public Result<?> photograph(JSONObject params) { | |
| 136 | + boolean result = ThinkraceUtil | |
| 137 | + .getAdapter(ThinkraceUtil.ACTIVE.PHOTOGRAPH_ACTIVE) | |
| 138 | + .sendCommand(params) | |
| 139 | + .listenAsk(); | |
| 140 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 141 | + } | |
| 142 | + | |
| 143 | + @Override | |
| 144 | + public Result<?> heartCheck(JSONObject params) { | |
| 145 | + boolean result = ThinkraceUtil | |
| 146 | + .getAdapter(ThinkraceUtil.ACTIVE.HEART_CHECK_ACTIVE) | |
| 147 | + .sendCommand(params) | |
| 148 | + .listenAsk(); | |
| 149 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 150 | + } | |
| 151 | + | |
| 152 | + @Override | |
| 153 | + public Result<?> settingContactBook(JSONObject params) { | |
| 154 | + boolean result = ThinkraceUtil | |
| 155 | + .getAdapter(ThinkraceUtil.ACTIVE.CONTACT_BOOK_ACTIVE) | |
| 156 | + .sendCommand(params) | |
| 157 | + .listenAsk(); | |
| 158 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 159 | + } | |
| 160 | + | |
| 161 | + @Override | |
| 162 | + public Result<?> sendDelContactBookSingle(JSONObject params) { | |
| 163 | + boolean result = ThinkraceUtil | |
| 164 | + .getAdapter(ThinkraceUtil.ACTIVE.DEL_CONTACT_BOOK_ACTIVE) | |
| 165 | + .sendCommand(params) | |
| 166 | + .listenAsk(); | |
| 167 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 168 | + } | |
| 169 | + | |
| 170 | + @Override | |
| 171 | + public Result<?> settingWhiteButton(JSONObject params) { | |
| 172 | + boolean result = ThinkraceUtil | |
| 173 | + .getAdapter(ThinkraceUtil.ACTIVE.WHITE_BUTTON_ACTIVE) | |
| 174 | + .sendCommand(params) | |
| 175 | + .listenAsk(); | |
| 176 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 177 | + } | |
| 178 | + | |
| 179 | + @Override | |
| 180 | + public Result<?> sendFindClient(JSONObject params) { | |
| 181 | + boolean result = ThinkraceUtil | |
| 182 | + .getAdapter(ThinkraceUtil.ACTIVE.FIND_CLIENT_ACTIVE) | |
| 183 | + .sendCommand(params) | |
| 184 | + .listenAsk(); | |
| 185 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 186 | + } | |
| 187 | + | |
| 188 | + @Override | |
| 189 | + public Result<?> sendMotionCheck(JSONObject params) { | |
| 190 | + boolean result = ThinkraceUtil | |
| 191 | + .getAdapter(ThinkraceUtil.ACTIVE.MOTION_CHECK_ACTIVE) | |
| 192 | + .sendCommand(params) | |
| 193 | + .listenAsk(); | |
| 194 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 195 | + } | |
| 196 | + | |
| 197 | + @Override | |
| 198 | + public Result<?> sendSmsCommand(JSONObject params) { | |
| 199 | + boolean result = ThinkraceUtil | |
| 200 | + .getAdapter(ThinkraceUtil.ACTIVE.SMS_COMMAND_ACTIVE) | |
| 201 | + .sendCommand(params) | |
| 202 | + .listenAsk(); | |
| 203 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 204 | + } | |
| 205 | + | |
| 206 | + @Override | |
| 207 | + public Result<?> sendHourlySystem(JSONObject params) { | |
| 208 | + boolean result = ThinkraceUtil | |
| 209 | + .getAdapter(ThinkraceUtil.ACTIVE.HOURLY_SYSTEM_ACTIVE) | |
| 210 | + .sendCommand(params) | |
| 211 | + .listenAsk(); | |
| 212 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 213 | + } | |
| 214 | + | |
| 215 | + @Override | |
| 216 | + public Result<?> sendClientBindContact(JSONObject params) { | |
| 217 | + boolean result = ThinkraceUtil | |
| 218 | + .getAdapter(ThinkraceUtil.ACTIVE.CLIENT_BIND_CONTACT_ACTIVE) | |
| 219 | + .sendCommand(params) | |
| 220 | + .listenAsk(); | |
| 221 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 222 | + } | |
| 223 | + | |
| 224 | + @Override | |
| 225 | + public Result<?> sendHeartRateCheck(JSONObject params) { | |
| 226 | + boolean result = ThinkraceUtil | |
| 227 | + .getAdapter(ThinkraceUtil.ACTIVE.HEART_RATE_CHECK_ACTIVE) | |
| 228 | + .sendCommand(params) | |
| 229 | + .listenAsk(); | |
| 230 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 231 | + } | |
| 232 | + | |
| 233 | + @Override | |
| 234 | + public Result<?> sendBloodPressureCheck(JSONObject params) { | |
| 235 | + boolean result = ThinkraceUtil | |
| 236 | + .getAdapter(ThinkraceUtil.ACTIVE.BLOOD_PRESSURE_CHECK_ACTIVE) | |
| 237 | + .sendCommand(params) | |
| 238 | + .listenAsk(); | |
| 239 | + return Result.OK((result ? "设备成功响应" : "设备无响应")); | |
| 50 | 240 | } |
| 51 | 241 | } | ... | ... |