This group includes connections APIs.
Functions | |
at_ble_status_t | at_ble_conn_update_reply (at_ble_handle_t handle, bool accept, uint16_t ce_len_min, uint16_t ce_len_max) |
Reply to connection parameters update request AT_BLE_CONN_PARAM_UPDATE_REQUEST. More... | |
at_ble_status_t | at_ble_connect (at_ble_addr_t peers[], uint8_t peer_count, uint16_t scan_interval, uint16_t scan_window, at_ble_connection_params_t *connection_params) |
Connect to a peer device. More... | |
at_ble_status_t | at_ble_connect_cancel (void) |
Cancels an ongoing connection attempt. More... | |
at_ble_status_t | at_ble_connection_param_update (at_ble_handle_t handle, at_ble_connection_params_t *connection_params) |
Update the connection parameters of an ongoing connection. More... | |
at_ble_status_t | at_ble_disconnect (at_ble_handle_t handle, at_ble_disconnect_reason_t reason) |
Disconnect a connected peer device and receive response through AT_BLE_DISCONNECTED event. More... | |
at_ble_status_t | at_ble_set_conn_mode (at_ble_conn_mode_t mode) |
Set connection mode parameter. More... | |
at_ble_status_t at_ble_conn_update_reply | ( | at_ble_handle_t | handle, |
bool | accept, | ||
uint16_t | ce_len_min, | ||
uint16_t | ce_len_max | ||
) |
Reply to connection parameters update request AT_BLE_CONN_PARAM_UPDATE_REQUEST.
[in] | handle | handle of the connection to be updated |
[in] | accept | accept or refuse connection parameters proposed by peer slave device |
[in] | ce_len_min | Minimum CE length |
[in] | ce_len_max | Maximum CE length |
at_ble_status_t at_ble_connect | ( | at_ble_addr_t | peers[], |
uint8_t | peer_count, | ||
uint16_t | scan_interval, | ||
uint16_t | scan_window, | ||
at_ble_connection_params_t * | connection_params | ||
) |
Connect to a peer device.
Connecting to a peer device, implicitly starting the necessary scan operation then connecting if a device in the peers list is found in case of using default mode AT_BLE_CONNECTION_AUTO. In case of using AT_BLE_CONNECTION_DIRECT mode, device will try to connect directly to provided peer address only without scanning. This API returns immediately after the operation is programmed, actual connection establishment or failure is marked with AT_BLE_CONNECTED event
[in] | peers | List of peers' addresses that the device will connect to one of them |
[in] | peer_count | Number peers trying to connect with. In case of using AT_BLE_CONNECTION_DIRECT mode, peer_count should be 1. |
[in] | scan_interval | Scan interval in 625us units |
[in] | scan_window | Scan window in 625us units |
[in] | connection_params | Parameters of the established connection |
Connecting to a peer device, implicitly starting the necessary scan operation then connecting if a device in the peers list is found. This API returns immediately after the operation is programmed, actual connection establishment or failure is marked with AT_BLE_CONNECTED event
[in] | peers | a list of peers that the device will connect to one of them |
[in] | peer_count | number of elements in peers, 0 to connect to any peer device |
[in] | scan_interval | scan interval in 625us units |
[in] | scan_window | scan window in 625us units |
[in] | connection_params | parameters of the established connection |
References at_ble_addr_t::addr, device_info::addr_auto_gen, at_ble_addr_get(), AT_BLE_INVALID_PARAM, AT_BLE_SUCCESS, AT_CNX_INTERVAL_MAX, AT_CNX_INTERVAL_MIN, AT_CNX_LATENCY_MAX, AT_CNX_SUP_TO_MAX, AT_CNX_SUP_TO_MIN, at_ble_connection_params_t::ce_len_max, at_ble_connection_params_t::ce_len_min, at_ble_connection_params_t::con_intv_max, at_ble_connection_params_t::con_intv_min, at_ble_connection_params_t::con_latency, device, GAPM_CONNECTION_AUTO, gapm_get_device_address_type(), gapm_start_connection_cmd_handler(), device_info::renew_dur, device_info::role, ROLE_MASTER, status, at_ble_connection_params_t::superv_to, and at_ble_addr_t::type.
at_ble_status_t at_ble_connect_cancel | ( | void | ) |
Cancels an ongoing connection attempt.
References gapm_cancel_cmd_handler().
at_ble_status_t at_ble_connection_param_update | ( | at_ble_handle_t | handle, |
at_ble_connection_params_t * | connection_params | ||
) |
Update the connection parameters of an ongoing connection.
Connection parameter update command can be used by both master and slave of the connection.
For master of the connection, new connection parameters will be applied immediately.
For slave of the connection, a connection update message request will be send to master. Then master will be able to accept or refuse those parameters within 30 seconds otherwise link is automatically disconnected.
[in] | handle | handle of the connection to be updated |
[in] | connection_params | new parameters to be used |
This API returns after programming the new values but before they take effect; the actual effect of the parameters is marked by the event AT_BLE_CONN_PARAM_UPDATE_DONE
[in] | handle | Handle of the connection to be updated |
[in] | connection_params | New parameters to be used |
References AT_BLE_INVALID_PARAM, AT_CNX_INTERVAL_MAX, AT_CNX_INTERVAL_MIN, AT_CNX_LATENCY_MAX, AT_CNX_SUP_TO_MAX, AT_CNX_SUP_TO_MIN, at_ble_connection_params_t::ce_len_max, at_ble_connection_params_t::ce_len_min, at_ble_connection_params_t::con_intv_max, at_ble_connection_params_t::con_intv_min, at_ble_connection_params_t::con_latency, gapc_param_update_cmd_handler(), and at_ble_connection_params_t::superv_to.
at_ble_status_t at_ble_disconnect | ( | at_ble_handle_t | handle, |
at_ble_disconnect_reason_t | reason | ||
) |
Disconnect a connected peer device and receive response through AT_BLE_DISCONNECTED event.
[in] | handle | handle of the connection to be terminated |
[in] | reason | disconnection reason, more info at at_ble_disconnect_reason_t |
Disconnect a connected peer device and receive response through AT_BLE_DISCONNECTED event.
[in] | handle | Handle of the connection to be terminated |
[in] | reason | Disconnection reason, more info at at_ble_disconnect_reason_t |
References AT_BLE_TERMINATED_BY_USER, AT_BLE_UNACCEPTABLE_INTERVAL, device_info::conn_handle, device, gapc_disconnect_cmd_handler(), and status.
at_ble_status_t at_ble_set_conn_mode | ( | at_ble_conn_mode_t | mode | ) |
Set connection mode parameter.
[in] | mode | selected mode, one of at_ble_conn_mode_t |
Referenced by ble_scan_info().