BLE_GAP_CreateSync
C
uint16_t BLE_GAP_CreateSync(BLE_GAP_CreateSync_T *p_periSync);
Description
Synchronizes with a periodic advertising train from an advertiser and begin receiving periodic advertising packets.
Note
This API can be called regardless of the current scanning state. Scanning can be enabled or disabled while this command is pending. However, synchronization can only occur when scanning is enabled. Refer to BLE_GAP_SetExtScanningEnable for more information. This API is part of the extended advertising feature set and is not compatible with legacy advertising APIs. See Categories of advertising APIs and events for details. Initialization with BLE_GAP_ScanInit, BLE_GAP_ExtScanInit, and BLE_GAP_SyncInit is required before using this API.
Events generated
BLE_GAP_EVT_PERI_ADV_SYNC_EST is generated when synchronization is established.
BLE_GAP_EVT_PERI_ADV_REPORT is generated when a periodic advertising report is received.
Parameters
Parameter | Description |
---|---|
[in] p_periSync | Pointer to a BLE_GAP_CreateSync_T structure containing synchronization parameters. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully issues a request to synchronize with a periodic advertising train. |
MBA_RES_OOM | Internal memory allocation failure occurred. |
MBA_RES_INVALID_PARA | The parameters provided are invalid. |
MBA_RES_CONN_ALREADY_EXISTS | Connection already exists. |
MBA_RES_COMMAND_DISALLOWED | Command disallowed due to a conflicting operation or state. |