att_server: handle l2cap_can_send_now events

This commit is contained in:
Matthias Ringwald 2016-02-29 14:39:06 +01:00
parent 2788960b79
commit 372d62c463

View File

@ -329,8 +329,13 @@ static void att_run(void){
}
static void att_packet_handler(uint8_t packet_type, uint16_t handle, uint8_t *packet, uint16_t size){
if (packet_type != ATT_DATA_PACKET) return;
switch (packet_type){
case HCI_EVENT_PACKET:
if (packet[0] != L2CAP_EVENT_CAN_SEND_NOW) break;
att_run();
break;
case ATT_DATA_PACKET:
// handle value indication confirms
if (packet[0] == ATT_HANDLE_VALUE_CONFIRMATION && att_handle_value_indication_handle){
btstack_run_loop_remove_timer(&att_handle_value_indication_timer);
@ -352,6 +357,8 @@ static void att_packet_handler(uint8_t packet_type, uint16_t handle, uint8_t *pa
memcpy(att_request_buffer, packet, size);
att_run();
break;
}
}
void att_server_init(uint8_t const * db, att_read_callback_t read_callback, att_write_callback_t write_callback){