l2cap.c (e883851f1d92ba6f82ca45f4db83673c9bf54f19) | l2cap.c (17b0e9ff31efe1cefb381b17cc67390d41389496) |
---|---|
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 --- 3526 unchanged lines hidden (view full) --- 3535 } 3536 } 3537 } 3538 return; 3539 } 3540#endif 3541 3542 // check size | 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 --- 3526 unchanged lines hidden (view full) --- 3535 } 3536 } 3537 } 3538 return; 3539 } 3540#endif 3541 3542 // check size |
3543 if (l2cap_channel->local_mtu < size) return; | 3543 uint16_t payload_size = size - COMPLETE_L2CAP_HEADER; 3544 if (l2cap_channel->local_mtu < payload_size) return; |
3544 | 3545 |
3545 l2cap_dispatch_to_channel(l2cap_channel, L2CAP_DATA_PACKET, &packet[COMPLETE_L2CAP_HEADER], size-COMPLETE_L2CAP_HEADER); | 3546 l2cap_dispatch_to_channel(l2cap_channel, L2CAP_DATA_PACKET, &packet[COMPLETE_L2CAP_HEADER], payload_size); |
3546} 3547#endif 3548 3549static void l2cap_acl_classic_handler(hci_con_handle_t handle, uint8_t *packet, uint16_t size){ 3550#ifdef ENABLE_CLASSIC 3551 l2cap_channel_t * l2cap_channel; 3552 l2cap_fixed_channel_t * l2cap_fixed_channel; 3553 --- 660 unchanged lines hidden --- | 3547} 3548#endif 3549 3550static void l2cap_acl_classic_handler(hci_con_handle_t handle, uint8_t *packet, uint16_t size){ 3551#ifdef ENABLE_CLASSIC 3552 l2cap_channel_t * l2cap_channel; 3553 l2cap_fixed_channel_t * l2cap_fixed_channel; 3554 --- 660 unchanged lines hidden --- |