nRF51 SDK - S110 SoftDevice
|
Functions | |
uint32_t | sd_ble_gatts_service_add (uint8_t type, ble_uuid_t const *const p_uuid, uint16_t *const p_handle) |
Add a service declaration to the local server ATT table. More... | |
uint32_t | sd_ble_gatts_include_add (uint16_t service_handle, uint16_t inc_srvc_handle, uint16_t *const p_include_handle) |
Add an include declaration to the local server ATT table. More... | |
uint32_t | sd_ble_gatts_characteristic_add (uint16_t service_handle, ble_gatts_char_md_t const *const p_char_md, ble_gatts_attr_t const *const p_attr_char_value, ble_gatts_char_handles_t *const p_handles) |
Add a characteristic declaration, a characteristic value declaration and optional characteristic descriptor declarations to the local server ATT table. More... | |
uint32_t | sd_ble_gatts_descriptor_add (uint16_t char_handle, ble_gatts_attr_t const *const p_attr, uint16_t *const p_handle) |
Add a descriptor to the local server ATT table. More... | |
uint32_t | sd_ble_gatts_value_set (uint16_t handle, uint16_t offset, uint16_t *const p_len, uint8_t const *const p_value) |
Set the value of a given attribute. More... | |
uint32_t | sd_ble_gatts_value_get (uint16_t handle, uint16_t offset, uint16_t *const p_len, uint8_t *const p_data) |
Get the value of a given attribute. More... | |
uint32_t | sd_ble_gatts_hvx (uint16_t conn_handle, ble_gatts_hvx_params_t const *const p_hvx_params) |
Notify or Indicate an attribute value. More... | |
uint32_t | sd_ble_gatts_service_changed (uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle) |
Indicate the Service Changed attribute value. More... | |
uint32_t | sd_ble_gatts_rw_authorize_reply (uint16_t conn_handle, ble_gatts_rw_authorize_reply_params_t const *const p_rw_authorize_reply_params) |
Respond to a Read/Write authorization request. More... | |
uint32_t | sd_ble_gatts_sys_attr_set (uint16_t conn_handle, uint8_t const *const p_sys_attr_data, uint16_t len) |
Update persistent system attribute information. More... | |
uint32_t | sd_ble_gatts_sys_attr_get (uint16_t conn_handle, uint8_t *const p_sys_attr_data, uint16_t *const p_len) |
Retrieve persistent system attribute information from the stack. More... | |
uint32_t sd_ble_gatts_characteristic_add | ( | uint16_t | service_handle, |
ble_gatts_char_md_t const *const | p_char_md, | ||
ble_gatts_attr_t const *const | p_attr_char_value, | ||
ble_gatts_char_handles_t *const | p_handles | ||
) |
Add a characteristic declaration, a characteristic value declaration and optional characteristic descriptor declarations to the local server ATT table.
[in] | service_handle | Handle of the service where the characteristic is to be placed, if BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. |
[in] | p_char_md | Characteristic metadata. |
[in] | p_attr_char_value | Pointer to the attribute structure corresponding to the characteristic value. |
[out] | p_handles | Pointer to the structure where the assigned handles will be stored. |
uint32_t sd_ble_gatts_descriptor_add | ( | uint16_t | char_handle, |
ble_gatts_attr_t const *const | p_attr, | ||
uint16_t *const | p_handle | ||
) |
Add a descriptor to the local server ATT table.
[in] | char_handle | Handle of the characteristic where the descriptor is to be placed, if BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. |
[in] | p_attr | Pointer to the attribute structure. |
[out] | p_handle | Pointer to a 16-bit word where the assigned handle will be stored. |
uint32_t sd_ble_gatts_hvx | ( | uint16_t | conn_handle, |
ble_gatts_hvx_params_t const *const | p_hvx_params | ||
) |
Notify or Indicate an attribute value.
This function checks for the relevant Client Characteristic Configuration descriptor value to verify that the relevant operation (notification or indication) has been enabled by the client. It is also able to update the attribute value before issuing the PDU, so that the application can atomically perform a value update and a server initiated transaction with a single API call. If the application chooses to indicate an attribute value, a BLE_GATTS_EVT_HVC will be sent up as soon as the confirmation arrives from the peer.
[in] | conn_handle | Connection handle. |
[in] | p_hvx_params | Pointer to an HVx parameters structure. If the p_data member contains a non-NULL pointer the attribute value will be updated with the contents pointed by it before sending the notification or indication. |
uint32_t sd_ble_gatts_include_add | ( | uint16_t | service_handle, |
uint16_t | inc_srvc_handle, | ||
uint16_t *const | p_include_handle | ||
) |
Add an include declaration to the local server ATT table.
[in] | service_handle | Handle of the service where the included service is to be placed, if BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. |
[in] | inc_srvc_handle | Handle of the included service. |
[out] | p_include_handle | Pointer to a 16-bit word where the assigned handle will be stored. |
uint32_t sd_ble_gatts_rw_authorize_reply | ( | uint16_t | conn_handle, |
ble_gatts_rw_authorize_reply_params_t const *const | p_rw_authorize_reply_params | ||
) |
Respond to a Read/Write authorization request.
[in] | conn_handle | Connection handle. |
[in] | p_rw_authorize_reply_params | Pointer to a structure with the attribute provided by the application. |
uint32_t sd_ble_gatts_service_add | ( | uint8_t | type, |
ble_uuid_t const *const | p_uuid, | ||
uint16_t *const | p_handle | ||
) |
Add a service declaration to the local server ATT table.
[in] | type | Toggles between primary and secondary services, see GATT Server Service Types. |
[in] | p_uuid | Pointer to service UUID. |
[out] | p_handle | Pointer to a 16-bit word where the assigned handle will be stored. |
uint32_t sd_ble_gatts_service_changed | ( | uint16_t | conn_handle, |
uint16_t | start_handle, | ||
uint16_t | end_handle | ||
) |
Indicate the Service Changed attribute value.
This call will send a Handle Value Indication to one or more peers connected to inform them that the attribute table layout has changed. As soon as the peer has confirmed the indication, a BLE_GATTS_EVT_SC_CONFIRM event will be issued.
[in] | conn_handle | Connection handle. |
[in] | start_handle | Start of affected attribute handle range. |
[in] | end_handle | End of affected attribute handle range. |
uint32_t sd_ble_gatts_sys_attr_get | ( | uint16_t | conn_handle, |
uint8_t *const | p_sys_attr_data, | ||
uint16_t *const | p_len | ||
) |
Retrieve persistent system attribute information from the stack.
This call is used to retrieve information about values to be stored perisistently by the application after a connection has been terminated. When a new connection is made to the same bond, the values should be restored using sd_ble_gatts_sys_attr_set. The data should be read before any new advertising is started, or any new connection established. The connection handle for the previous now defunct connection will remain valid until a new one is created to allow this API call to refer to it.
[in] | conn_handle | Connection handle of the recently terminated connection. |
[in] | p_sys_attr_data | Pointer to a buffer where updated information about system attributes will be filled in. NULL can be provided to obtain the length of the data |
[in,out] | p_len | Size of application buffer if p_sys_attr_data is not NULL. Unconditially updated to actual length of system attribute data. |
uint32_t sd_ble_gatts_sys_attr_set | ( | uint16_t | conn_handle, |
uint8_t const *const | p_sys_attr_data, | ||
uint16_t | len | ||
) |
Update persistent system attribute information.
Supply to the stack information about persistent system attributes. This call is legal in the connected state only, and is usually made immediately after a connection is established and the bond identified. usually as a response to a BLE_GATTS_EVT_SYS_ATTR_MISSING.
p_sysattrs may point directly to the application's stored copy of the struct. If the pointer is NULL, the system attribute info is initialized, assuming that the application does not have any previously saved data for this bond.
[in] | conn_handle | Connection handle. |
[in] | p_sys_attr_data | Pointer to a saved copy of system attributes supplied to the stack, or NULL. |
[in] | len | Size of data pointed by p_sys_attr_data, in octets. |
uint32_t sd_ble_gatts_value_get | ( | uint16_t | handle, |
uint16_t | offset, | ||
uint16_t *const | p_len, | ||
uint8_t *const | p_data | ||
) |
Get the value of a given attribute.
[in] | handle | Attribute handle. |
[in] | offset | Offset in bytes to read from. |
[in,out] | p_len | Length in bytes to be read, total length of attribute value (in bytes, starting from offset) after successful return. |
[in,out] | p_data | Pointer to a buffer (at least len bytes long) where to store the attribute value. Set to NULL to obtain the complete length of attribute value. |
uint32_t sd_ble_gatts_value_set | ( | uint16_t | handle, |
uint16_t | offset, | ||
uint16_t *const | p_len, | ||
uint8_t const *const | p_value | ||
) |
Set the value of a given attribute.
[in] | handle | Attribute handle. |
[in] | offset | Offset in bytes to write from. |
[in,out] | p_len | Length in bytes to be written, length in bytes written after successful return. |
[in] | p_value | Pointer to a buffer (at least len bytes long) containing the desired attribute value. If value is stored in user memory, only the attribute length is updated when p_value == NULL. |