Skip to content

Commit

Permalink
Added lightning statistics reset, renamed CMD_RESET_RAINGAUGE to CMD_…
Browse files Browse the repository at this point in the history
…RESET_WS_POSTPROC (#73)
  • Loading branch information
matthias-bs authored Jun 14, 2024
1 parent 9a64468 commit b290224
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 165 deletions.
14 changes: 6 additions & 8 deletions BresserWeatherSensorLWCmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
// 20240606 Added CMD_GET_STATUS_INTERVAL/CMD_SET_STATUS_INTERVAL
// 20240608 Added CMD_GET_LW_STATUS
// 20240609 Refactored command encoding
// 20240614 Renamed CMD_RESET_RAINGAUGE to CMD_RESET_WS_POSTPROC
//
// ToDo:
// -
Expand Down Expand Up @@ -260,19 +261,16 @@

// Uplink: n.a.

// CMD_RESET_RAINGAUGE
// --------------------
// Port: CMD_RESET_RAINGAUGE
#define CMD_RESET_RAINGAUGE 0xC3
// CMD_RESET_WS_POSTPROC
// ----------------------
// Port: CMD_RESET_WS_POSTPROC
#define CMD_RESET_WS_POSTPROC 0xC3

// Downlink (command):
// byte0: flags[7:0] (optional)
// byte0: flags[ 7: 0]

// Uplink: n.a.

// Reset Lightning???
// -------------------

// CMD_GET_SENSORS_INC
// --------------------
// Note: Get sensors include list (0...12 IDs)
Expand Down
9 changes: 5 additions & 4 deletions scripts/downlink_formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// port = CMD_SET_SLEEP_INTERVAL_LONG, {"sleep_interval_long": <interval_in_seconds>}
// port = CMD_GET_DATETIME, {"cmd": "CMD_GET_DATETIME"} / payload = 0x00
// port = CMD_SET_DATETIME, {"epoch": <epoch>}
// port = CMD_RESET_RAINGAUGE, {"reset_flags": <flags>}
// port = CMD_RESET_WS_POSTPROC, {"reset_flags": <flags>}
// port = CMD_GET_LW_CONFIG, {"cmd": "CMD_GET_LW_CONFIG"} / payload = 0x00
// port = CMD_GET_WS_TIMEOUT, {"cmd": "CMD_GET_WS_TIMEOUT" / payload = 0x00
// port = CMD_SET_WS_TIMEOUT, {"ws_timeout": <ws_timeout>}
Expand Down Expand Up @@ -127,6 +127,7 @@
// 20240607 Added CMD_GET_STATUS_INTERVAL/CMD_SET_STATUS_INTERVAL
// 20240608 Added CMD_GET_LW_STATUS
// 20240609 Refactored command encoding
// 20240614 Renamed CMD_RESET_RAINGAUGE to CMD_RESET_WS_POSTPROC
//
// ToDo:
// -
Expand All @@ -147,7 +148,7 @@ const CMD_GET_APP_PAYLOAD_CFG = 0x46;
const CMD_SET_APP_PAYLOAD_CFG = 0x47;
const CMD_GET_WS_TIMEOUT = 0xC0;
const CMD_SET_WS_TIMEOUT = 0xC1;
const CMD_RESET_RAINGAUGE = 0xC3;
const CMD_RESET_WS_POSTPROC = 0xC3;
const CMD_GET_SENSORS_INC = 0xC6;
const CMD_SET_SENSORS_INC = 0xC7;
const CMD_GET_SENSORS_EXC = 0xC8;
Expand Down Expand Up @@ -424,7 +425,7 @@ function encodeDownlink(input) {
}
return {
bytes: [value],
fPort: CMD_RESET_RAINGAUGE,
fPort: CMD_RESET_WS_POSTPROC,
warnings: [],
errors: []
};
Expand Down Expand Up @@ -609,7 +610,7 @@ function decodeDownlink(input) {
ws_timeout: uint8(input.bytes)
}
};
case CMD_RESET_RAINGAUGE:
case CMD_RESET_WS_POSTPROC:
return {
data: {
reset_flags: "0x" + uint8(input.bytes).toString(16)
Expand Down
2 changes: 1 addition & 1 deletion scripts/uplink_formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// port = CMD_SET_SLEEP_INTERVAL_LONG, {"sleep_interval_long": <interval_in_seconds>}
// port = CMD_GET_DATETIME, {"cmd": "CMD_GET_DATETIME"} / payload = 0x00
// port = CMD_SET_DATETIME, {"epoch": <epoch>}
// port = CMD_RESET_RAINGAUGE, {"reset_flags": <flags>}
// port = CMD_RESET_WS_POSTPROC, {"reset_flags": <flags>}
// port = CMD_GET_LW_CONFIG, {"cmd": "CMD_GET_LW_CONFIG"} / payload = 0x00
// port = CMD_GET_WS_TIMEOUT, {"cmd": "CMD_GET_WS_TIMEOUT" / payload = 0x00
// port = CMD_SET_WS_TIMEOUT, {"ws_timeout": <ws_timeout>}
Expand Down
Loading

0 comments on commit b290224

Please sign in to comment.