BLE_GAP_CreateConnection
C
uint16_t BLE_GAP_CreateConnection(BLE_GAP_CreateConnParams_T *p_createConnParam);
Description
Initiates a BLE connection to a connectable advertiser.
Note
This API is part of the legacy advertising feature set and will be disallowed if any extended advertising feature API has been used prior to this call. See Categories of advertising APIs and events for advertising API details. Initialization with BLE_GAP_ConnCentralInit is required for this API. is required before using this API.
Events generated
BLE_GAP_EVT_CONNECTED is generated when the connection is established.
Parameters
Parameter | Description |
---|---|
[in] p_createConnParam | Pointer to the structure containing connection parameters. See BLE_GAP_CreateConnParams_T for details.. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully initiates a BLE connection with the specified device. |
MBA_RES_OOM | Internal memory allocation failure occurred. |
MBA_RES_INVALID_PARA | Invalid parameters, if any of the connection parameters are out of range. Refer to BLE_GAP_CreateConnParams_T for parameter ranges. |
MBA_RES_NO_RESOURCE | Exceeded the maximum number of concurrent connections. |
MBA_RES_COMMAND_DISALLOWED | Command disallowed due to a conflicting operation or state. |