Skip to content

Commit 0948789

Browse files
committed
softdevice: Update softdevice to latest
Taken from dragoon build 2328, sha de3e0c98df9899a7b41aeaf4fb4b6df8dde33be5. Signed-off-by: Herman Berget <[email protected]>
1 parent b6d026a commit 0948789

11 files changed

+6609
-6805
lines changed

include/s115/ble_gap.h

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ enum BLE_GAP_SVCS
9494
SD_BLE_GAP_CONN_SEC_GET = BLE_GAP_SVC_BASE + 28, /**< Obtain connection security level. */
9595
SD_BLE_GAP_PHY_UPDATE = BLE_GAP_SVC_BASE + 33, /**< Initiate or respond to a PHY Update Procedure. */
9696
SD_BLE_GAP_NEXT_CONN_EVT_COUNTER_GET = BLE_GAP_SVC_BASE + 36, /**< Get the next connection event counter. */
97+
SD_BLE_GAP_RSSI_GET = BLE_GAP_SVC_BASE + 38, /**< Get the last RSSI sample. */
98+
SD_BLE_GAP_RSSI_START = BLE_GAP_SVC_BASE + 39, /**< Start reporting of changes in RSSI. */
99+
SD_BLE_GAP_RSSI_STOP = BLE_GAP_SVC_BASE + 40, /**< Stop reporting of changes in RSSI. */
97100
};
98101

99102
/**@brief GAP Event IDs.
@@ -113,6 +116,7 @@ enum BLE_GAP_EVTS
113116
BLE_GAP_EVT_AUTH_STATUS = BLE_GAP_EVT_BASE + 9, /**< Authentication procedure completed with status. \n See @ref ble_gap_evt_auth_status_t. */
114117
BLE_GAP_EVT_CONN_SEC_UPDATE = BLE_GAP_EVT_BASE + 10, /**< Connection security updated. \n See @ref ble_gap_evt_conn_sec_update_t. */
115118
BLE_GAP_EVT_TIMEOUT = BLE_GAP_EVT_BASE + 11, /**< Timeout expired. \n See @ref ble_gap_evt_timeout_t. */
119+
BLE_GAP_EVT_RSSI_CHANGED = BLE_GAP_EVT_BASE + 12, /**< RSSI report. \n See @ref ble_gap_evt_rssi_changed_t. */
116120
BLE_GAP_EVT_SCAN_REQ_REPORT = BLE_GAP_EVT_BASE + 16, /**< Scan request report. \n See @ref ble_gap_evt_scan_req_report_t. */
117121
BLE_GAP_EVT_PHY_UPDATE_REQUEST = BLE_GAP_EVT_BASE + 17, /**< PHY Update Request. \n Reply with @ref sd_ble_gap_phy_update. \n See @ref ble_gap_evt_phy_update_request_t. */
118122
BLE_GAP_EVT_PHY_UPDATE = BLE_GAP_EVT_BASE + 18, /**< PHY Update Procedure is complete. \n See @ref ble_gap_evt_phy_update_t. */
@@ -409,7 +413,6 @@ enum BLE_GAP_TX_POWER_ROLES
409413

410414
/**@} */
411415

412-
413416
/**@defgroup BLE_GAP_CP_LIMITS GAP Connection Parameters Limits
414417
* @{
415418
*/
@@ -434,6 +437,9 @@ enum BLE_GAP_TX_POWER_ROLES
434437
/**@} */
435438

436439

440+
/**@brief Disable RSSI events for connections */
441+
#define BLE_GAP_RSSI_THRESHOLD_INVALID 0xFF
442+
437443
/**@defgroup BLE_GAP_PHYS GAP PHYs
438444
* @{ */
439445
#define BLE_GAP_PHY_AUTO 0x00 /**< Automatic PHY selection. Refer @ref sd_ble_gap_phy_update for more information.*/
@@ -1008,6 +1014,14 @@ typedef struct
10081014
} ble_gap_evt_timeout_t;
10091015

10101016

1017+
/**@brief Event structure for @ref BLE_GAP_EVT_RSSI_CHANGED. */
1018+
typedef struct
1019+
{
1020+
int8_t rssi; /**< Received Signal Strength Indication in dBm.
1021+
@note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement. */
1022+
uint8_t ch_index; /**< Data Channel Index on which the Signal Strength is measured (0-36). */
1023+
} ble_gap_evt_rssi_changed_t;
1024+
10111025
/**@brief Event structure for @ref BLE_GAP_EVT_ADV_SET_TERMINATED */
10121026
typedef struct
10131027
{
@@ -1045,6 +1059,7 @@ typedef struct
10451059
ble_gap_evt_auth_status_t auth_status; /**< Authentication Status Event Parameters. */
10461060
ble_gap_evt_conn_sec_update_t conn_sec_update; /**< Connection Security Update Event Parameters. */
10471061
ble_gap_evt_timeout_t timeout; /**< Timeout Event Parameters. */
1062+
ble_gap_evt_rssi_changed_t rssi_changed; /**< RSSI Event Parameters. */
10481063
ble_gap_evt_adv_set_terminated_t adv_set_terminated; /**< Advertising Set Terminated Event Parameters. */
10491064
ble_gap_evt_scan_req_report_t scan_req_report; /**< Scan Request Report Parameters. */
10501065
ble_gap_evt_phy_update_request_t phy_update_request; /**< PHY Update Request Event Parameters. */
@@ -1554,7 +1569,6 @@ SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(uint8_t adv_handle));
15541569
*/
15551570
SVCALL(SD_BLE_GAP_CONN_PARAM_UPDATE, uint32_t, sd_ble_gap_conn_param_update(uint16_t conn_handle, ble_gap_conn_params_t const *p_conn_params));
15561571

1557-
15581572
/**@brief Disconnect (GAP Link Termination).
15591573
*
15601574
* @details This call initiates the disconnection procedure, and its completion will be communicated to the application
@@ -1943,6 +1957,73 @@ SVCALL(SD_BLE_GAP_SEC_INFO_REPLY, uint32_t, sd_ble_gap_sec_info_reply(uint16_t c
19431957
SVCALL(SD_BLE_GAP_CONN_SEC_GET, uint32_t, sd_ble_gap_conn_sec_get(uint16_t conn_handle, ble_gap_conn_sec_t *p_conn_sec));
19441958

19451959

1960+
/**@brief Start reporting the received signal strength to the application.
1961+
*
1962+
* A new event is reported whenever the RSSI value changes, until @ref sd_ble_gap_rssi_stop is called.
1963+
*
1964+
* @events
1965+
* @event{@ref BLE_GAP_EVT_RSSI_CHANGED, New RSSI data available. How often the event is generated is
1966+
* dependent on the settings of the <code>threshold_dbm</code>
1967+
* and <code>skip_count</code> input parameters.}
1968+
* @endevents
1969+
*
1970+
* @mscs
1971+
* @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}
1972+
* @mmsc{@ref BLE_GAP_RSSI_FILT_MSC}
1973+
* @endmscs
1974+
*
1975+
* @param[in] conn_handle Connection handle.
1976+
* @param[in] threshold_dbm Minimum change in dBm before triggering the @ref BLE_GAP_EVT_RSSI_CHANGED event. Events are disabled if threshold_dbm equals @ref BLE_GAP_RSSI_THRESHOLD_INVALID.
1977+
* @param[in] skip_count Number of RSSI samples with a change of threshold_dbm or more before sending a new @ref BLE_GAP_EVT_RSSI_CHANGED event.
1978+
*
1979+
* @retval ::NRF_SUCCESS Successfully activated RSSI reporting.
1980+
* @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is already ongoing.
1981+
* @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
1982+
*/
1983+
SVCALL(SD_BLE_GAP_RSSI_START, uint32_t, sd_ble_gap_rssi_start(uint16_t conn_handle, uint8_t threshold_dbm, uint8_t skip_count));
1984+
1985+
1986+
/**@brief Stop reporting the received signal strength.
1987+
*
1988+
* @note An RSSI change detected before the call but not yet received by the application
1989+
* may be reported after @ref sd_ble_gap_rssi_stop has been called.
1990+
*
1991+
* @mscs
1992+
* @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}
1993+
* @mmsc{@ref BLE_GAP_RSSI_FILT_MSC}
1994+
* @endmscs
1995+
*
1996+
* @param[in] conn_handle Connection handle.
1997+
*
1998+
* @retval ::NRF_SUCCESS Successfully deactivated RSSI reporting.
1999+
* @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing.
2000+
* @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
2001+
*/
2002+
SVCALL(SD_BLE_GAP_RSSI_STOP, uint32_t, sd_ble_gap_rssi_stop(uint16_t conn_handle));
2003+
2004+
2005+
/**@brief Get the received signal strength for the last connection event.
2006+
*
2007+
* @ref sd_ble_gap_rssi_start must be called to start reporting RSSI before using this function. @ref NRF_ERROR_NOT_FOUND
2008+
* will be returned until RSSI was sampled for the first time after calling @ref sd_ble_gap_rssi_start.
2009+
* @note ERRATA-153 and ERRATA-225 require the rssi sample to be compensated based on a temperature measurement.
2010+
* @mscs
2011+
* @mmsc{@ref BLE_GAP_CENTRAL_RSSI_READ_MSC}
2012+
* @endmscs
2013+
*
2014+
* @param[in] conn_handle Connection handle.
2015+
* @param[out] p_rssi Pointer to the location where the RSSI measurement shall be stored.
2016+
* @param[out] p_ch_index Pointer to the location where Channel Index for the RSSI measurement shall be stored.
2017+
*
2018+
* @retval ::NRF_SUCCESS Successfully read the RSSI.
2019+
* @retval ::NRF_ERROR_NOT_FOUND No sample is available.
2020+
* @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
2021+
* @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.
2022+
* @retval ::NRF_ERROR_INVALID_STATE RSSI reporting is not ongoing.
2023+
*/
2024+
SVCALL(SD_BLE_GAP_RSSI_GET, uint32_t, sd_ble_gap_rssi_get(uint16_t conn_handle, int8_t *p_rssi, uint8_t *p_ch_index));
2025+
2026+
19462027
/**@brief Initiate or respond to a PHY Update Procedure
19472028
*
19482029
* @details This function is used to initiate or respond to a PHY Update Procedure. It will always

0 commit comments

Comments
 (0)