Skip to content

Commit

Permalink
softdevice_controller: rev 4377a9de2d55e0080ac70fe50718615b72dde608
Browse files Browse the repository at this point in the history
CHANGELOG.rst contains the list of changes.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
  • Loading branch information
hermabe authored and anangl committed Jul 9, 2024
1 parent 52eb102 commit 92ab351
Show file tree
Hide file tree
Showing 31 changed files with 284 additions and 135 deletions.
18 changes: 18 additions & 0 deletions softdevice_controller/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ Changelog

All the notable changes to this project are documented on this page.

Main branch
***********

Added
=====

* Support for the LE Set Path Loss Reporting Parameters and LE Set Path Loss Reporting Enable HCI commands. (DRGN-17376)

Changes
=======

* The ``sdc_coex_adv_mode_configure`` API has been deprecated as it is not applicable to any supported coexistence interfaces. (DRGN-20876).
* The ``sdc_hci_cmd_vs_coex_priority_config`` and ``sdc_hci_cmd_vs_coex_scan_mode_config`` vendor-specific HCI commands have been removed as they are not applicable to any supported coexistence interfaces. (DRGN-20876)

nRF Connect SDK v2.7.0
**********************

Expand Down Expand Up @@ -53,10 +67,14 @@ Changes
Using :file:`mpsl_ecb.h` is now recommended instead. (DRGN-21603)
* The ability to configure a periodic advertiser with subevents but without response slots has been removed.
This is due to an errata to the Bluetooth Core Specification v5.4 no longer allowing this configuration. (DRGN-22189)
* The vendor-specific Set Connection Event Trigger command can now be used with :kconfig:option:`CONFIG_BT_LL_SOFTDEVICE_PERIPHERAL`. (DRGN-22511)

Bug fixes
=========

* Fixed a rare assert that could happen when disabling a periodic advertising set with responses. (DRGN-22443)
* Fixed an issue where the length byte of the HCI packet could be incorrect.
This could happen when the packet contained an LE BIG Sync Established event or LE BIG Complete event with status not equal to success. (DRGN-22441)
* Fixed an issue where an assert could happen if an initiator ran for more than 2147 seconds before connecting (DRGN-22163).
* Fixed an extremely rare race condition where using :c:func:`sdc_soc_ecb_block_encrypt` from an ISR could lead to encryption failures. (DRGN-21603)
* Fixed an issue where the vendor-specific ISO Read TX Timestamp command returned a timestamp that was 41 µs too small (DRGN-21605).
Expand Down
2 changes: 2 additions & 0 deletions softdevice_controller/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ The libraries are available as soft-float, softfp-float, and hard-float builds f
+--------------------------------+-----------------+--------------+-----------+
| LE Power Control Request | X | X | X |
+--------------------------------+-----------------+--------------+-----------+
| LE Path Loss Monitoring | X | X | X |
+--------------------------------+-----------------+--------------+-----------+
| Periodic Advertising Sync | | | X |
| Transfer - Sender | | | |
+--------------------------------+-----------------+--------------+-----------+
Expand Down
33 changes: 14 additions & 19 deletions softdevice_controller/include/sdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ extern "C" {
*/

/** @brief Auxiliary defines, not to be used outside of this file. */
#define __MEM_MINIMAL_CENTRAL_LINK_SIZE 1043
#define __MEM_MINIMAL_PERIPHERAL_LINK_SIZE 1164
#define __MEM_MINIMAL_CENTRAL_LINK_SIZE 955
#define __MEM_MINIMAL_PERIPHERAL_LINK_SIZE 1076
#define __MEM_TX_BUFFER_OVERHEAD_SIZE 15
#define __MEM_RX_BUFFER_OVERHEAD_SIZE 14

Expand Down Expand Up @@ -191,21 +191,27 @@ extern "C" {
*
* @param[in] num_links Total number of peripheral and central links supported.
*/
#define SDC_MEM_LE_POWER_CONTROL(num_links) ((num_links) > 0 ? (12 + (num_links) * 26) : 0)
#define SDC_MEM_LE_POWER_CONTROL(num_links) ((num_links) > 0 ? (13 + (num_links) * 115) : 0)

/** @brief Maximum memory required when supporting subrating.
*
* @param[in] num_links Total number of peripheral and central links supported.
*/
#define SDC_MEM_SUBRATING(num_links) ((num_links) * 0)

/** Memory required for Quality of Service (QoS) channel survey module. */
#define SDC_MEM_QOS_CHANNEL_SURVEY (40)

/** Memory required for the scanner when only supporting legacy scanning. */
#define SDC_MEM_SCAN(buffer_count) (340 + (buffer_count) * 96)
#define SDC_MEM_SCAN(buffer_count) (345 + (buffer_count) * 98)

/** Memory required for the scanner when supporting extended scanning. */
#define SDC_MEM_SCAN_EXT(buffer_count) (340 + (buffer_count) * 312)
#define SDC_MEM_SCAN_EXT(buffer_count) (345 + (buffer_count) * 320)

/** Additional memory required for the initiator when supporting scanning
* and initiating at the same time.
*/
#define SDC_MEM_INITIATOR (312)
#define SDC_MEM_INITIATOR (320)

/** Memory required for the Filter Accept List */
#define SDC_MEM_FAL(max_num_entries) ((max_num_entries) > 0 ? (4 + (max_num_entries) * 8) : 0)
Expand Down Expand Up @@ -1193,20 +1199,9 @@ int32_t sdc_support_qos_channel_survey(void);

/** @brief Configure the coex advertising mode
*
* Configure how the advertiser behaves on denial of an advertising packet.
* The advertiser can be configured to carry on with the advertisement after the denial or
* to abort the advertising event, once an advertising packet gets denied.
* This API has now been deprecated and has no effect.
*
* The default behavior is that the advertiser tries to carry on with the advertising event
* after the denial.
*
* @note Setting @p adv_cont_on_denial to True is not supported for the
* @ref MPSL_COEX_1WIRE_GPIOTE_ID coex interface type.
* Using the @ref MPSL_COEX_1WIRE_GPIOTE_ID coex interface without using this
* API call with @p adv_cont_on_denial set to False will result in unexpected behavior.
*
* @retval 0 Success
* @retval -NRF_EOPNOTSUPP The coexistence feature is not supported.
* @retval -NRF_EOPNOTSUPP This API is no longer supported.
*/
int32_t sdc_coex_adv_mode_configure(bool adv_cont_on_denial);

Expand Down
217 changes: 217 additions & 0 deletions softdevice_controller/include/sdc_hci_cmd_le.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ enum sdc_hci_opcode_le
/** @brief LE subevent Code values. */
enum sdc_hci_subevent_le
{
/** @brief See @ref sdc_hci_subevent_le_adv_report_t. */
SDC_HCI_SUBEVENT_LE_ADV_REPORT = 0x02,
/** @brief See @ref sdc_hci_subevent_le_directed_adv_report_t. */
SDC_HCI_SUBEVENT_LE_DIRECTED_ADV_REPORT = 0x0b,
/** @brief See @ref sdc_hci_subevent_le_ext_adv_report_t. */
SDC_HCI_SUBEVENT_LE_EXT_ADV_REPORT = 0x0d,
/** @brief See @ref sdc_hci_subevent_le_subrate_change_t. */
SDC_HCI_SUBEVENT_LE_SUBRATE_CHANGE = 0x23,
};
Expand All @@ -281,6 +287,19 @@ typedef struct __PACKED __ALIGN(1)
uint16_t rfu : 9;
} sdc_hci_le_adv_event_properties_params_t;

/** @brief LE Advertising Report array parameters. */
typedef struct __PACKED __ALIGN(1)
{
uint8_t event_type;
uint8_t address_type;
uint8_t address[6];
uint8_t data_length;
uint8_t data[];
/* C does not allow fields to be placed after variable sized array
int8_t rssi;
*/
} sdc_hci_le_adv_report_array_params_t;

/** @brief LE BIG Create Sync array parameters. */
typedef struct __PACKED __ALIGN(1)
{
Expand All @@ -294,6 +313,50 @@ typedef struct __PACKED __ALIGN(1)
uint16_t acl_conn_handle;
} sdc_hci_le_create_cis_array_params_t;

/** @brief LE Directed Advertising Report array parameters. */
typedef struct __PACKED __ALIGN(1)
{
uint8_t event_type;
uint8_t address_type;
uint8_t address[6];
uint8_t direct_address_type;
uint8_t direct_address[6];
int8_t rssi;
} sdc_hci_le_directed_adv_report_array_params_t;

/** @brief Event_Type parameters for HCI_LE_Extended_Advertising_Report event. */
typedef struct __PACKED __ALIGN(1)
{
uint16_t connectable_adv : 1;
uint16_t scannable_adv : 1;
uint16_t directed_adv : 1;
uint16_t scan_response : 1;
uint16_t legacy_adv_pdus_used : 1;
uint16_t data_status : 2;
uint16_t rfu : 9;
} sdc_hci_le_ext_adv_report_array_event_type_params_t;

/** @brief LE Extended Advertising Report array parameters. */
typedef struct __PACKED __ALIGN(1)
{
union __PACKED __ALIGN(1) {
sdc_hci_le_ext_adv_report_array_event_type_params_t params;
uint8_t raw[2];
} event_type;
uint8_t address_type;
uint8_t address[6];
uint8_t primary_phy;
uint8_t secondary_phy;
uint8_t adv_sid;
int8_t tx_power;
int8_t rssi;
uint16_t periodic_adv_interval;
uint8_t direct_address_type;
uint8_t direct_address[6];
uint8_t data_length;
uint8_t data[];
} sdc_hci_le_ext_adv_report_array_params_t;

/** @brief LE Extended Create Connection [v1] array parameters. */
typedef struct __PACKED __ALIGN(1)
{
Expand Down Expand Up @@ -540,6 +603,158 @@ typedef struct __PACKED __ALIGN(1)
* @{
*/

/** @brief LE Advertising Report.
*
* The description below is extracted from Core_v5.4,
* Vol 4, Part E, Section 7.7.65.2
*
* The HCI_LE_Advertising_Report event indicates that one or more Bluetooth
* devices have responded to an active scan or have broadcast advertisements
* that were received during a passive scan. The Controller may queue these
* advertising reports and send information from multiple devices in one
* HCI_LE_Advertising_Report event.
*
* This event shall only be generated if scanning was enabled using the
* HCI_LE_Set_Scan_Enable command. It only reports advertising events that
* used legacy advertising PDUs.
*/
typedef struct __PACKED __ALIGN(1)
{
uint8_t num_reports;
/** C does not allow array of variable sized arrays, otherwise it should be @ref
sdc_hci_le_adv_report_array_params_t reports[]; */
uint8_t reports[];
} sdc_hci_subevent_le_adv_report_t;

/** @brief LE Directed Advertising Report.
*
* The description below is extracted from Core_v5.4,
* Vol 4, Part E, Section 7.7.65.11
*
* The HCI_LE_Directed_Advertising_Report event indicates that directed
* advertisements have been received where the advertiser is using a resolvable
* private address for the TargetA field of the advertising PDU which the
* Controller is unable to resolve and the Scanning_Filter_Policy is equal to 0x02
* or 0x03, see Section 7.8.10. Direct_Address_Type and Direct_Address specify
* the address the directed advertisements are being directed to. Address_Type
* and Address specify the address of the advertiser sending the directed
* advertisements. The Controller may queue these advertising reports and send
* information from multiple advertisers in one HCI_LE_Directed_Advertising_-
* Report event.
*
* This event shall only be generated if scanning was enabled using the
* HCI_LE_Set_Scan_Enable command. It only reports advertising events that
* used legacy advertising PDUs.
*/
typedef struct __PACKED __ALIGN(1)
{
uint8_t num_reports;
sdc_hci_le_directed_adv_report_array_params_t reports[];
} sdc_hci_subevent_le_directed_adv_report_t;

/** @brief LE Extended Advertising Report.
*
* The description below is extracted from Core_v5.4,
* Vol 4, Part E, Section 7.7.65.13
*
* The HCI_LE_Extended_Advertising_Report event indicates that one or more
* Bluetooth devices have responded to an active scan or have broadcast
* advertisements that were received during a passive scan. The Controller may
* coalesce multiple advertising reports from the same or different advertisers into
* a single HCI_LE_Extended_Advertising_Report event, provided all the
* parameters from all the advertising reports fit in a single HCI event.
*
* This event shall only be generated if scanning was enabled using the
* HCI_LE_Set_Extended_Scan_Enable command. It reports advertising events
* using either legacy or extended advertising PDUs.
*
* The Controller may split the data from a single advertisement or scan response
* (whether one PDU or several) into several reports. If so, each report except the
* last shall have an Event_Type with a data status field of "incomplete, more data
* to come", while the last shall have the value "complete"; the Address_Type,
* Address, Advertising_SID, Primary_PHY, and Secondary_PHY fields shall be
* the same in all the reports. No further reports shall be sent for a given adver-
* tisement or scan response after one with a Data_Status other than "incom-
* plete, more data to come".
*
* When a scan response is received, bits 0 to 2 and 4 of the event type shall
* indicate the properties of the original advertising event and the Advertising_SID
* field should be set to the value in the original scannable advertisement.
* An Event_Type with a data status field of "incomplete, data truncated" shall
* indicate that the Controller attempted to receive an AUX_CHAIN_IND PDU but
* was not successful or received it but was unable to store the data.
* Where the event being reported used a legacy advertising PDU, the Controller
* shall set the Event_Type to the value specified in Table 7.1.
*
* PDU Type Event_Type
*
* ADV_IND 0b0010011
*
* ADV_DIRECT_IND 0b0010101
*
* ADV_SCAN_IND 0b0010010
*
* ADV_NONCONN_IND 0b0010000
*
* SCAN_RSP to an ADV_IND 0b0011011
*
* SCAN_RSP to an ADV_SCAN_IND 0b0011010
*
* Table 7.1: Event_Type values for legacy PDUs
*
* If the Event_Type indicates a legacy PDU (bit 4 = 1), the Primary_PHY
* parameter shall indicate the LE 1M PHY and the Secondary_PHY parameter
* shall be set to 0x00. Otherwise, the Primary_PHY parameter shall indicate the
* PHY used to send the advertising PDU on the primary advertising physical
* channel and the Secondary_PHY parameter shall indicate the PHY used to
* send the advertising PDU(s), if any, on the secondary advertising physical
* channel. If the Advertising Coding Selection (Host Support) Link Layer feature
* bit is set (see [Vol 6] Part B, Section 4.6) and the Primary_PHY or
* Secondary_PHY parameter indicates that the LE Coded PHY was used, then
* the parameter shall also indicate which coding was used.
*
* The Periodic_Advertising_Interval event parameter shall be set to zero when
* no periodic advertising exists as part of the advertising set.
*
* The Direct_Address_Type and Direct_Address parameters shall contain the
* TargetA address in the advertising PDU for directed advertising event types (bit
* 2 = 1). These parameters shall be ignored for undirected advertising event
* types (bit 2 = 0). If the TargetA address is a resolvable private address that the
* Controller successfully resolved, then the value of Direct_Address_Type shall
* depend on the value of the Own_Address_Type parameter of the command
* that set the extended scan parameters. Direct_Address shall be set as follows:
* • If Direct_Address_Type equals 0x02, then Direct_Address shall be set to
* either the TargetA field in the received advertisement or to the public device
* address of the scanning device.
* • If Direct_Address_Type equals 0x03, then Direct_Address shall be set to
* either the TargetA field in the received advertisement or to the address set
* by the HCI_LE_Set_Random_Address command.
* • Otherwise Direct_Address shall be set to the TargetA field in the received
* advertisement.
*
* When multiple advertising packets are used to complete a single advertising
* report (e.g., a packet containing an ADV_EXT_IND PDU combined with one
* containing an AUX_ADV_IND PDU), the RSSI event parameter shall be set
* based on the last packet received and the TX_Power event parameter shall be
* based on the last packet of the current advertisement or scan response
* received that contains a TxPower field. However, if an event has been sent
* with a TX_Power value other than 0x7F and a Data_Status of "incomplete,
* more data to come", and if no subsequent PDU with a TxPower field has been
* received, then subsequent events may instead have a TX_Power value of
* 0x7F.
*
* If the Controller receives an AUX_CHAIN_IND with no AdvData, it should send
* the report (or the last report if it has split the data) immediately without waiting
* for any subsequent AUX_CHAIN_IND PDUs.
*/
typedef struct __PACKED __ALIGN(1)
{
uint8_t num_reports;
/** C does not allow array of variable sized arrays, otherwise it should be @ref
sdc_hci_le_ext_adv_report_array_params_t reports[]; */
uint8_t reports[];
} sdc_hci_subevent_le_ext_adv_report_t;

/** @brief LE Subrate Change.
*
* The description below is extracted from Core_v5.4,
Expand Down Expand Up @@ -1628,6 +1843,8 @@ typedef struct __PACKED __ALIGN(1)
{
uint8_t adv_handle;
uint8_t num_subevents;
/** C does not allow array of variable sized arrays, otherwise it should be @ref
sdc_hci_le_set_periodic_adv_subevent_data_array_params_t array_params[]; */
uint8_t array_params[];
} sdc_hci_cmd_le_set_periodic_adv_subevent_data_t;

Expand Down
Loading

0 comments on commit 92ab351

Please sign in to comment.