nrfxlib API 2.8.99
Loading...
Searching...
No Matches

◆ sdc_hci_cmd_le_periodic_adv_create_sync()

uint8_t sdc_hci_cmd_le_periodic_adv_create_sync ( const sdc_hci_cmd_le_periodic_adv_create_sync_t * p_params)

#include <softdevice_controller/include/sdc_hci_cmd_le.h>

LE Periodic Advertising Create Sync.

The description below is extracted from Core_v6.0, Vol 4, Part E, Section 7.8.67

The HCI_LE_Periodic_Advertising_Create_Sync command is used to synchronize with a periodic advertising train from an advertiser and begin receiving periodic advertising packets.

This command may be issued whether or not scanning is enabled and scanning may be enabled and disabled (see the LE Set Extended Scan Enable command) while this command is pending. However, synchronization can only occur when scanning is enabled. While scanning is disabled, no attempt to synchronize will take place.

The Options parameter is used to determine whether the Periodic Advertiser List is used, whether HCI_LE_Periodic_Advertising_Report events for this periodic advertising train are initially enabled or disabled, and whether duplicate reports are filtered or not. If the Periodic Advertiser List is not used, the Advertising_SID, Advertiser Address_Type, and Advertiser Address parameters specify the periodic advertising device to listen to; otherwise they shall be ignored.

The Advertising_SID parameter, if used, specifies the value that shall match the Advertising SID subfield in the ADI field of the received advertisement for it to be used to synchronize.

The Skip parameter specifies the maximum number of consecutive periodic advertising events that the receiver may skip after successfully receiving a periodic advertising packet.

The Sync_Timeout parameter specifies the maximum permitted time between successful receives. If this time is exceeded, synchronization is lost.

The Sync_CTE_Type parameter specifies whether to only synchronize to periodic advertising with certain types of Constant Tone Extension (a value of 0 indicates that the presence or absence of a Constant Tone Extension is irrelevant). If the periodic advertising has the wrong type of Constant Tone Extension then:

• If bit 0 of Options is set, the Controller shall ignore this address and SID and continue to search for other periodic advertisements. • Otherwise, the Controller shall cancel the synchronization with the error code Unsupported Remote Feature (0x1A).

If the periodic advertiser changes the type of Constant Tone Extension after the scanner has synchronized with the periodic advertising, the scanner's Link Layer shall remain synchronized.

If the Host sets all the non-reserved bits of the Sync_CTE_Type parameter to 1, the Controller shall return the error code Command Disallowed (0x0C).

Irrespective of the value of the Skip parameter, the Controller should stop skipping packets before the Sync_Timeout would be exceeded.

If the Host issues this command when another HCI_LE_Periodic_Advertising_Create_Sync command is pending, the Controller shall return the error code Command Disallowed (0x0C).

If the Host issues this command with bit 0 of Options not set and with Advertising_SID, Advertiser_Address_Type, and Advertiser_Address the same as those of a periodic advertising train that the Controller is already synchronized to, the Controller shall return the error code Connection Already Exists (0x0B).

If the Host issues this command and the Controller has insufficient resources to handle any more periodic advertising trains, the Controller shall return the error code Memory Capacity Exceeded (0x07).

If bit 1 of Options is set to 1 and the Controller supports the Periodic Advertising ADI Support feature, then the Controller shall ignore bit 2.

If bit 1 of Options is set to 0, bit 2 is set to 1, and the Controller does not support the Periodic Advertising ADI Support feature, then the Controller shall return an error which should use the error code Unsupported Feature or Parameter Value (0x11).

If bit 1 of the Options parameter is set to 1 and the Controller does not support the HCI_LE_Set_Periodic_Advertising_Receive_Enable command, the Controller shall return the error code Connection Failed to be Established / Synchronization Timeout (0x3E).

Event(s) generated (unless masked away): When the HCI_LE_Periodic_Advertising_Create_Sync command has been received, the Controller sends the HCI_Command_Status event to the Host. An HCI_LE_Periodic_Advertising_Sync_Established event shall be generated when the Controller starts receiving periodic advertising packets.

When the Controller receives periodic advertising packets then, if reporting is enabled, it sends HCI_LE_Periodic_Advertising_Report events to the Host.

If the Controller does not receive a periodic advertising packet within 6 periodic advertising events of first listening, then it shall generate an HCI_LE_Periodic_Advertising_Sync_Established event that should have Status set to Connection Failed to be Established / Synchronization Timeout (0x3E).

Note: The HCI_LE_Periodic_Advertising_Sync_Established event can be sent as a result of synchronization being canceled by an HCI_LE_Periodic_Advertising_Create_Sync_Cancel command.

Parameters
[in]p_paramsInput parameters.
Return values
0if success.
Returns
Returns value between 0x01-0xFF in case of error. See Vol 2, Part D, Error for a list of error codes and descriptions.