mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-17 22:49:55 +00:00
BLE TPS service - use sysinit.
X-Original-Commit: 58d6bcd13c5e57741be1db292de012b5c92daa7a
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -30,3 +30,5 @@ pkg.keywords:
|
||||
pkg.deps:
|
||||
- net/nimble/host
|
||||
|
||||
pkg.init_function: ble_svc_tps_init
|
||||
pkg.init_stage: 3
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <string.h>
|
||||
#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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user