Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Connecting Procedure APIs

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.

Parameters
[in]handlehandle of the connection to be updated
[in]acceptaccept or refuse connection parameters proposed by peer slave device
[in]ce_len_minMinimum CE length
[in]ce_len_maxMaximum CE length
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by ble_conn_param_update_req().

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

Parameters
[in]peersList of peers' addresses that the device will connect to one of them
[in]peer_countNumber peers trying to connect with. In case of using AT_BLE_CONNECTION_DIRECT mode, peer_count should be 1.
[in]scan_intervalScan interval in 625us units
[in]scan_windowScan window in 625us units
[in]connection_paramsParameters of the established connection
Note
Default connection mode is AT_BLE_CONNECTION_AUTO
See Also
at_ble_set_conn_mode
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by ble_scan_info(), and gap_dev_connect().

at_ble_status_t at_ble_connect_cancel ( void  )

Cancels an ongoing connection attempt.

Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t
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.

Note
This API returns after programming the new values but before they take effect, actual effect of the parameters is marked by the event AT_BLE_CONN_PARAM_UPDATE_DONE
Parameters
[in]handlehandle of the connection to be updated
[in]connection_paramsnew parameters to be used
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t
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.

Parameters
[in]handlehandle of the connection to be terminated
[in]reasondisconnection reason, more info at at_ble_disconnect_reason_t
Note
  • At AT_BLE_DISCONNECTED event, for reason of disconnection see Bluetooth error code at Bluetooth core specification; vol 2, Core System Package [BR/EDR Controller volume], Part D
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by anp_client_discovery_complete_handler(), app_pair_done_event_handler(), ble_connected_state_handler(), ble_encryption_request_handler(), ble_pair_done_handler(), ble_pair_key_request_handler(), ble_resolv_rand_addr_handler(), blp_disconnection(), eddystone_url_frame_send(), fmp_locator_discovery_complete_handler(), hr_sensor_disconnect(), multirole_app_custom_event(), pas_client_discovery_complete_handler(), pxp_monitor_app_button_event(), pxp_monitor_discovery_complete_handler(), time_info_characteristic_read_response(), and time_info_discovery_complete_handler().

at_ble_status_t at_ble_set_conn_mode ( at_ble_conn_mode_t  mode)

Set connection mode parameter.

Parameters
[in]modeselected mode, one of at_ble_conn_mode_t
Returns
Upon successful completion the function shall return AT_BLE_SUCCESS, Otherwise the function shall return at_ble_status_t

Referenced by ble_scan_info().