Skip to content

Commit

Permalink
correct functiopn name frm prev commit
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Nov 25, 2024
1 parent 8c0bafc commit ec7ae26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/driver/drv_tuyaMCU.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ tuyaMCUMapping_t* TuyaMCU_MapIDToChannel(int dpId, int dpType, int channel, int

// now you can detect TuyaMCU faults with event handler
// addChangeHandler MissedHeartbeats > 4 setChannel 0 1
void TuyaMCU_SetHeartbeatTimer(int v) {
void TuyaMCU_SetHeartbeatCounter(int v) {
EventHandlers_ProcessVariableChange_Integer(CMD_EVENT_MISSEDHEARTBEATS, heartbeat_counter, v);
heartbeat_counter = v;
}
Expand Down Expand Up @@ -1771,7 +1771,7 @@ void TuyaMCU_ProcessIncoming(const byte* data, int len) {
{
case TUYA_CMD_HEARTBEAT:
heartbeat_valid = true;
TuyaMCU_SetHeartbeatTimer(0);
TuyaMCU_SetHeartbeatCounter(0);
break;
case TUYA_CMD_MCU_CONF:
working_mode_valid = true;
Expand Down Expand Up @@ -2069,7 +2069,7 @@ void TuyaMCU_RunStateMachine_V3() {
/* Generate heartbeat to keep communication alove */
TuyaMCU_SendCommandWithData(TUYA_CMD_HEARTBEAT, NULL, 0);
heartbeat_timer = 3;
TuyaMCU_SetHeartbeatTimer(heartbeat_counter+1);
TuyaMCU_SetHeartbeatCounter(heartbeat_counter+1);
if (heartbeat_counter >= 4)
{
/* unanswerred heartbeats -> lost communication */
Expand Down

0 comments on commit ec7ae26

Please sign in to comment.