Skip to content

Commit

Permalink
Only save Client ID and Rolling code when sync is succeeds.
Browse files Browse the repository at this point in the history
  • Loading branch information
GelidusResearch committed Sep 10, 2024
1 parent 80e11e1 commit 4217635
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/secplus_gdo/secplus_gdo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ static void gdo_event_handler(const gdo_status_t *status, gdo_cb_event_t event,
if (status->protocol == GDO_PROTOCOL_SEC_PLUS_V2) {
ESP_LOGI(TAG, "Client ID: %" PRIu32 ", Rolling code: %" PRIu32,
status->client_id, status->rolling_code);
gdo->set_client_id(status->client_id);
gdo->set_rolling_code(status->rolling_code);
if (status->synced) {
// Save the last successful ClientID rolling code value to NVS for use
// on reboot
gdo->set_client_id(status->client_id);
gdo->set_rolling_code(status->rolling_code);
}
}

if (!status->synced) {
Expand Down

0 comments on commit 4217635

Please sign in to comment.