att_dispatch: extract att_dispatch_handle_att_pdu

This commit is contained in:
Matthias Ringwald 2023-07-04 10:24:58 +02:00
parent 4c22687684
commit e6dbc98e5d

View File

@ -124,18 +124,13 @@ static void att_dispatch_handle_can_send_now(uint8_t *packet, uint16_t size){
}
}
static void att_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
static void att_dispatch_handle_att_pdu(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
uint8_t index;
uint8_t opcode;
uint8_t method;
bool for_server;
bool invalid;
uint8_t index;
#ifdef ENABLE_GATT_OVER_EATT
bd_addr_t address;
uint16_t l2cap_cid;
#endif
switch (packet_type){
case ATT_DATA_PACKET:
// parse opcode
opcode = packet[0u];
method = opcode & 0x03fu;
@ -145,6 +140,17 @@ static void att_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
index = for_server ? ATT_SERVER : ATT_CLIENT;
if (!subscriptions[index].packet_handler) return;
subscriptions[index].packet_handler(packet_type, channel, packet, size);
}
static void att_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
uint8_t index;
#ifdef ENABLE_GATT_OVER_EATT
bd_addr_t address;
uint16_t l2cap_cid;
#endif
switch (packet_type){
case ATT_DATA_PACKET:
att_dispatch_handle_att_pdu(packet_type, channel, packet, size);
break;
case HCI_EVENT_PACKET:
switch (hci_event_packet_get_type(packet)) {