nRF Connect SDK Bare Metal API 2.0.99
Loading...
Searching...
No Matches
nrf_sdh_ble.h
1/*
2 * Copyright (c) 2024 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
15#ifndef NRF_SDH_BLE_H__
16#define NRF_SDH_BLE_H__
17
18#include <stdint.h>
19#include <ble.h>
20#include <bm/softdevice_handler/nrf_sdh.h>
21#include <zephyr/sys/iterable_sections.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
30#define NRF_SDH_BLE_EVT_BUF_SIZE BLE_EVT_LEN_MAX(CONFIG_NRF_SDH_BLE_GATT_MAX_MTU_SIZE)
31
35typedef void (*nrf_sdh_ble_evt_handler_t)(const ble_evt_t *ble_evt, void *context);
36
50
60#define NRF_SDH_BLE_OBSERVER(_observer, _handler, _ctx, _prio) \
61 PRIO_LEVEL_IS_VALID(_prio); \
62 static const TYPE_SECTION_ITERABLE(struct nrf_sdh_ble_evt_observer, _observer, \
63 nrf_sdh_ble_evt_observers, PRIO_LEVEL_ORD(_prio)) = { \
64 .handler = _handler, \
65 .context = _ctx, \
66 }
67
75int nrf_sdh_ble_enable(uint8_t conn_cfg_tag);
76
86const char *nrf_sdh_ble_evt_to_str(uint32_t evt);
87
96
108int nrf_sdh_ble_idx_get(uint16_t conn_handle);
109
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif /* NRF_SDH_BLE_H__ */
124
int nrf_sdh_ble_enable(uint8_t conn_cfg_tag)
Enable the SoftDevice Bluetooth stack.
int nrf_sdh_ble_idx_get(uint16_t conn_handle)
Get the assigned index for a connection handle.
uint16_t nrf_sdh_ble_conn_handle_get(int idx)
Get the connection handle for an assigned index.
void(* nrf_sdh_ble_evt_handler_t)(const ble_evt_t *ble_evt, void *context)
Bluetooth LE stack event handler.
Definition nrf_sdh_ble.h:35
uint32_t nrf_sdh_ble_sd_ram_usage_get(void)
Get the SoftDevice RAM usage.
const char * nrf_sdh_ble_evt_to_str(uint32_t evt)
Stringify a SoftDevice Bluetooth LE event.
nrf_sdh_ble_evt_handler_t handler
Bluetooth LE event handler.
Definition nrf_sdh_ble.h:44
void * context
A parameter to the event handler.
Definition nrf_sdh_ble.h:48
Bluetooth LE event observer.
Definition nrf_sdh_ble.h:40