Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/nrf-bm/libraries/nrf_sdh.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _lib_nrf_sdh:

SoftDevice handler
##################

The SoftDevice handler is a library that handles SoftDevice initialization tasks, and pulls and dispatches the SoftDevice events to registered components.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good with more skin on the bone, though I guess that can be added later as well.

21 changes: 20 additions & 1 deletion doc/nrf-bm/release_notes/release_notes_changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,26 @@ No changes since the latest nRF Connect SDK Bare Metal release.
SoftDevice Handler
==================

No changes since the latest nRF Connect SDK Bare Metal release.
* Added:

* The :option:`NRF_SDH_SOC_RAND_SEED` Kconfig option to control whether to automatically respond to SoftDevice random seed requests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The :option:`NRF_SDH_SOC_RAND_SEED` Kconfig option to control whether to automatically respond to SoftDevice random seed requests.
* The :kconfig:option:`CONFIG_NRF_SDH_SOC_RAND_SEED` Kconfig option to control whether to automatically respond to SoftDevice random seed requests.

* Priority levels for SoftDevice event observers: HIGHEST, HIGH, USER, USER_LOW, LOWEST.
* The :c:func:`nrf_sdh_ble_evt_tostr` function to stringify a BLE event.
* The :c:func:`nrf_sdh_soc_evt_tostr` function to stringify a SoC event.

* Changed:

* The return type of the :c:type:`nrf_sdh_state_evt_handler_t` event handler to ``int``.

* Removed:

* The ``NRF_SDH_BLE`` Kconfig option.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be like this:

Suggested change
* The ``NRF_SDH_BLE`` Kconfig option.
* The ``CONFIG_NRF_SDH_BLE`` Kconfig option.

* The ``NRF_SDH_STATE_REQ_OBSERVER`` macro and relative data types.
Register a state event observer and return non-zero to ``NRF_SDH_STATE_EVT_ENABLE_PREPARE``
or ``NRF_SDH_STATE_EVT_DISABLE_PREPARE`` to abort state changes instead.
* The ``nrf_sdh_ble_app_ram_start_get`` function.
* The ``nrf_sdh_request_continue`` function.
* The ``nrf_sdh_is_enabled`` function.

Boards
======
Expand Down
8 changes: 1 addition & 7 deletions include/ble_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,12 @@
extern "C" {
#endif

/**
* @brief Advertising module BLE event observer priority.
*/
#define BLE_ADV_BLE_OBSERVER_PRIO 0

/**
* @brief Declare an instance of a BLE advertising library.
*/
#define BLE_ADV_DEF(instance) \
static struct ble_adv instance; \
NRF_SDH_BLE_OBSERVER(ble_adv_##instance, ble_adv_on_ble_evt, &instance, \
BLE_ADV_BLE_OBSERVER_PRIO)
NRF_SDH_BLE_OBSERVER(ble_adv_##instance, ble_adv_on_ble_evt, &instance, HIGH)

/**
* @brief Advertising modes.
Expand Down
2 changes: 1 addition & 1 deletion include/ble_gq.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ extern "C" {
.data_pool = &CONCAT(_name, _heap), \
}; \
NRF_SDH_BLE_OBSERVER(CONCAT(_name, _obs), ble_gq_on_ble_evt, (void *)&_name, \
CONFIG_BLE_GQ_OBSERVER_PRIO)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remove config BLE_GQ_OBSERVER_PRIO if there is no more use for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done

HIGH)
Comment on lines 77 to +78
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NRF_SDH_BLE_OBSERVER(CONCAT(_name, _obs), ble_gq_on_ble_evt, (void *)&_name, \
CONFIG_BLE_GQ_OBSERVER_PRIO)
HIGH)
NRF_SDH_BLE_OBSERVER(CONCAT(_name, _obs), ble_gq_on_ble_evt, (void *)&_name, HIGH)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave the formatting as it is, we can do that work separately.


/**
* @brief Helper macro for initializing connection handle array. Used in @ref BLE_GQ_CUSTOM_DEF.
Expand Down
2 changes: 1 addition & 1 deletion include/ble_qwr.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extern "C" {
NRF_SDH_BLE_OBSERVER(_name ## _obs, \
ble_qwr_on_ble_evt, \
&_name, \
CONFIG_BLE_QWR_BLE_OBSERVER_PRIO)
HIGH)

/* Error code used by the module to reject prepare write requests on non-registered attributes. */
#define BLE_QWR_REJ_REQUEST_ERR_CODE BLE_GATT_STATUS_ATTERR_APP_BEGIN + 0
Expand Down
2 changes: 1 addition & 1 deletion include/bluetooth/services/ble_bas.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern "C" {
#define BLE_BAS_DEF(_name) \
static struct ble_bas _name; \
extern void ble_bas_on_ble_evt(const ble_evt_t *ble_evt, void *ctx); \
NRF_SDH_BLE_OBSERVER(_name##_obs, ble_bas_on_ble_evt, &_name, 0)
NRF_SDH_BLE_OBSERVER(_name##_obs, ble_bas_on_ble_evt, &_name, HIGH)

/**
* @brief Battery service event types.
Expand Down
10 changes: 1 addition & 9 deletions include/bluetooth/services/ble_cgms.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
* of the sensor. Session Run Time and Session Start Time can be used to convey timing
* information between the sensor and the collector. The Specific Ops Control Point
* is used to stop and start monitoring sessions, among other things.
*
* @note The application must register this module as BLE event observer using the
* NRF_SDH_BLE_OBSERVER macro. Example:
* @code
* struct ble_cgms instance;
* NRF_SDH_BLE_OBSERVER(anything, BLE_CGMS_BLE_OBSERVER_PRIO,
* ble_cgms_on_ble_evt, &instance);
* @endcode
*/

#ifndef BLE_CGMS_H__
Expand All @@ -51,7 +43,7 @@ extern "C" {
static struct ble_cgms _name; \
NRF_SDH_BLE_OBSERVER(_name ## _obs, \
ble_cgms_on_ble_evt, &_name, \
CONFIG_BLE_CGMS_BLE_OBSERVER_PRIO)
HIGH)

#define OPCODE_LENGTH 1
#define HANDLE_LENGTH 2
Expand Down
2 changes: 1 addition & 1 deletion include/bluetooth/services/ble_hids.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extern "C" {
sizeof(uint32_t) * BYTES_TO_WORDS(BLE_HIDS_LINK_CTX_SIZE), \
}, \
}; \
NRF_SDH_BLE_OBSERVER(_name##_obs, ble_hids_on_ble_evt, &_name, 0)
NRF_SDH_BLE_OBSERVER(_name##_obs, ble_hids_on_ble_evt, &_name, HIGH)

/**
* @brief HID boot keyboard input report maximum size, in bytes.
Expand Down
2 changes: 1 addition & 1 deletion include/bluetooth/services/ble_hrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C" {
#define BLE_HRS_DEF(_name) \
static struct ble_hrs _name; \
extern void ble_hrs_on_ble_evt(const ble_evt_t *ble_evt, void *ctx); \
NRF_SDH_BLE_OBSERVER(_name##_obs, ble_hrs_on_ble_evt, &_name, 0)
NRF_SDH_BLE_OBSERVER(_name##_obs, ble_hrs_on_ble_evt, &_name, HIGH)

/**
* @defgroup BLE_HRS_BODY_SENSOR_LOCATION HRS Body sensor location
Expand Down
4 changes: 1 addition & 3 deletions include/bluetooth/services/ble_lbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
extern "C" {
#endif

#define BLE_LBS_BLE_OBSERVER_PRIO 2

#define BLE_UUID_LBS_BASE { 0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, \
0xDE, 0xEF, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00 }
#define BLE_UUID_LBS_SERVICE 0x1523
Expand All @@ -39,7 +37,7 @@ struct ble_lbs;
#define BLE_LBS_DEF(_name) \
static struct ble_lbs _name; \
extern void ble_lbs_on_ble_evt(const ble_evt_t *ble_evt, void *lbs_instance); \
NRF_SDH_BLE_OBSERVER(_name ## _obs, ble_lbs_on_ble_evt, &_name, BLE_LBS_BLE_OBSERVER_PRIO)
NRF_SDH_BLE_OBSERVER(_name ## _obs, ble_lbs_on_ble_evt, &_name, HIGH)

enum ble_lbs_evt_type {
BLE_LBS_EVT_LED_WRITE,
Expand Down
2 changes: 1 addition & 1 deletion include/bluetooth/services/ble_nus.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void ble_nus_on_ble_evt(ble_evt_t const *ble_evt, void *context);
NRF_SDH_BLE_OBSERVER(_name ## _obs, \
ble_nus_on_ble_evt, \
&_name, \
0)
HIGH)

#define OPCODE_LENGTH 1
#define HANDLE_LENGTH 2
Expand Down
Loading