Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
GATT server API

Functions

at_ble_status_t at_ble_characteristic_value_get (at_ble_handle_t handle, uint8_t *value, uint16_t *actual_read_len)
 Reads a characteristic value. More...
 
at_ble_status_t at_ble_characteristic_value_set (at_ble_handle_t handle, uint8_t *value, uint16_t len)
 Sets a characteristic value. More...
 
at_ble_status_t at_ble_indication_send (at_ble_handle_t conn_handle, at_ble_handle_t attr_handle)
 Sends an Indication. More...
 
at_ble_status_t at_ble_notification_send (at_ble_handle_t conn_handle, at_ble_handle_t attr_handle)
 Sends a Notification. More...
 
at_ble_status_t at_ble_primary_service_define (at_ble_uuid_t *uuid, at_ble_handle_t *service_handle, at_ble_included_service_t *included_service_list, uint16_t included_service_count, at_ble_characteristic_t *characteristic_list, uint16_t characteristic_count)
 Defines a new Primary service along with its included services and characteristics. More...
 
at_ble_status_t at_ble_read_authorize_reply (at_ble_handle_t conn_handle, at_ble_handle_t attr_handle, bool grant_authorization, bool update_value, uint8_t *value, uint16_t offset, uint16_t len)
 Replies to a read authorization request requested by by AT_BLE_READ_AUTHORIZE_REQUEST event. More...
 
at_ble_status_t at_ble_secondary_service_define (at_ble_uuid_t *uuid, at_ble_handle_t *service_handle, at_ble_included_service_t *included_service_list, uint16_t included_service_count, at_ble_characteristic_t *characteristic_list, uint16_t characteristic_count)
 Defines a new Secondary service along with its included services and characteristics. More...
 
at_ble_status_t at_ble_service_changed_notification_send (at_ble_handle_t conn_handle, at_ble_handle_t start_handle, at_ble_handle_t end_handle)
 Sends a Service changed Notification. More...
 
at_ble_status_t at_ble_write_authorize_reply (at_ble_handle_t conn_handle, at_ble_handle_t attr_handle, bool grant_authorization)
 Replies to a write authorization request requested by by AT_BLE_WRITE_AUTHORIZE_REQUEST event. More...
 

at_ble_status_t at_ble_characteristic_value_get ( at_ble_handle_t  handle,
uint8_t *  value,
uint16_t *  actual_read_len 
)

Reads a characteristic value.

Parameters
[in]handleCharacteristic value handle
[out]valueRead value will be returned here
[in]actual_read_lenActual read length, in bytes
Returns
AT_BLE_SUCCESS Operation completed successfully
AT_BLE_INVALID_HANDLE Invalid handle
AT_BLE_FAILURE Generic error

References at_ble_att_error(), and gattm_att_get_value_req_handler().

Referenced by csc_serv_send_data().

at_ble_status_t at_ble_characteristic_value_set ( at_ble_handle_t  handle,
uint8_t *  value,
uint16_t  len 
)

Sets a characteristic value.

Parameters
[in]handleCharacteristic value handle
[in]valueNew value
[in]lenValue length, in bytes
Returns
AT_BLE_SUCCESS Operation completed successfully
AT_BLE_INVALID_HANDLE Invalid handle
AT_BLE_FAILURE Generic error

References at_ble_att_error(), and gattm_att_set_value_req_handler().

Referenced by csc_serv_send_data().

at_ble_status_t at_ble_indication_send ( at_ble_handle_t  conn_handle,
at_ble_handle_t  attr_handle 
)

Sends an Indication.

Parameters
[in]conn_handleHandle of the connection to be notified
[in]attr_handleHandle of the attribute originating the indication
Precondition
If the value has been updated, it is required to use at_ble_characteristic_value_set first
Returns
AT_BLE_SUCCESS Operation completed successfully
AT_BLE_INVALID_HANDLE Invalid handle
AT_BLE_FAILURE Generic error

References GATTC_INDICATE, and gattc_send_evt_cmd_handler().

at_ble_status_t at_ble_notification_send ( at_ble_handle_t  conn_handle,
at_ble_handle_t  attr_handle 
)

Sends a Notification.

Parameters
[in]conn_handleHandle of the connection to be notified
[in]attr_handleHandle of the attribute originating the notification
Precondition
If the value has been updated, it is required to use at_ble_characteristic_value_set first
Returns
AT_BLE_SUCCESS Operation completed successfully
AT_BLE_INVALID_HANDLE Invalid handle
AT_BLE_FAILURE Generic error

References GATTC_NOTIFY, and gattc_send_evt_cmd_handler().

Referenced by csc_serv_send_data().

at_ble_status_t at_ble_primary_service_define ( at_ble_uuid_t uuid,
at_ble_handle_t service_handle,
at_ble_included_service_t included_service_list,
uint16_t  included_service_count,
at_ble_characteristic_t characteristic_list,
uint16_t  characteristic_count 
)

Defines a new Primary service along with its included services and characteristics.

Parameters
[in]uuidThe primary service UUID
[out]service_handleThe Service handle will be returned here
[in]included_service_listAn array of included service references
[in]included_service_countNumber of elements in included_service_list
[in,out]characteristic_listAn array of characteristics included in the service, this array is update with respective characteristics handles.
[in]characteristic_countNumber of elements in charactristic_list
Returns
AT_BLE_SUCCESS Operation completed successfully
AT_BLE_INSUFF_RESOURCE Not enough memory to complete operation
AT_BLE_FAILURE Generic error

References at_ble_service_define().

Referenced by csc_serv_init().

at_ble_status_t at_ble_read_authorize_reply ( at_ble_handle_t  conn_handle,
at_ble_handle_t  attr_handle,
bool  grant_authorization,
bool  update_value,
uint8_t *  value,
uint16_t  offset,
uint16_t  len 
)

Replies to a read authorization request requested by by AT_BLE_READ_AUTHORIZE_REQUEST event.

Parameters
[in]conn_handleHandle of the connection
[in]attr_handleHandle of the attribute to read
[in]grant_authorizationIf True, Authorization is granted
[in]update_valueIf True, the value, offset, length of parameters will be used to update this attribute value
[in]valueNew value
[in]offsetWhere the writing starts
[in]lenValue length, in bytes
Warning
Not Supported
Returns
AT_BLE_SUCCESS Operation completed successfully
AT_BLE_FAILURE Generic error
at_ble_status_t at_ble_secondary_service_define ( at_ble_uuid_t uuid,
at_ble_handle_t service_handle,
at_ble_included_service_t included_service_list,
uint16_t  included_service_count,
at_ble_characteristic_t characteristic_list,
uint16_t  characteristic_count 
)

Defines a new Secondary service along with its included services and characteristics.

Parameters
[in]uuidThe secondary service UUID
[out]service_handleThe Service handle will be returned here
[in]included_service_listAn array of included service references
[in]included_service_countNumber of elements in included_service_list
[in,out]characteristic_listAn array of characteristics included in the service, this array is update with respective characteristics handles.
[in]characteristic_countNumber of elements in charactristic_list
Note
  • Secondary Services are only relevant in the context of the entity that references them, It is therefore forbidden to add a secondary service declaration that is not referenced by another service later in the ATT table
Returns
AT_BLE_SUCCESS Operation completed successfully
AT_BLE_INSUFF_RESOURCE not enough memory to complete operation
AT_BLE_FAILURE Generic error

References at_ble_service_define().

at_ble_status_t at_ble_service_changed_notification_send ( at_ble_handle_t  conn_handle,
at_ble_handle_t  start_handle,
at_ble_handle_t  end_handle 
)

Sends a Service changed Notification.

Parameters
[in]conn_handleHandle of the connection to which the notification will be sent
[in]start_handleStart of affected handle range
[in]end_handleEnd of affected handle range
Returns
AT_BLE_SUCCESS Operation completed successfully
AT_BLE_FAILURE Generic error

References AT_BLE_INVALID_PARAM, and gattc_svc_changed_notification_cmd_handler().

at_ble_status_t at_ble_write_authorize_reply ( at_ble_handle_t  conn_handle,
at_ble_handle_t  attr_handle,
bool  grant_authorization 
)

Replies to a write authorization request requested by by AT_BLE_WRITE_AUTHORIZE_REQUEST event.

Parameters
[in]conn_handleHandle of the connection
[in]attr_handleHandle of the attribute to write
[in]grant_authorizationIf True, Authorization is granted
Warning
Not Supported
Returns
AT_BLE_SUCCESS Operation completed successfully
AT_BLE_FAILURE Generic error