mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-25 09:02:30 +00:00
ancs_client: only send ANCS_SUBEVENT_CLIENT_DISCONNECTED if correct handle disconnected and connected event was sent before
This commit is contained in:
parent
6dbf1f9ab2
commit
398ab102a4
@ -220,7 +220,12 @@ static void handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
||||||
|
if (hci_event_disconnection_complete_get_connection_handle(packet) != gc_handle) break;
|
||||||
|
if (tc_state == TC_SUBSCRIBED){
|
||||||
notify_client_simple(ANCS_SUBEVENT_CLIENT_DISCONNECTED);
|
notify_client_simple(ANCS_SUBEVENT_CLIENT_DISCONNECTED);
|
||||||
|
}
|
||||||
|
tc_state = TC_IDLE;
|
||||||
|
gc_handle = 0;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -319,7 +324,7 @@ static void handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
|
|||||||
value_length = little_endian_read_16(packet, 6);
|
value_length = little_endian_read_16(packet, 6);
|
||||||
value = &packet[8];
|
value = &packet[8];
|
||||||
|
|
||||||
log_info("ANCS Ntoficiation, value handle %u", value_handle);
|
log_info("ANCS Notification, value handle %u", value_handle);
|
||||||
|
|
||||||
if (value_handle == ancs_data_source_characteristic.value_handle){
|
if (value_handle == ancs_data_source_characteristic.value_handle){
|
||||||
int i;
|
int i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user