XDK API  3.6.0
Documentation
Files | Typedefs | Functions
Bidirectional Service

The BCDS bidirectional communication service is a custom service, that provides a raw byte array payload communication. More...

+ Collaboration diagram for Bidirectional Service:

Files

file  BCDS_BidirectionalService.h
 

Typedefs

typedef void(* BidirectionalService_DataReceivedCallBack )(uint8_t *rxBuffer, uint8_t rxDataLength)
 Typedef to notify the application about any incoming data. More...
 
typedef void(* BidirectionalService_SendEventCallback )(Retcode_T sendStatus)
 Typedef to send status notification. More...
 

Functions

Retcode_T BidirectionalService_Init (BidirectionalService_DataReceivedCallBack readCallback, BidirectionalService_SendEventCallback sendCallback)
 Initializes the Bidirectional Service. More...
 
Retcode_T BidirectionalService_Register (void)
 Registers the BidirectionalService at the ATT server. More...
 
Retcode_T BidirectionalService_SendData (uint8_t *payload, uint8_t payloadLen)
 Sends data to the client. More...
 

Detailed Description

The BCDS bidirectional communication service is a custom service, that provides a raw byte array payload communication. It offers a single service UUID (0x1B, 0xC5, 0xD5, 0xA5, 0x02, 0x00, 0x97, 0xB7, 0xE6, 0x11, 0xFA, 0x1C, 0xC0, 0x75, 0xE8, 0xB9) with two characteristics: rx characteristic and tx characteristic, which provide the reading and writing of arbitrary byte arrays.

Typedef Documentation

typedef void(* BidirectionalService_DataReceivedCallBack)(uint8_t *rxBuffer, uint8_t rxDataLength)

Typedef to notify the application about any incoming data

Parameters
[in]rxBufferpointer to the received data buffer
[in]rxDataLengthLength of the received data
Note
Do not perform any heavy processing within this function and return asap.
typedef void(* BidirectionalService_SendEventCallback)(Retcode_T sendStatus)

Typedef to send status notification.

Parameters
[in]sendStatusStatus of the send operation
Note
For every single BidirectionalService_SendData, this must be synchronized before triggering a new send. If the interface user wants to have a queuing mechanism for sending data where the user need not worry about this notification and shall load the send API per need, it is excepted to be implemented as a wrapper at the application end on top of this.
Do not perform any heavy processing within this function and return asap.

Function Documentation

Retcode_T BidirectionalService_Init ( BidirectionalService_DataReceivedCallBack  readCallback,
BidirectionalService_SendEventCallback  sendCallback 
)

Initializes the Bidirectional Service with a readCallback and a sendCallback to be implemented by the application.

Parameters
[in]readCallbackApplication Callback that will be called on data reception for any data reception
[in]sendCallbackApplication Callback that will be notified about the data send status.
Returns
RETCODE_OK on success, or an error code otherwise. Refer Retcode_General_E and Ble_Retcode_E for other values.
See also
BidirectionalService_SendData
Retcode_T BidirectionalService_Register ( void  )

Registers the BidirectionalService at the ATT server. This must be done during the boot phase of the stack.

See also
BlePeripheral_ServiceRegistryCallback
Returns
RETCODE_OK on success, or an error code otherwise. Refer Retcode_General_E and Ble_Retcode_E for other values.
Note
Bidirectional Services must have been successfully initialized prior to this call.
Retcode_T BidirectionalService_SendData ( uint8_t *  payload,
uint8_t  payloadLen 
)

Sends the provided data to the client

Parameters
[in]dataToSendThe payload to be sent
[in]dataToSendLenThe length of the payload to be sent
Returns
RETCODE_OK on success, or an error code otherwise. Refer Retcode_General_E and Ble_Retcode_E for other values.
Note
Bidirectional Service must have been successfully initialized and registered prior. BidirectionalService_SendEventCallback will be triggered to provide the status of every individual send's. BidirectionalService_SendData may only be called again, when BidirectionalService_SendEventCallback has been called as a reaction to a previous call of BidirectionalService_SendData.

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:51 by doxygen 1.8.8