Skip to content

Commit

Permalink
Added missing implementation of CMD_SET_LW_STATUS_INTERVAL
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed Aug 29, 2024
1 parent 7d1d206 commit f26b05f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions BresserWeatherSensorLWCfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@
//--- Select Board ---
#if defined(ARDUINO_DFROBOT_FIREBEETLE_ESP32)
// Use pinning for LoRaWAN Node
//#define LORAWAN_NODE
#define LORAWAN_NODE

// Use pinning for Firebeetle Cover LoRa
#define DFROBOT_COVER_LORA
//#define DFROBOT_COVER_LORA
#endif

// PowerFeather specific configuration
Expand Down
11 changes: 11 additions & 0 deletions BresserWeatherSensorLWCmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
// 20240723 Extracted from BresserWeatherSensorLW.ino
// 20240729 Added PowerFeather specific status information
// 20240818 Replaced delay() with light sleep for ESP32
// 20240829 Added missing implementation of CMD_SET_LW_STATUS_INTERVAL
//
// ToDo:
// -
Expand Down Expand Up @@ -134,6 +135,16 @@ uint8_t decodeDownlink(uint8_t port, uint8_t *payload, size_t size)
return 0;
}

if ((port == CMD_SET_LW_STATUS_INTERVAL) && (size == 1))
{
prefs.lw_stat_interval = payload[0];
log_d("Set lw_stat_interval: %u", prefs.lw_stat_interval);
preferences.begin("BWS-LW", false);
preferences.putUChar("lw_stat_int", prefs.lw_stat_interval);
preferences.end();
return 0;
}

if ((port == CMD_GET_LW_CONFIG) && (payload[0] == 0x00) && (size == 1))
{
log_d("Get config");
Expand Down

0 comments on commit f26b05f

Please sign in to comment.