Microchip® Advanced Software Framework

battery_service_server.c File Reference

Macros

#define __BTSTACK_FILE__   "battery_service_server.c"
 

Functions

static void battery_service_can_send_now (void *context)
 
static uint16_t battery_service_read_callback (hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
 
uint8_t battery_service_server_get_battery_value ()
 Return battery value. More...
 
void battery_service_server_init (uint8_t value)
 Implementation of the GATT Battery Service Server To use with your application, add '#import <battery_service.gatt' to your .gatt file. More...
 
void battery_service_server_set_battery_value (uint8_t value)
 Update battery value. More...
 
static int battery_service_write_callback (hci_con_handle_t con_handle, uint16_t attribute_handle, uint16_t transaction_mode, uint16_t offset, uint8_t *buffer, uint16_t buffer_size)
 

Variables

static
btstack_context_callback_registration_t 
battery_callback
 Implementation of the GATT Battery Service Server To use with your application, add '#import <battery_service.gatt' to your .gatt file. More...
 
static att_service_handler_t battery_service
 
static uint8_t battery_value
 
static uint16_t battery_value_client_configuration
 
static hci_con_handle_t battery_value_client_configuration_connection
 
static uint16_t battery_value_handle_client_configuration
 
static uint16_t battery_value_handle_value
 

#define __BTSTACK_FILE__   "battery_service_server.c"

static void battery_service_can_send_now ( void *  context)
static
static uint16_t battery_service_read_callback ( hci_con_handle_t  con_handle,
uint16_t  attribute_handle,
uint16_t  offset,
uint8_t *  buffer,
uint16_t  buffer_size 
)
static
uint8_t battery_service_server_get_battery_value ( )

Return battery value.

Note
triggers notifications if subscribed
Parameters
battery_valuein range 0-100

References battery_value.

Referenced by http_request().

void battery_service_server_set_battery_value ( uint8_t  battery_value)
static int battery_service_write_callback ( hci_con_handle_t  con_handle,
uint16_t  attribute_handle,
uint16_t  transaction_mode,
uint16_t  offset,
uint8_t *  buffer,
uint16_t  buffer_size 
)
static

btstack_context_callback_registration_t battery_callback
static

Implementation of the GATT Battery Service Server To use with your application, add '#import <battery_service.gatt' to your .gatt file.

att_service_handler_t battery_service
static
uint16_t battery_value_client_configuration
static
hci_con_handle_t battery_value_client_configuration_connection
static
uint16_t battery_value_handle_client_configuration
static
uint16_t battery_value_handle_value
static