nRF51 SDK
|
Functions | |
uint32_t | sd_ble_gap_address_set (ble_gap_addr_t const *const p_addr) |
Set local Bluetooth address. More... | |
uint32_t | sd_ble_gap_address_get (ble_gap_addr_t *const p_addr) |
Get local Bluetooth address. More... | |
uint32_t | sd_ble_gap_adv_data_set (uint8_t const *const p_data, uint8_t dlen, uint8_t const *const p_sr_data, uint8_t srdlen) |
Set, clear or update advertisement and scan response data. More... | |
uint32_t | sd_ble_gap_adv_start (ble_gap_adv_params_t const *const p_adv_params) |
Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). More... | |
uint32_t | sd_ble_gap_adv_stop (void) |
Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). More... | |
uint32_t | sd_ble_gap_conn_param_update (uint16_t conn_handle, ble_gap_conn_params_t const *const p_conn_params) |
Update connection parameters. More... | |
uint32_t | sd_ble_gap_disconnect (uint16_t conn_handle, uint8_t hci_status_code) |
Disconnect (GAP Link Termination). More... | |
uint32_t | sd_ble_gap_tx_power_set (int8_t tx_power) |
Set the radio's transmit power. More... | |
uint32_t | sd_ble_gap_appearance_set (uint16_t appearance) |
Set GAP Appearance value. More... | |
uint32_t | sd_ble_gap_appearance_get (uint16_t *const p_appearance) |
Get GAP Appearance value. More... | |
uint32_t | sd_ble_gap_ppcp_set (ble_gap_conn_params_t const *const p_conn_params) |
Set GAP Peripheral Preferred Connection Parameters. More... | |
uint32_t | sd_ble_gap_ppcp_get (ble_gap_conn_params_t *const p_conn_params) |
Get GAP Peripheral Preferred Connection Parameters. More... | |
uint32_t | sd_ble_gap_device_name_set (ble_gap_conn_sec_mode_t const *const p_write_perm, uint8_t const *const p_dev_name, uint16_t len) |
Set GAP device name. More... | |
uint32_t | sd_ble_gap_device_name_get (uint8_t *const p_dev_name, uint16_t *const p_len) |
Get GAP device name. More... | |
uint32_t | sd_ble_gap_authenticate (uint16_t conn_handle, ble_gap_sec_params_t const *const p_sec_params) |
Initiate GAP Authentication procedure. More... | |
uint32_t | sd_ble_gap_sec_params_reply (uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *const p_sec_params) |
Reply with GAP security parameters. More... | |
uint32_t | sd_ble_gap_auth_key_reply (uint16_t conn_handle, uint8_t key_type, uint8_t const *const key) |
Reply with an authentication key. More... | |
uint32_t | sd_ble_gap_sec_info_reply (uint16_t conn_handle, ble_gap_enc_info_t const *const p_enc_info, ble_gap_sign_info_t const *const p_sign_info) |
Reply with GAP security information. More... | |
uint32_t | sd_ble_gap_conn_sec_get (uint16_t conn_handle, ble_gap_conn_sec_t *const p_conn_sec) |
Get the current connection security. More... | |
uint32_t | sd_ble_gap_rssi_start (uint16_t conn_handle) |
Start reporting the received signal strength to the application. More... | |
uint32_t | sd_ble_gap_rssi_stop (uint16_t conn_handle) |
Stop reporting the received singnal strength. More... | |
uint32_t sd_ble_gap_address_set | ( | ble_gap_addr_t const *const | p_addr | ) |
[in] | p_addr | Pointer to address structure. |
uint32_t sd_ble_gap_address_get | ( | ble_gap_addr_t *const | p_addr | ) |
[out] | p_addr | Pointer to address structure. |
uint32_t sd_ble_gap_adv_data_set | ( | uint8_t const *const | p_data, |
uint8_t | dlen, | ||
uint8_t const *const | p_sr_data, | ||
uint8_t | srdlen | ||
) |
[in] | p_data | Raw data to be placed in advertisement packet. If NULL, no changes are made to the current advertisement packet data. |
[in] | dlen | Data length for p_data. Max size: BLE_GAP_ADV_MAX_SIZE octets. Should be 0 if p_data is NULL, can be 0 if p_data is not NULL. |
[in] | p_sr_data | Raw data to be placed in scan response packet. If NULL, no changes are made to the current scan response packet data. |
[in] | srdlen | Data length for p_sr_data. Max size: BLE_GAP_ADV_MAX_SIZE octets. Should be 0 if p_sr_data is NULL, can be 0 if p_data is not NULL. |
uint32_t sd_ble_gap_adv_start | ( | ble_gap_adv_params_t const *const | p_adv_params | ) |
[in] | p_adv_params | Pointer to advertising parameters structure. |
uint32_t sd_ble_gap_adv_stop | ( | void | ) |
uint32_t sd_ble_gap_conn_param_update | ( | uint16_t | conn_handle, |
ble_gap_conn_params_t const *const | p_conn_params | ||
) |
In the central role this will initiate a Link Layer connection parameter update procedure, otherwise in the peripheral role, this will send the corresponding L2CAP request and wait for the central to perform the procedure. In both cases, and regardless of success or failure, the application will be informed of the result with a BLE_GAP_EVT_CONN_PARAM_UPDATE event.
[in] | conn_handle | Connection handle. |
[in] | p_conn_params | Pointer to desired connection parameters. If NULL is provided on a peripheral role, the parameters in the PPCP characteristic of the GAP service will be used instead. |
uint32_t sd_ble_gap_disconnect | ( | uint16_t | conn_handle, |
uint8_t | hci_status_code | ||
) |
This call initiates the disconnection procedure, and its completion will be communicated to the application with a BLE_GAP_EVT_DISCONNECTED event.
[in] | conn_handle | Connection handle. |
[in] | hci_status_code | HCI status code, see Bluetooth status codes. |
uint32_t sd_ble_gap_tx_power_set | ( | int8_t | tx_power | ) |
[in] | tx_power | Radio transmit power in dBm (accepted values are -40, -20, -16, -12, -8, -4, 0, and 4 dBm). |
uint32_t sd_ble_gap_appearance_set | ( | uint16_t | appearance | ) |
[in] | appearance | Appearance (16-bit), see Bluetooth Appearance values. |
uint32_t sd_ble_gap_appearance_get | ( | uint16_t *const | p_appearance | ) |
[out] | p_appearance | Appearance (16-bit), see Bluetooth Appearance values. |
uint32_t sd_ble_gap_ppcp_set | ( | ble_gap_conn_params_t const *const | p_conn_params | ) |
[in] | p_conn_params | Pointer to a ble_gap_conn_params_t structure with the desired parameters. |
uint32_t sd_ble_gap_ppcp_get | ( | ble_gap_conn_params_t *const | p_conn_params | ) |
[out] | p_conn_params | Pointer to a ble_gap_conn_params_t structure where the parameters will be stored. |
uint32_t sd_ble_gap_device_name_set | ( | ble_gap_conn_sec_mode_t const *const | p_write_perm, |
uint8_t const *const | p_dev_name, | ||
uint16_t | len | ||
) |
[in] | p_write_perm | Write permissions for the Device Name characteristic see ble_gap_conn_sec_mode_t. |
[in] | p_dev_name | Pointer to a UTF-8 encoded, non NULL-terminated string. |
[in] | len | Length of the UTF-8, non NULL-terminated string pointed to by p_dev_name in octets (must be smaller or equal than BLE_GAP_DEVNAME_MAX_LEN). |
uint32_t sd_ble_gap_device_name_get | ( | uint8_t *const | p_dev_name, |
uint16_t *const | p_len | ||
) |
[in] | p_dev_name | Pointer to an empty buffer where the UTF-8 non NULL-terminated string will be placed. |
[in,out] | p_len | Length of the buffer pointed by p_dev_name, bytes returned on output. |
uint32_t sd_ble_gap_authenticate | ( | uint16_t | conn_handle, |
ble_gap_sec_params_t const *const | p_sec_params | ||
) |
[in] | conn_handle | Connection handle. |
[in] | p_sec_params | Pointer to the ble_gap_sec_params_t structure with the security parameters to be used during the pairing procedure. |
In the central role, this function will send an SMP Pairing Request, otherwise in the peripheral role, an SMP Security Request will be sent. In the peripheral role, only the timeout, bond and mitm fields of ble_gap_sec_params_t are used.
uint32_t sd_ble_gap_sec_params_reply | ( | uint16_t | conn_handle, |
uint8_t | sec_status, | ||
ble_gap_sec_params_t const *const | p_sec_params | ||
) |
[in] | conn_handle | Connection handle. |
[in] | sec_status | Security status, see GAP Security status. |
[in] | p_sec_params | Pointer to a ble_gap_sec_params_t security parameters structure. |
This function is only used to reply to a BLE_GAP_EVT_SEC_PARAMS_REQUEST, calling it at other times will result in an NRF_ERROR_INVALID_STATE.
uint32_t sd_ble_gap_auth_key_reply | ( | uint16_t | conn_handle, |
uint8_t | key_type, | ||
uint8_t const *const | key | ||
) |
[in] | conn_handle | Connection handle. |
[in] | key_type | See GAP Authentication Key Types. |
[in] | key | If key type is BLE_GAP_AUTH_KEY_TYPE_NONE, then NULL. If key type is BLE_GAP_AUTH_KEY_TYPE_PASSKEY, then a 6-byte ASCII string (digit 0..9 only, no NULL termination). If key type is BLE_GAP_AUTH_KEY_TYPE_OOB, then a 16-byte OOB key value in Little Endian format. |
This function is only used to reply to a BLE_GAP_EVT_AUTH_KEY_REQUEST, calling it at other times will result in an NRF_ERROR_INVALID_STATE.
uint32_t sd_ble_gap_sec_info_reply | ( | uint16_t | conn_handle, |
ble_gap_enc_info_t const *const | p_enc_info, | ||
ble_gap_sign_info_t const *const | p_sign_info | ||
) |
[in] | conn_handle | Connection handle. |
[in] | p_enc_info | Pointer to a ble_gap_enc_info_t encryption information structure. May be NULL to signal none is available. |
[in] | p_sign_info | Pointer to a ble_gap_sign_info_t signing information structure. May be NULL to signal none is available. |
This function is only used to reply to a BLE_GAP_EVT_SEC_INFO_REQUEST, calling it at other times will result in NRF_ERROR_INVALID_STATE.
uint32_t sd_ble_gap_conn_sec_get | ( | uint16_t | conn_handle, |
ble_gap_conn_sec_t *const | p_conn_sec | ||
) |
[in] | conn_handle | Connection handle. |
[out] | p_conn_sec | Pointer to a ble_gap_conn_sec_t structure to be filled in. |
uint32_t sd_ble_gap_rssi_start | ( | uint16_t | conn_handle | ) |
A new event is reported whenever the RSSI value changes, until sd_ble_gap_rssi_stop is called.
[in] | conn_handle | Connection handle. |
uint32_t sd_ble_gap_rssi_stop | ( | uint16_t | conn_handle | ) |
An RSSI change detected before the call but not yet received by the application may be reported after sd_ble_gap_rssi_stop has been called.
[in] | conn_handle | Connection handle. |