PebbleOS v4.45.0-179-g439c45a48
Loading...
Searching...
No Matches

Pebble protocol over GATT (PPoGATT), a client of the phone's PPoGATT service. More...

Enumerations

enum  pbl_pp_gatt_characteristic { PBL_PP_GATT_CHARACTERISTIC_DATA , PBL_PP_GATT_CHARACTERISTIC_META , PBL_PP_GATT_CHARACTERISTIC_NUM }
 Characteristics of the PPoGATT service, in discovery order. More...
 

Functions

void pbl_pp_gatt_create (void)
 Start, once the Bluetooth stack is up.
 
void pbl_pp_gatt_destroy (void)
 Stop, closing every session.
 
void pbl_pp_gatt_handle_service_discovered (pbl_bt_characteristic_t *characteristics)
 Handle a discovered PPoGATT service.
 
void pbl_pp_gatt_handle_service_removed (pbl_bt_characteristic_t *characteristics, uint8_t num_characteristics)
 Handle a removed PPoGATT service.
 
void pbl_pp_gatt_invalidate_all_references (void)
 Forget every characteristic handle, e.g.
 
bool pbl_pp_gatt_can_handle_characteristic (pbl_bt_characteristic_t characteristic)
 Check whether a characteristic belongs to a PPoGATT service.
 
void pbl_pp_gatt_handle_subscribe (pbl_bt_characteristic_t characteristic, BLESubscription subscription_type, enum pbl_bt_gatt_error error)
 Handle a subscription confirmation.
 
void pbl_pp_gatt_handle_read_or_notification (pbl_bt_characteristic_t characteristic, const uint8_t *value, size_t value_length, enum pbl_bt_gatt_error error)
 Handle a read response or a notification.
 
void pbl_pp_gatt_reset_disconnect_counter (void)
 Clear the count of disconnections caused by repeated resets.
 

Variables

const Uuid pbl_pp_gatt_service_uuid
 UUID of the phone's PPoGATT service.
 
const Uuid pbl_pp_gatt_characteristic_uuids [PBL_PP_GATT_CHARACTERISTIC_NUM]
 UUIDs of the service's characteristics, indexed by pbl_pp_gatt_characteristic.
 

Detailed Description

Pebble protocol over GATT (PPoGATT), a client of the phone's PPoGATT service.

The kernel LE client dispatches the GATT events of the service to these functions.

Enumeration Type Documentation

◆ pbl_pp_gatt_characteristic

Characteristics of the PPoGATT service, in discovery order.

Enumerator
PBL_PP_GATT_CHARACTERISTIC_DATA 
PBL_PP_GATT_CHARACTERISTIC_META 
PBL_PP_GATT_CHARACTERISTIC_NUM 

Function Documentation

◆ pbl_pp_gatt_can_handle_characteristic()

bool pbl_pp_gatt_can_handle_characteristic ( pbl_bt_characteristic_t  characteristic)

Check whether a characteristic belongs to a PPoGATT service.

Parameters
characteristicCharacteristic handle.
Returns
true if the transport handles characteristic.

◆ pbl_pp_gatt_create()

void pbl_pp_gatt_create ( void  )

Start, once the Bluetooth stack is up.

◆ pbl_pp_gatt_destroy()

void pbl_pp_gatt_destroy ( void  )

Stop, closing every session.

◆ pbl_pp_gatt_handle_read_or_notification()

void pbl_pp_gatt_handle_read_or_notification ( pbl_bt_characteristic_t  characteristic,
const uint8_t *  value,
size_t  value_length,
enum pbl_bt_gatt_error  error 
)

Handle a read response or a notification.

Parameters
characteristicCharacteristic handle.
valueValue read or notified.
value_lengthLength of value in bytes.
errorGATT error, if any.

◆ pbl_pp_gatt_handle_service_discovered()

void pbl_pp_gatt_handle_service_discovered ( pbl_bt_characteristic_t *  characteristics)

Handle a discovered PPoGATT service.

Parameters
characteristicsHandles of the characteristics, indexed by pbl_pp_gatt_characteristic.

◆ pbl_pp_gatt_handle_service_removed()

void pbl_pp_gatt_handle_service_removed ( pbl_bt_characteristic_t *  characteristics,
uint8_t  num_characteristics 
)

Handle a removed PPoGATT service.

Parameters
characteristicsHandles of the removed characteristics.
num_characteristicsNumber of handles.

◆ pbl_pp_gatt_handle_subscribe()

void pbl_pp_gatt_handle_subscribe ( pbl_bt_characteristic_t  characteristic,
BLESubscription  subscription_type,
enum pbl_bt_gatt_error  error 
)

Handle a subscription confirmation.

Parameters
characteristicCharacteristic handle.
subscription_typeSubscription now in effect.
errorGATT error, if any.

◆ pbl_pp_gatt_invalidate_all_references()

void pbl_pp_gatt_invalidate_all_references ( void  )

Forget every characteristic handle, e.g.

on disconnection.

◆ pbl_pp_gatt_reset_disconnect_counter()

void pbl_pp_gatt_reset_disconnect_counter ( void  )

Clear the count of disconnections caused by repeated resets.

Variable Documentation

◆ pbl_pp_gatt_characteristic_uuids

const Uuid pbl_pp_gatt_characteristic_uuids[PBL_PP_GATT_CHARACTERISTIC_NUM]
extern

UUIDs of the service's characteristics, indexed by pbl_pp_gatt_characteristic.

◆ pbl_pp_gatt_service_uuid

const Uuid pbl_pp_gatt_service_uuid
extern

UUID of the phone's PPoGATT service.