BSB Developer Docs
Loading...
Searching...
No Matches
ble_service_config_types.h File Reference

Type definitions for describing services and characteristics Each service must be described using this struct and added to service_config collection under the corresponding index. More...

#include "../ble_log.h"
#include "../ble_callback_types.h"
#include "ble_service_index.h"

Go to the source code of this file.

Data Structures

struct  BleCharacteristicConfig
 Characteristic configuration. More...
 
struct  BleServiceConfig
 Service configuration. More...
 

Typedefs

typedef bool(* BleServiceInit) (void *instance)
 Type definition for init callback method.
 
typedef bool(* BleServiceRun) (void *instance, size_t data_size, const void *data)
 Type definition for run callback method.
 

Detailed Description

Type definitions for describing services and characteristics Each service must be described using this struct and added to service_config collection under the corresponding index.

Typedef Documentation

◆ BleServiceInit

typedef bool(* BleServiceInit) (void *instance)

Type definition for init callback method.

This method is called once during initialization process and can be used in order to create necessary context for service logic

Parameters
[in]instancepointer to BleServiceObject in a generic form
Returns
true when init is done, otherwise false

◆ BleServiceRun

typedef bool(* BleServiceRun) (void *instance, size_t data_size, const void *data)

Type definition for run callback method.

This method is called every time when BleServiceCommandRun is enqueued for the service. Run can be enqueued as a reaction to some logic event happened inside of a service. For example: Battery service has got an event regarding battery charge level from Power subsystem. Also data can be added to call

Parameters
[in]instancepointer to BleServiceObject in a generic form
[in]data_sizesize of incoming data
[in]datapointer to incoming data
Returns
true when run is done, otherwise false