mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-26 02:37:41 +00:00
gatt-service/ancs-client: use event getters for notification & indication
This commit is contained in:
parent
4da9eab982
commit
77043c43b8
@ -192,12 +192,7 @@ static void ancs_chunk_parser_handle_byte(uint8_t data){
|
||||
}
|
||||
}
|
||||
|
||||
static void ancs_client_handle_notification(uint8_t * packet, uint16_t size){
|
||||
UNUSED(size);
|
||||
|
||||
uint16_t value_handle = little_endian_read_16(packet, 4);
|
||||
uint16_t value_length = little_endian_read_16(packet, 6);
|
||||
uint8_t * value = &packet[8];
|
||||
static void ancs_client_handle_notification(uint16_t value_handle, const uint8_t * value, uint16_t value_length){
|
||||
|
||||
log_info("ANCS Notification, value handle %u", value_handle);
|
||||
|
||||
@ -280,6 +275,7 @@ static void ancs_client_handle_gatt_client_event(uint8_t packet_type, uint16_t c
|
||||
|
||||
UNUSED(packet_type);
|
||||
UNUSED(channel);
|
||||
UNUSED(size);
|
||||
|
||||
static const uint8_t ancs_notification_source_uuid[] = {0x9F,0xBF,0x12,0x0D,0x63,0x01,0x42,0xD9,0x8C,0x58,0x25,0xE6,0x99,0xA2,0x1D,0xBD};
|
||||
static const uint8_t ancs_control_point_uuid[] = {0x69,0xD1,0xD8,0xF3,0x45,0xE1,0x49,0xA8,0x98,0x21,0x9B,0xBD,0xFD,0xAA,0xD9,0xD9};
|
||||
@ -351,9 +347,19 @@ static void ancs_client_handle_gatt_client_event(uint8_t packet_type, uint16_t c
|
||||
case TC_SUBSCRIBED:
|
||||
switch(hci_event_packet_get_type(packet)){
|
||||
case GATT_EVENT_NOTIFICATION:
|
||||
case GATT_EVENT_INDICATION:
|
||||
ancs_client_handle_notification(packet, size);
|
||||
ancs_client_handle_notification(
|
||||
gatt_event_notification_get_value_handle(packet),
|
||||
gatt_event_notification_get_value(packet),
|
||||
gatt_event_notification_get_value_length(packet)
|
||||
);
|
||||
break;
|
||||
case GATT_EVENT_INDICATION:
|
||||
ancs_client_handle_notification(
|
||||
gatt_event_indication_get_value_handle(packet),
|
||||
gatt_event_indication_get_value(packet),
|
||||
gatt_event_indication_get_value_length(packet)
|
||||
);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user