l2cap.c (f8fbdce0c5067e7e7edd3a29934b1f9b79c8ff2d) l2cap.c (fb37a842ea98c26e62c79cddf7c8d9662590cf7e)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 59 unchanged lines hidden (view full) ---

68
69static void null_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
70static void l2cap_packet_handler(uint8_t packet_type, uint8_t *packet, uint16_t size);
71
72// used to cache l2cap rejects, echo, and informational requests
73static l2cap_signaling_response_t signaling_responses[NR_PENDING_SIGNALING_RESPONSES];
74static int signaling_responses_pending;
75
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 59 unchanged lines hidden (view full) ---

68
69static void null_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
70static void l2cap_packet_handler(uint8_t packet_type, uint8_t *packet, uint16_t size);
71
72// used to cache l2cap rejects, echo, and informational requests
73static l2cap_signaling_response_t signaling_responses[NR_PENDING_SIGNALING_RESPONSES];
74static int signaling_responses_pending;
75
76static btstack_packet_callback_registration_t hci_event_callback_registration;
77
76static btstack_linked_list_t l2cap_channels;
77static btstack_linked_list_t l2cap_services;
78static btstack_linked_list_t l2cap_le_channels;
79static btstack_linked_list_t l2cap_le_services;
80static void (*packet_handler) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) = null_packet_handler;
81
82static btstack_packet_handler_t attribute_protocol_packet_handler;
83static btstack_packet_handler_t security_protocol_packet_handler;

--- 22 unchanged lines hidden (view full) ---

106 security_protocol_packet_handler = NULL;
107 connectionless_channel_packet_handler = NULL;
108
109 require_security_level2_for_outgoing_sdp = 0;
110
111 //
112 // register callback with HCI
113 //
78static btstack_linked_list_t l2cap_channels;
79static btstack_linked_list_t l2cap_services;
80static btstack_linked_list_t l2cap_le_channels;
81static btstack_linked_list_t l2cap_le_services;
82static void (*packet_handler) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) = null_packet_handler;
83
84static btstack_packet_handler_t attribute_protocol_packet_handler;
85static btstack_packet_handler_t security_protocol_packet_handler;

--- 22 unchanged lines hidden (view full) ---

108 security_protocol_packet_handler = NULL;
109 connectionless_channel_packet_handler = NULL;
110
111 require_security_level2_for_outgoing_sdp = 0;
112
113 //
114 // register callback with HCI
115 //
114 hci_register_packet_handler(&l2cap_packet_handler);
116 hci_event_callback_registration.callback = &l2cap_packet_handler;
117 hci_add_event_handler(&hci_event_callback_registration);
118
119 hci_register_acl_packet_handler(&l2cap_packet_handler);
120
115 hci_connectable_control(0); // no services yet
116}
117
118
119/** Register L2CAP packet handlers */
120static void null_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
121}
122void l2cap_register_packet_handler(void (*handler)(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size)){

--- 1475 unchanged lines hidden ---
121 hci_connectable_control(0); // no services yet
122}
123
124
125/** Register L2CAP packet handlers */
126static void null_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
127}
128void l2cap_register_packet_handler(void (*handler)(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size)){

--- 1475 unchanged lines hidden ---