mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-21 03:40:47 +00:00
forward HCI Events to att and sm packet handlers, too
This commit is contained in:
parent
7d468b9be6
commit
e070741715
@ -141,25 +141,16 @@ int l2cap_send_connectionless(uint16_t handle, uint16_t cid, uint8_t *data, uint
|
||||
|
||||
void l2cap_event_handler( uint8_t *packet, uint16_t size ){
|
||||
|
||||
switch(packet[0]){
|
||||
|
||||
case DAEMON_EVENT_HCI_PACKET_SENT:
|
||||
if (attribute_protocol_packet_handler) {
|
||||
(*attribute_protocol_packet_handler)(HCI_EVENT_PACKET, 0, packet, size);
|
||||
}
|
||||
if (security_protocol_packet_handler) {
|
||||
(*security_protocol_packet_handler)(HCI_EVENT_PACKET, 0, packet, size);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// pass on
|
||||
if (packet_handler) {
|
||||
(*packet_handler)(NULL, HCI_EVENT_PACKET, 0, packet, size);
|
||||
}
|
||||
if (attribute_protocol_packet_handler){
|
||||
(*attribute_protocol_packet_handler)(HCI_EVENT_PACKET, 0, packet, size)
|
||||
}
|
||||
if (security_protocol_packet_handler) {
|
||||
(*security_protocol_packet_handler)(HCI_EVENT_PACKET, 0, packet, size)
|
||||
}
|
||||
}
|
||||
|
||||
void l2cap_acl_handler( uint8_t *packet, uint16_t size ){
|
||||
|
10
src/l2cap.c
10
src/l2cap.c
@ -779,7 +779,7 @@ static void l2cap_handle_connection_success_for_addr(bd_addr_t address, hci_con_
|
||||
l2cap_run();
|
||||
}
|
||||
|
||||
void l2cap_event_handler( uint8_t *packet, uint16_t size ){
|
||||
void l2cap_event_handler(uint8_t *packet, uint16_t size){
|
||||
|
||||
bd_addr_t address;
|
||||
hci_con_handle_t handle;
|
||||
@ -921,8 +921,14 @@ void l2cap_event_handler( uint8_t *packet, uint16_t size ){
|
||||
break;
|
||||
}
|
||||
|
||||
// pass on
|
||||
// pass on: main packet handler, att and sm packet handlers
|
||||
(*packet_handler)(NULL, HCI_EVENT_PACKET, 0, packet, size);
|
||||
if (attribute_protocol_packet_handler){
|
||||
(*attribute_protocol_packet_handler)(HCI_EVENT_PACKET, 0, packet, size);
|
||||
}
|
||||
if (security_protocol_packet_handler) {
|
||||
(*security_protocol_packet_handler)(HCI_EVENT_PACKET, 0, packet, size);
|
||||
}
|
||||
|
||||
l2cap_run();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user