Skip to content

Commit

Permalink
Improved logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrolds committed Nov 30, 2024
1 parent 528abc2 commit 5f44b89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion code/nrf-connect/samples/ble/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ CONFIG_PRST_BLE_ENCODING_BTHOME_V2=y
# 10m
# CONFIG_PRST_SLEEP_DURATION_MSEC=600000
# 30m
CONFIG_PRST_SLEEP_DURATION_MSEC=1800000
# CONFIG_PRST_SLEEP_DURATION_MSEC=1800000
# 60m
CONFIG_PRST_SLEEP_DURATION_MSEC=3600000

# prstlib config - ser all options in prstlib/Kconfig.
# CONFIG_PRSTLIB_LOG_LEVEL_DBG=y
12 changes: 11 additions & 1 deletion code/nrf-connect/samples/ble/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ static int prst_loop(prst_sensors_t *sensors) {
int main(void) {
__ASSERT(!prst_init(), "Error in prst_init()");
prst_led_flash(2);
LOG_INF("Sleep duration: %d\n", CONFIG_PRST_SLEEP_DURATION_MSEC);

if (IS_ENABLED(CONFIG_PRST_BLE_ENCODING_BTHOME_V2)) {
LOG_INF("Payload Encoding: BTHOME_V2");
} else if (IS_ENABLED(CONFIG_PRST_BLE_ENCODING_BTHOME_V1)) {
LOG_INF("Payload Encoding: BTHOME_V1");
} else if (IS_ENABLED(CONFIG_PRST_BLE_ENCODING_BPARASITE_V2)) {
LOG_INF("Payload Encoding: BPARASITE_V2");
}

LOG_INF("Sleep duration: %d", CONFIG_PRST_SLEEP_DURATION_MSEC);

prst_sensors_t sensors;
while (true) {
__ASSERT(!prst_loop(&sensors), "Error in prst_loop()");
Expand Down

0 comments on commit 5f44b89

Please sign in to comment.