diff --git a/nimble/host/services/tps/include/services/tps/ble_svc_tps.h b/nimble/host/services/tps/include/services/tps/ble_svc_tps.h index c1797ae55..ec4cd790a 100644 --- a/nimble/host/services/tps/include/services/tps/ble_svc_tps.h +++ b/nimble/host/services/tps/include/services/tps/ble_svc_tps.h @@ -25,7 +25,7 @@ struct ble_hs_cfg; #define BLE_SVC_TPS_UUID16 0x1804 #define BLE_SVC_TPS_CHR_UUID16_TX_POWER_LEVEL 0x2a07 -int ble_svc_tps_init(struct ble_hs_cfg *cfg); +void ble_svc_tps_init(void); #endif diff --git a/nimble/host/services/tps/pkg.yml b/nimble/host/services/tps/pkg.yml index 45d85b6ec..17b2b8741 100644 --- a/nimble/host/services/tps/pkg.yml +++ b/nimble/host/services/tps/pkg.yml @@ -30,3 +30,5 @@ pkg.keywords: pkg.deps: - net/nimble/host +pkg.init_function: ble_svc_tps_init +pkg.init_stage: 3 diff --git a/nimble/host/services/tps/src/ble_svc_tps.c b/nimble/host/services/tps/src/ble_svc_tps.c index 3f241b01c..2351a795e 100644 --- a/nimble/host/services/tps/src/ble_svc_tps.c +++ b/nimble/host/services/tps/src/ble_svc_tps.c @@ -21,7 +21,6 @@ #include #include "host/ble_hs.h" #include "services/tps/ble_svc_tps.h" -#include "../../../src/ble_hci_priv.h" int8_t ble_svc_tps_tx_power_level; @@ -80,19 +79,14 @@ ble_svc_tps_access(uint16_t conn_handle, uint16_t attr_handle, /** * Initialize the TPS */ -int -ble_svc_tps_init(struct ble_hs_cfg *cfg) +void +ble_svc_tps_init(void) { int rc; + rc = ble_gatts_count_cfg(ble_svc_tps_defs, cfg); - if (rc != 0) { - return rc; - } + SYSINIT_PANIC_ASSERT(rc == 0); rc = ble_gatts_add_svcs(ble_svc_tps_defs); - if (rc != 0) { - return rc; - } - - return 0; + SYSINIT_PANIC_ASSERT(rc == 0); }