XDK API  3.6.0
Documentation
Files | Data Structures | Typedefs | Enumerations | Functions

This module handles the BLE peripheral feature. More...

+ Collaboration diagram for BLE:

Files

file  XDK_BLE.h
 
file  XDK_SensorServices.h
 

Data Structures

struct  BLE_DeviceCharacteristicsValue_S
 Structure to represent the BLE device characteristics values. More...
 
struct  BLE_Setup_S
 struct to represent the BLE setup features. More...
 
struct  SensorServices_Info_S
 Structure to represent the node sensor service informations. More...
 

Typedefs

typedef void(* BLE_DataRxCB_T )(uint8_t *rxBuffer, uint8_t rxDataLength, void *param)
 Typedef to notify the application about any incoming data. More...
 
typedef struct
BLE_DeviceCharacteristicsValue_S 
BLE_DeviceCharacteristicsValue_T
 Typedef to represent the BLE device characteristics value. More...
 
typedef enum BLE_Service_E BLE_Service_T
 Typedef to represent the BLE service supported. More...
 
typedef struct BLE_Setup_S BLE_Setup_T
 Typedef to represent the BLE setup feature. More...
 
typedef enum SensorService_Type_E SensorService_Type_T
 Typedef to represent the sensor service type. More...
 
typedef enum
SensorServices_EnvironmentalType_E 
SensorServices_EnvironmentalType_T
 Typedef to represent the environmental service characteristic. More...
 
typedef enum
SensorServices_HighDataRateType_E 
SensorServices_HighDataRateType_T
 Typedef to represent the high data rate service characteristic. More...
 
typedef struct
SensorServices_Info_S 
SensorServices_Info_T
 Typedef to represent the node sensor service information. More...
 
typedef enum
SensorServices_MagnetometerType_E 
SensorServices_MagnetometerType_T
 typedef to represent the magnetometer service characteristic More...
 
typedef enum
SensorServices_SensorAxisType_E 
SensorServices_SensorAxisType_T
 Typedef to represent the sensor axis type for accelerometer and gyro services. More...
 
typedef enum
SensorServices_SensorControlNode_E 
SensorServices_SensorControlNode_T
 Typedef to control the node. More...
 

Enumerations

enum  BLE_Service_E
 Enum to represent the BLE services supported. More...
 
enum  SensorService_Type_E
 Typedef to represent the sensor service types. More...
 
enum  SensorServices_EnvironmentalType_E
 Enumeration to represent the environmental service characteristics. More...
 
enum  SensorServices_HighDataRateType_E
 Enumeration to represent the high data rate service characteristics. More...
 
enum  SensorServices_MagnetometerType_E
 Enumeration to represent the magnetometer service characteristics. More...
 
enum  SensorServices_SensorAxisType_E
 Enumeration to represent the sensor axis types for accelerometer and gyro services. More...
 
enum  SensorServices_SensorControlNode_E
 Enumeration to control the nodes. More...
 

Functions

Retcode_T BLE_Enable (void)
 This will enable the BLE. More...
 
bool BLE_IsConnected (void)
 This will tell if any peer is connected via BLE. More...
 
Retcode_T BLE_SendData (uint8_t *dataToSend, uint8_t dataToSendLen, void *param, uint32_t timeout)
 This will send the data via BLE. More...
 
Retcode_T BLE_Setup (BLE_Setup_T *setup)
 This will setup the BLE. More...
 

Detailed Description

The Sensor Services is a set of custom services, that provides a raw byte array payload communication as well as several sensor data services.

The Sensor Services is a set of custom services, that provides a raw byte array payload communication as well as several sensor data services, see SensorService_Type_E.


Data Structure Documentation

struct BLE_DeviceCharacteristicsValue_S

Data Fields

uint8_t * Manufacturer
 
uint8_t * ModelNumber
 
uint8_t * SoftwareRevision
 

Field Documentation

uint8_t* Manufacturer

Pointer to the device manufacturer

uint8_t* ModelNumber

Pointer to the device model number

uint8_t* SoftwareRevision

Pointer to the device software revision

struct BLE_Setup_S
+ Collaboration diagram for BLE_Setup_S:

Data Fields

BLE_DeviceCharacteristicsValue_T CharacteristicValue
 
BlePeripheral_ServiceRegistryCallback CustomServiceRegistryCB
 
BLE_DataRxCB_T DataRxCB
 
const char * DeviceName
 
bool IsDeviceCharacteristicEnabled
 
bool IsMacAddrConfigured
 
uint64_t MacAddr
 
BLE_Service_T Service
 

Field Documentation

BLE_DeviceCharacteristicsValue_T CharacteristicValue

BLE characteristic value. Unused if IsDeviceCharacteristicEnabled is false.

BlePeripheral_ServiceRegistryCallback CustomServiceRegistryCB

Custom service callback. Unused if Service is not BLE_USER_CUSTOM_SERVICE.

BLE_DataRxCB_T DataRxCB

Data receive callback. Unused if Service is BLE_USER_CUSTOM_SERVICE.

const char* DeviceName

Pointer to the device name

bool IsDeviceCharacteristicEnabled

Boolean if device characteristics value should be added to the service information

bool IsMacAddrConfigured

Boolean representing if the MAC address is to be configured

uint64_t MacAddr

MAC Address to be configured. Unused if IsMacAddrConfigured is false

BLE_Service_T Service

BLE peripheral service type

struct SensorServices_Info_S
Note
The sensorServiceType will represent one of the valid SensorService_Type_T values. Based on this the sensorServiceContent will change.
sensorServiceType sensorServiceContent
BLE_SENSOR_ACCELEROMETER SensorServices_SensorAxisType_T
BLE_SENSOR_GYRO SensorServices_SensorAxisType_T
BLE_SENSOR_LIGHT unused
BLE_SENSOR_NOISE unused
BLE_SENSOR_MAGNETOMETER SensorServices_MagnetometerType_T
BLE_SENSOR_ENVIRONMENTAL SensorServices_EnvironmentalType_T
BLE_HIGH_DATA_RATE SensorServices_HighDataRateType_T
BLE_CONTROL_NODE SensorServices_SensorControlNode_T

Data Fields

uint8_t sensorServicesContent
 
uint8_t sensorServicesType
 

Field Documentation

uint8_t sensorServicesContent

Sensor service content

uint8_t sensorServicesType

Sensor service type

Typedef Documentation

typedef void(* BLE_DataRxCB_T)(uint8_t *rxBuffer, uint8_t rxDataLength, void *param)
Parameters
[in]rxBufferpointer to the received data buffer
[in]rxDataLengthLength of the received data
[in]paramunused if setup->Service is not BLE_XDK_SENSOR_SERVICES. Otherwise, of type SensorServices_Info_T pointer.
Note
Do not perform any heavy processing within this function and return ASAP.
typedef struct BLE_Setup_S BLE_Setup_T

Typedef to control the node.

Enumeration Type Documentation

Enumerator
BLE_BCDS_BIDIRECTIONAL_SERVICE 
BLE_XDK_SENSOR_SERVICES 
BLE_XDK_GRIDEYE_SERVICE 
BLE_USER_CUSTOM_SERVICE 
Enumerator
BLE_SENSOR_ACCELEROMETER 

accelerometer sensor service

BLE_SENSOR_GYRO 

gyro sensor service

BLE_SENSOR_LIGHT 

light sensor service

BLE_SENSOR_NOISE 

noise sensor service

BLE_SENSOR_MAGNETOMETER 

magnetometer sensor service

BLE_SENSOR_ENVIRONMENTAL 

environmental sensor service

BLE_HIGH_DATA_RATE 

bidirectional raw data service

BLE_CONTROL_NODE 

control service

BLE_SENSOR_MAX 

Maximum limit for BLE Data Exchange service

Enumerator
SENSOR_ENVIRONMENTAL_PRESSURE 

pressure sensor

SENSOR_ENVIRONMENTAL_TEMPERATURE 

temperature sensor

SENSOR_ENVIRONMENTAL_HUMIDITY 

humidity sensor

Enumerator
HIGH_DATA_RATE_HIGH_PRIO 

high priority array

HIGH_DATA_RATE_LOW_PRIO 

low priority array

HIGH_DATA_RATE_MAX 
Enumerator
SENSOR_MAGNETOMETER_AXIS_X 

X axis

SENSOR_MAGNETOMETER_AXIS_Y 

X axis

SENSOR_MAGNETOMETER_AXIS_Z 

Z axis

SENSOR_MAGNETOMETER_RESISTANCE 

resistance

SENSOR_MAGNETOMETER_MAX 
Enumerator
SENSOR_AXIS_X 

X axis

SENSOR_AXIS_Y 

Y axis

SENSOR_AXIS_Z 

Z axis

SENSOR_AXIS_MAX 
Enumerator
CONTROL_NODE_START_SAMPLING 

start sampling

CONTROL_NODE_CHANGE_SAMPLING_RATE 

change sampling rate

CONTROL_NODE_REBOOT 

reboot

CONTROL_NODE_GET_FW_VERSION 

get firmware version

CONTROL_NODE_USE_SENSOR_FUSION 

use sensor fusion

CONTROL_NODE_MAX 

Function Documentation

Retcode_T BLE_Enable ( void  )
Returns
RETCODE_OK on success, or an error code otherwise.
Note
  • BLE_Setup must have been successful prior.
  • Do not call this API more than once.

+ Here is the caller graph for this function:

bool BLE_IsConnected ( void  )
Returns
Boolean representing if a peer is connected or not.

+ Here is the caller graph for this function:

Retcode_T BLE_SendData ( uint8_t *  dataToSend,
uint8_t  dataToSendLen,
void *  param,
uint32_t  timeout 
)
Parameters
[in]dataToSendThe payload to be sent
[in]dataToSendLenThe length of the payload to be sent
[in]paramunused if setup->Service is not BLE_XDK_SENSOR_SERVICES. Otherwise, type casted to SensorServices_Info_T pointer.
[in]timeoutTimeout for the payload to be sent
Returns
RETCODE_OK on success, or an error code otherwise.
Return values
RETCODE_BLE_NOT_CONNECTEDif there is no peer connected.
Note
  • BLE_Setup must have been successful prior.
  • Do not call this API more than once.
  • This is a blocking call guarded with a mutex of wait time of 1 second.
  • This supports only BLE_BCDS_BIDIRECTIONAL_SERVICE and BLE_XDK_SENSOR_SERVICES.

+ Here is the caller graph for this function:

Retcode_T BLE_Setup ( BLE_Setup_T setup)
Parameters
[in]setupPointer to the BLE setup feature
Returns
RETCODE_OK on success, or an error code otherwise.
Note
  • This must be the first API to be called if BLE feature is to be used.
  • Do not call this API more than once.

+ Here is the caller graph for this function:


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:50 by doxygen 1.8.8