增加读取门磁、卫浴按钮
This commit is contained in:
@@ -12,6 +12,8 @@ export const COMMANDS = {
|
||||
ENABLE_BLE_LOG: 0x0C,
|
||||
// 设置门磁/卫浴事件触发/释放参数
|
||||
SET_DOOR_BATH_EVENT: 0x16,
|
||||
// 读取门磁/卫浴事件触发/释放参数
|
||||
READ_DOOR_BATH_EVENT: 0x17,
|
||||
RADAR_STATUS: 0x11,
|
||||
TEST_KEYS: 0x13,
|
||||
};
|
||||
@@ -225,6 +227,17 @@ export function buildSetDoorBathEvent(opts = {}, options = {}) {
|
||||
return buildCommand(COMMANDS.SET_DOOR_BATH_EVENT, payload, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造:读取门磁/卫浴事件触发/释放参数 (Frame_Type=0x17)
|
||||
* PC -> MCU: P0 = 0x01 (读请求)
|
||||
* 返回:MCU -> PC 帧中 P0..P7 为四个 16-bit 小端延时值(单位:秒)
|
||||
* @param {{frame?:number, framNum?:number, crcType?:('CCITT'|'MODBUS'), head?:number[]}} [options]
|
||||
*/
|
||||
export function buildReadDoorBathEvent(options = {}) {
|
||||
// 按文档,发送 P0 = 0x01 表示读请求
|
||||
return buildCommand(COMMANDS.READ_DOOR_BATH_EVENT, [0x01], options);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证十六进制字符串包并计算/写入 CRC(默认 MODBUS),返回完整包与CRC值
|
||||
* @param {string} hexStr 如 'CC C0 0C 00 00 00 01 00 02 00 0C 08' 或连续hex
|
||||
|
||||
Reference in New Issue
Block a user