修复一下问题:
A用户绑定IPC和门夹弹力绳,分享给B用户; A用户先进入门夹弹力绳页面,已唤醒玩具,B用户再进入页面 A用户退出页面下发休眠指令,B用户操作玩具,未提示操作成功/失败
This commit is contained in:
@@ -69,6 +69,9 @@ void userHandle(void)
|
||||
* ════════════════════════════════════════════════════════════════ */
|
||||
int8_t jbEventProcess(jb_event_info_t *info, jb_data_point_t *ctrl)
|
||||
{
|
||||
uint8_t other_cmd = 0;
|
||||
uint8_t got_power_off = 0;
|
||||
|
||||
if (!info || !ctrl)
|
||||
{
|
||||
return -1;
|
||||
@@ -89,6 +92,7 @@ int8_t jbEventProcess(jb_event_info_t *info, jb_data_point_t *ctrl)
|
||||
else
|
||||
{
|
||||
gDevData.power = 0;
|
||||
got_power_off = 1;
|
||||
// TODO: 关 — 执行动作
|
||||
}
|
||||
break;
|
||||
@@ -96,6 +100,7 @@ int8_t jbEventProcess(jb_event_info_t *info, jb_data_point_t *ctrl)
|
||||
/* ── DP1 自动模式 (enum) ── */
|
||||
case DP_ID_PLAY_MODE:
|
||||
gDevData.play_mode = ctrl->play_mode;
|
||||
other_cmd = 1;
|
||||
switch (ctrl->play_mode)
|
||||
{
|
||||
case PLAY_MODE_0: /* 停止复位 */
|
||||
@@ -127,6 +132,7 @@ int8_t jbEventProcess(jb_event_info_t *info, jb_data_point_t *ctrl)
|
||||
/* ── DP2 手动模式 (raw) ── */
|
||||
case DP_ID_HAND_MODE:
|
||||
memcpy(gDevData.hand_mode, ctrl->hand_mode, 2);
|
||||
other_cmd = 1;
|
||||
/* 薄适配:通知业务层;03=停,00=空闲 */
|
||||
{
|
||||
extern void usr_dp_hand_write(uint8_t cmd);
|
||||
@@ -136,6 +142,7 @@ int8_t jbEventProcess(jb_event_info_t *info, jb_data_point_t *ctrl)
|
||||
|
||||
/* ── DP3 绳索校准 (bool) ── */
|
||||
case DP_ID_CALIBRATION:
|
||||
other_cmd = 1;
|
||||
if (ctrl->calibration)
|
||||
{
|
||||
gDevData.calibration = 1;
|
||||
@@ -151,30 +158,35 @@ int8_t jbEventProcess(jb_event_info_t *info, jb_data_point_t *ctrl)
|
||||
/* ── DP4 绳索圈数 (uint8) ── */
|
||||
case DP_ID_NUMBERTURNS:
|
||||
gDevData.numberturns = ctrl->numberturns;
|
||||
other_cmd = 1;
|
||||
// TODO: 根据 ctrl->numberturns 执行动作
|
||||
break;
|
||||
|
||||
/* ── DP8 勿扰模式开关 (raw) ── */
|
||||
case DP_ID_NO_DISTURB_ENABLE:
|
||||
memcpy(gDevData.no_disturb_enable, ctrl->no_disturb_enable, 13);
|
||||
other_cmd = 1;
|
||||
// TODO: 根据 gDevData.no_disturb_enable 执行动作 (长度 13 字节)
|
||||
break;
|
||||
|
||||
/* ── DP9 预留DP1 (uint32) ── */
|
||||
case DP_ID_RESERVA_DP1:
|
||||
gDevData.reserva_dp1 = ctrl->reserva_dp1;
|
||||
other_cmd = 1;
|
||||
// TODO: 根据 ctrl->reserva_dp1 执行动作
|
||||
break;
|
||||
|
||||
/* ── DP10 预留DP2 (uint32) ── */
|
||||
case DP_ID_RESERVA_DP2:
|
||||
gDevData.reserva_dp2 = ctrl->reserva_dp2;
|
||||
other_cmd = 1;
|
||||
// TODO: 根据 ctrl->reserva_dp2 执行动作
|
||||
break;
|
||||
|
||||
/* ── DP11 预留DP3 (uint32) ── */
|
||||
case DP_ID_RESERVA_DP3:
|
||||
gDevData.reserva_dp3 = ctrl->reserva_dp3;
|
||||
other_cmd = 1;
|
||||
// TODO: 根据 ctrl->reserva_dp3 执行动作
|
||||
break;
|
||||
|
||||
@@ -182,6 +194,13 @@ int8_t jbEventProcess(jb_event_info_t *info, jb_data_point_t *ctrl)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* 软关后其它控制 DP 可唤醒;与关机 DP 同帧则关机优先,避免关完立刻被拉开 */
|
||||
if (other_cmd && !got_power_off)
|
||||
{
|
||||
extern void usr_dp_app_cmd(void);
|
||||
usr_dp_app_cmd();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user