![]() |
Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
|
Functions | |
ble_status_t | R_BLE_GATTC_Init (uint8_t cb_num) |
This function initializes the GATT Client and registers the number of the callbacks for GATT Client event. More... | |
ble_status_t | R_BLE_GATTC_RegisterCb (ble_gattc_app_cb_t cb, uint8_t priority) |
This function registers a callback function for GATT Client event. More... | |
ble_status_t | R_BLE_GATTC_DeregisterCb (ble_gattc_app_cb_t cb) |
This function deregisters the callback function for GATT Client event. More... | |
ble_status_t | R_BLE_GATTC_ReqExMtu (uint16_t conn_hdl, uint16_t mtu) |
This function sends a MTU Exchange Request PDU to a GATT Server in order to change the current MTU. More... | |
ble_status_t | R_BLE_GATTC_DiscAllPrimServ (uint16_t conn_hdl) |
This function discovers all Primary Services in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_DiscPrimServ (uint16_t conn_hdl, uint8_t *p_uuid, uint8_t uuid_type) |
This function discovers Primary Service specified by p_uuid in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_DiscAllSecondServ (uint16_t conn_hdl) |
This function discovers all Secondary Services in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_DiscIncServ (uint16_t conn_hdl, st_ble_gatt_hdl_range_t *p_range) |
This function discovers Included Services within the specified attribute handle range in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_DiscAllChar (uint16_t conn_hdl, st_ble_gatt_hdl_range_t *p_range) |
This function discovers Characteristic within the specified attribute handle range in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_DiscCharByUuid (uint16_t conn_hdl, uint8_t *p_uuid, uint8_t uuid_type, st_ble_gatt_hdl_range_t *p_range) |
This function discovers Characteristic specified by uuid within the specified attribute handle range in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_DiscAllCharDesc (uint16_t conn_hdl, st_ble_gatt_hdl_range_t *p_range) |
This function discovers Characteristic Descriptor within the specified attribute handle range in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_ReadChar (uint16_t conn_hdl, uint16_t value_hdl) |
This function reads a Characteristic/Characteristic Descriptor in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_ReadCharUsingUuid (uint16_t conn_hdl, uint8_t *p_uuid, uint8_t uuid_type, st_ble_gatt_hdl_range_t *p_range) |
This function reads a Characteristic in a GATT Server using a specified UUID. More... | |
ble_status_t | R_BLE_GATTC_ReadLongChar (uint16_t conn_hdl, uint16_t value_hdl, uint16_t offset) |
This function reads a Long Characteristic in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_ReadMultiChar (uint16_t conn_hdl, st_ble_gattc_rd_multi_req_param_t *p_list) |
This function reads multiple Characteristics in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_WriteCharWithoutRsp (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_write_data) |
This function writes a Characteristic in a GATT Server without response. More... | |
ble_status_t | R_BLE_GATTC_SignedWriteChar (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_write_data) |
This function writes Signed Data to a Characteristic in a GATT Server without response. More... | |
ble_status_t | R_BLE_GATTC_WriteChar (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_write_data) |
This function writes a Characteristic in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_WriteLongChar (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_write_data, uint16_t offset) |
This function writes a Long Characteristic in a GATT Server. More... | |
ble_status_t | R_BLE_GATTC_ReliableWrites (uint16_t conn_hdl, st_ble_gattc_reliable_writes_char_pair_t *p_char_pair, uint8_t pair_num, uint8_t auto_flag) |
This function performs the Reliable Writes procedure described in GATT Specification. More... | |
ble_status_t | R_BLE_GATTC_ExecWrite (uint16_t conn_hdl, uint8_t exe_flag) |
If the auto execute of Reliable Writes is not specified by R_BLE_GATTC_ReliableWrites(), this function is used to execute a write to Characteristic. More... | |
ble_status_t R_BLE_GATTC_Init | ( | uint8_t | cb_num | ) |
This function initializes the GATT Client and registers the number of the callbacks for GATT Client event.
Specify the cb_num parameter to a value between 1 and BLE_GATTC_MAX_CB.
R_BLE_GATTC_RegisterCb() registers the callback.
The result of this API call is returned by a return value.
[in] | cb_num | The number of callbacks to be registered. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_ARG(0x0003) | The cb_num parameter is out of range. |
Events
none
Message Sequence Chart
ble_status_t R_BLE_GATTC_RegisterCb | ( | ble_gattc_app_cb_t | cb, |
uint8_t | priority | ||
) |
This function registers a callback function for GATT Client event.
The number of the callback that may be registered by this function is the value specified by R_BLE_GATTC_Init().
The result of this API call is returned by a return value.
[in] | cb | Callback function for GATT Client event. |
[in] | priority | The priority of the callback function. Valid range is 1 <= priority <= BLE_GATTC_MAX_CB. A lower priority number means a higher priority level. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The cb parameter is specified as NULL. |
BLE_ERR_INVALID_ARG(0x0003) | The priority parameter is out of range. |
BLE_ERR_CONTEXT_FULL(0x000B) | Host stack has already registered the maximum number of callbacks. |
Events
none
Message Sequence Chart
ble_status_t R_BLE_GATTC_DeregisterCb | ( | ble_gattc_app_cb_t | cb | ) |
This function deregisters the callback function for GATT Client event.
The result of this API call is returned by a return value.
[in] | cb | The callback function to be deregistered. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The cb parameter is specified as NULL. |
BLE_ERR_NOT_FOUND(0x000D) | The callback has not been registered. |
Events
none
ble_status_t R_BLE_GATTC_ReqExMtu | ( | uint16_t | conn_hdl, |
uint16_t | mtu | ||
) |
This function sends a MTU Exchange Request PDU to a GATT Server in order to change the current MTU.
MTU Exchange Response is notified by BLE_GATTC_EVENT_EX_MTU_RSP event.
The new MTU is the minimum value of the mtu parameter specified by this function and the mtu field in BLE_GATTC_EVENT_EX_MTU_RSP event.
Default MTU size is 23 bytes.
The result of this API call is returned by a return value.
[in] | conn_hdl | Connection handle identifying the GATT Server to be sent. |
[in] | mtu | The maximum size(in bytes) of the GATT PDU that GATT Client can receive. Valid range is 23 <= mtu <= 247. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_ARG(0x0003) | The mtu parameter is out of range. |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_DiscAllPrimServ | ( | uint16_t | conn_hdl | ) |
This function discovers all Primary Services in a GATT Server.
When 16-bit UUID Primary Service has been discovered, BLE_GATTC_EVENT_PRIM_SERV_16_DISC_IND event is notified to the application layer.
When 128-bit UUID Primary Service has been discovered, BLE_GATTC_EVENT_PRIM_SERV_128_DISC_IND event is notified to the application layer.
When the Primary Service discovery has been completed, BLE_GATTC_EVENT_ALL_PRIM_SERV_DISC_COMP event is notified to the application layer.
[in] | conn_hdl | Connection handle identifying the GATT Server to be discovered. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_OPERATION(0x0009) | This function was called while processing other request. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_DiscPrimServ | ( | uint16_t | conn_hdl, |
uint8_t * | p_uuid, | ||
uint8_t | uuid_type | ||
) |
This function discovers Primary Service specified by p_uuid in a GATT Server.
When Primary Service whose uuid is the same as the specified uuid has been discovered, BLE_GATTC_EVENT_PRIM_SERV_16_DISC_IND event or BLE_GATTC_EVENT_PRIM_SERV_128_DISC_IND event is notified to the application layer.
When the Primary Service discovery has been completed, BLE_GATTC_EVENT_PRIM_SERV_DISC_COMP event is notified to the application layer.
[in] | conn_hdl | Connection handle identifying the GATT Server to be discovered. | ||||||
[in] | p_uuid | UUID of Primary Service to be discovered. | ||||||
[in] | uuid_type | UUID type(16-bit or 128-bit).
|
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_uuid parameter is specified as NULL. |
BLE_ERR_INVALID_ARG(0x0003) | The uuid_type parameter is out of range. |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_DiscAllSecondServ | ( | uint16_t | conn_hdl | ) |
This function discovers all Secondary Services in a GATT Server.
When a 16-bit UUID Secondary Service has been discovered, BLE_GATTC_EVENT_SECOND_SERV_16_DISC_IND event is notified to the application layer.
When a 128-bit UUID Secondary Service has been discovered, BLE_GATTC_EVENT_SECOND_SERV_128_DISC_IND event is notified to the application layer.
When the Secondary Service discovery has been completed, BLE_GATTC_EVENT_ALL_SECOND_SERV_DISC_COMP event is notified to the application layer.
[in] | conn_hdl | Connection handle identifying the GATT Server to be discovered. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_DiscIncServ | ( | uint16_t | conn_hdl, |
st_ble_gatt_hdl_range_t * | p_range | ||
) |
This function discovers Included Services within the specified attribute handle range in a GATT Server.
When Included Service that includes 16-bit UUID Service has been discovered, BLE_GATTC_EVENT_INC_SERV_16_DISC_IND event is notified to the application layer.
When Included Service that includes 128-bit UUID Service has been discovered, BLE_GATTC_EVENT_INC_SERV_128_DISC_IND event is notified to the application layer.
When the Included Service discovery has been completed, BLE_GATTC_EVENT_INC_SERV_DISC_COMP event is notified to the application layer.
[in] | conn_hdl | Connection handle identifying the GATT Server to be discovered. |
[in] | p_range | Retrieval range of Included Service. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_range parameter is specified as NULL. |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_DiscAllChar | ( | uint16_t | conn_hdl, |
st_ble_gatt_hdl_range_t * | p_range | ||
) |
This function discovers Characteristic within the specified attribute handle range in a GATT Server.
When 16-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_16_DISC_IND event is notified to the application layer.
When 128-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_128_DISC_IND event is notified to the application layer.
When the Characteristic discovery has been completed, BLE_GATTC_EVENT_ALL_CHAR_DISC_COMP event is notified to the application layer.
[in] | conn_hdl | Connection handle identifying the GATT Server to be discovered. |
[in] | p_range | Retrieval range of Characteristic. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_range parameter is specified as NULL. |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_DiscCharByUuid | ( | uint16_t | conn_hdl, |
uint8_t * | p_uuid, | ||
uint8_t | uuid_type, | ||
st_ble_gatt_hdl_range_t * | p_range | ||
) |
This function discovers Characteristic specified by uuid within the specified attribute handle range in a GATT Server.
When 16-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_16_DISC_IND event is notified to the application layer.
When 128-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_128_DISC_IND event is notified to the application layer.
When the Characteristic discovery has been completed, BLE_GATTC_EVENT_CHAR_DISC_COMP event is notified to the application layer.
[in] | conn_hdl | Connection handle identifying the GATT Server to be discovered. | ||||||
[in] | p_uuid | UUID of Characteristic to be discovered. | ||||||
[in] | uuid_type | UUID type of Characteristic to be discovered.
| ||||||
[in] | p_range | Retrieval range of Characteristic. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_uuid parameter or the p_range parameter is specified as NULL. |
BLE_ERR_INVALID_ARG(0x0003) | The uuid_type parameter is out of range. |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_DiscAllCharDesc | ( | uint16_t | conn_hdl, |
st_ble_gatt_hdl_range_t * | p_range | ||
) |
This function discovers Characteristic Descriptor within the specified attribute handle range in a GATT Server.
When 16-bit UUID Characteristic Descriptor has been discovered, BLE_GATTC_EVENT_CHAR_DESC_16_DISC_IND event is notified to the application layer.
When 128-bit UUID Characteristic Descriptor has been discovered, BLE_GATTC_EVENT_CHAR_DESC_128_DISC_IND event is notified to the application layer.
When the Characteristic Descriptor discovery has been completed, BLE_GATTC_EVENT_ALL_CHAR_DESC_DISC_COMP event is notified to the application layer.
[in] | conn_hdl | Connection handle identifying the GATT Server to be discovered. |
[in] | p_range | Retrieval range of Characteristic Descriptor. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_range parameter is specified as NULL. |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_ReadChar | ( | uint16_t | conn_hdl, |
uint16_t | value_hdl | ||
) |
This function reads a Characteristic/Characteristic Descriptor in a GATT Server.
The result of the read is notified in BLE_GATTC_EVENT_CHAR_READ_RSP event.
[in] | conn_hdl | Connection handle identifying the GATT Server to be read. |
[in] | value_hdl | Value handle of the Characteristic/Characteristic Descriptor to be read. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_ARG(0x0003) | 0 is specified in the value_hdl parameter. |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_ReadCharUsingUuid | ( | uint16_t | conn_hdl, |
uint8_t * | p_uuid, | ||
uint8_t | uuid_type, | ||
st_ble_gatt_hdl_range_t * | p_range | ||
) |
This function reads a Characteristic in a GATT Server using a specified UUID.
The result of the read is notified in BLE_GATTC_EVENT_CHAR_READ_BY_UUID_RSP event.
[in] | conn_hdl | Connection handle that identifies Characteristic to be read to GATT Server. | ||||||
[in] | p_uuid | UUID of the Characteristic to be read. | ||||||
[in] | uuid_type | UUID type of the Characteristic to be read.
| ||||||
[in] | p_range | Retrieval range of Characteristic. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_uuid parameter or the p_range parameter is specified as NULL. |
BLE_ERR_INVALID_ARG(0x0003) | The uuid_type parameter is out of range. |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_ReadLongChar | ( | uint16_t | conn_hdl, |
uint16_t | value_hdl, | ||
uint16_t | offset | ||
) |
This function reads a Long Characteristic in a GATT Server.
The contents of the Long Characteristic that has been read is notified every MTU-1 bytes to the application layer by BLE_GATTC_EVENT_CHAR_READ_RSP event.
When all of the contents has been received in GATT Client, BLE_GATTC_EVENT_LONG_CHAR_READ_COMP event is notified to the application layer.
[in] | conn_hdl | Connection handle identifying the GATT Server to be read. |
[in] | value_hdl | Value handle of the Long Characteristic to be read. |
[in] | offset | Offset that indicates the location to be read. Normally, set 0 to this parameter. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_ARG(0x0003) | 0 is specified in the value_hdl parameter. |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_ReadMultiChar | ( | uint16_t | conn_hdl, |
st_ble_gattc_rd_multi_req_param_t * | p_list | ||
) |
This function reads multiple Characteristics in a GATT Server.
The contents of the multiple Characteristics that has been read is notified to the application layer by BLE_GATTC_EVENT_MULTI_CHAR_READ_RSP event.
[in] | conn_hdl | Connection handle that identifies Characteristic to be read to GATT Server. |
[in] | p_list | List of Value Handles that point the Characteristics to be read. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_list parameter or the p_hdl_list field in the p_list parameter is specified as NULL. |
BLE_ERR_INVALID_ARG(0x0003) | 0 is specified in the list_count field in the p_list parameter. |
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_WriteCharWithoutRsp | ( | uint16_t | conn_hdl, |
st_ble_gatt_hdl_value_pair_t * | p_write_data | ||
) |
This function writes a Characteristic in a GATT Server without response.
The result is returned from the API.
[in] | conn_hdl | Connection handle that identifies Characteristic to be read to GATT Server. |
[in] | p_write_data | Value to be written to the Characteristic. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_write_data parameter or the p_value field in the value field in the p_write_data parameter is specified as NULL. |
BLE_ERR_INVALID_ARG(0x0003) | The reason for this error is as follows:
|
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
none
Message Sequence Chart
ble_status_t R_BLE_GATTC_SignedWriteChar | ( | uint16_t | conn_hdl, |
st_ble_gatt_hdl_value_pair_t * | p_write_data | ||
) |
This function writes Signed Data to a Characteristic in a GATT Server without response.
The result of this API call is returned by a return value.
[in] | conn_hdl | Connection handle identifying the GATT Server to be written. |
[in] | p_write_data | Signed Data to be written to the Characteristic. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_write_data parameter or the p_value field in the value field in the p_write_data parameter is specified as NULL. |
BLE_ERR_INVALID_ARG(0x0003) | The reason for this error is as follows:
|
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function or Signed Data. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
none
Message Sequence Chart
ble_status_t R_BLE_GATTC_WriteChar | ( | uint16_t | conn_hdl, |
st_ble_gatt_hdl_value_pair_t * | p_write_data | ||
) |
This function writes a Characteristic in a GATT Server.
The result of the write is notified in BLE_GATTC_EVENT_CHAR_WRITE_RSP event.
[in] | conn_hdl | Connection handle identifying the GATT Server to be written. |
[in] | p_write_data | Value to be written to the Characteristic. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_write_data parameter or the p_value field in the value field in the p_write_data parameter is specified as NULL. |
BLE_ERR_INVALID_ARG(0x0003) | The reason for this error is as follows:
|
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_WriteLongChar | ( | uint16_t | conn_hdl, |
st_ble_gatt_hdl_value_pair_t * | p_write_data, | ||
uint16_t | offset | ||
) |
This function writes a Long Characteristic in a GATT Server.
The result of a write that has been done every segmentation is notified to the application layer in BLE_GATTC_EVENT_CHAR_PART_WRITE_RSP event.
The maximum writable size to a Long Characteristic with this function is 512 bytes.
When all of the contents has been written to the Long Characteristic, BLE_GATTC_EVENT_LONG_CHAR_WRITE_COMP event is notified to the application layer.
[in] | conn_hdl | Connection handle identifying the GATT Server to be written. |
[in] | p_write_data | Value to be written to the Long Characteristic. |
[in] | offset | Offset that indicates the location to be written. Normally, set 0 to this parameter. If this parameter sets to a value other than 0, adjust the offset parameter and the length of the value to be written not to exceed the length of the Long Characteristic. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_write_data parameter or the p_value field in the value field in the p_write_data parameter is specified as NULL. |
BLE_ERR_INVALID_ARG(0x0003) | The reason for this error is as follows:
|
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_ReliableWrites | ( | uint16_t | conn_hdl, |
st_ble_gattc_reliable_writes_char_pair_t * | p_char_pair, | ||
uint8_t | pair_num, | ||
uint8_t | auto_flag | ||
) |
This function performs the Reliable Writes procedure described in GATT Specification.
When the data written to the Characteristic has been transmitted, BLE_GATTC_EVENT_CHAR_PART_WRITE_RSP event is notified to the application layer.
If the data included in the event is different from the data that GATT Client has sent, host stack automatically cancels the Reliable Writes.
After all of the contents has been sent to the GATT Server, if the auto_flag parameter has been set to BLE_GATTC_EXEC_AUTO, the GATT Server automatically writes the data to the Characteristic.
If the auto_flag parameter has been set to BLE_GATTC_EXEC_NOT_AUTO, BLE_GATTC_EVENT_RELIABLE_WRITES_TX_COMP event notifies the application layer in GATT Client that all of the contents has been sent to the GATT Server. Then GATT Client requests for writing the data to the Characteristic to the GATT Server with R_BLE_GATTC_ExecWrite().
When the write has been done, BLE_GATTC_EVENT_RELIABLE_WRITES_COMP event is notified to the application layer.
[in] | conn_hdl | Connection handle identifying the GATT Server to be written. | ||||||
[in] | p_char_pair | Pair of Characteristic Value and Characteristic Value Handle identifying the Characteristic to be written by Reliable Writes. | ||||||
[in] | pair_num | The number of the pairs specified by the p_char_pair parameter. Valid range is 0 < pair_num <= BLE_GATTC_RELIABLE_WRITES_MAX_CHAR_PAIR . | ||||||
[in] | auto_flag | The flag that indicates whether auto execution or not.
|
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The reason for this error is as follows:
|
BLE_ERR_INVALID_ARG(0x0003) | The reason for this error is as follows:
|
BLE_ERR_INVALID_OPERATION(0x0009) | While processing other request, this function was called. |
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function or to store the temporary write data. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart
ble_status_t R_BLE_GATTC_ExecWrite | ( | uint16_t | conn_hdl, |
uint8_t | exe_flag | ||
) |
If the auto execute of Reliable Writes is not specified by R_BLE_GATTC_ReliableWrites(), this function is used to execute a write to Characteristic.
When all of the contents has been sent to the GATT Server, BLE_GATTC_EVENT_RELIABLE_WRITES_TX_COMP event notifies the application layer.
After this event has been received, execute the write by this function.
The result of the write is notified by BLE_GATTC_EVENT_RELIABLE_WRITES_COMP event.
[in] | conn_hdl | Connection handle identifying the target GATT Server. | ||||||
[in] | exe_flag | The flag that indicates whether execution or cancellation.
|
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_ARG(0x0003) | The exe_flag parameter is out of range. |
BLE_ERR_INVALID_OPERATION(0x0009) | The reason for this error is as follows:
|
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
BLE_ERR_INVALID_HDL(0x000E) | The GATT Server specified by conn_hdl was not found. |
Events
Message Sequence Chart