Skip to content

Commit

Permalink
Merge pull request #223 from ryanrolds/rolds/community_sensor_production
Browse files Browse the repository at this point in the history
  • Loading branch information
rbaron authored Feb 3, 2025
2 parents 8608cb6 + 814f9a4 commit dbde189
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions code/nrf-connect/samples/ble/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ static int prst_init() {
return 0;
}

static void dump_config() {
#if IS_ENABLED(CONFIG_PRST_BLE_ENCODING_BTHOME_V2)
LOG_INF("Payload encoding: BTHOME_V2");
#elif IS_ENABLED(CONFIG_PRST_BLE_ENCODING_BTHOME_V1)
LOG_INF("Payload encoding: BTHOME_V1");
#elif IS_ENABLED(CONFIG_PRST_BLE_ENCODING_BPARASITE_V2)
LOG_INF("Payload encoding: BPARASITE_V2");
#else
#error "Unhandled CONFIG_PRST_BLE_ENCODING_ choice in dump_config()"
#endif

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

static int prst_loop(prst_sensors_t *sensors) {
RET_IF_ERR(prst_sensors_read_all(sensors));
RET_IF_ERR(prst_ble_adv_set_data(sensors));
Expand All @@ -34,6 +48,9 @@ static int prst_loop(prst_sensors_t *sensors) {
int main(void) {
__ASSERT(!prst_init(), "Error in prst_init()");
prst_led_flash(2);

dump_config();

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

0 comments on commit dbde189

Please sign in to comment.