l2cap.c (9909e5e4c9e7639fd47cca1734414771065105cd) | l2cap.c (f299206d438b3c837025de8238c33a28f3d90fdd) |
---|---|
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 --- 2736 unchanged lines hidden (view full) --- 2745 if (!l2cap_event_packet_handler) return; 2746 (*l2cap_event_packet_handler)(HCI_EVENT_PACKET, 0, event, sizeof(event)); 2747} 2748 2749// @returns valid 2750static int l2cap_le_signaling_handler_dispatch(hci_con_handle_t handle, uint8_t * command, uint8_t sig_id){ 2751 hci_connection_t * connection; 2752 uint16_t result; | 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 --- 2736 unchanged lines hidden (view full) --- 2745 if (!l2cap_event_packet_handler) return; 2746 (*l2cap_event_packet_handler)(HCI_EVENT_PACKET, 0, event, sizeof(event)); 2747} 2748 2749// @returns valid 2750static int l2cap_le_signaling_handler_dispatch(hci_con_handle_t handle, uint8_t * command, uint8_t sig_id){ 2751 hci_connection_t * connection; 2752 uint16_t result; |
2753 uint8_t event[10]; | 2753 uint8_t event[12]; |
2754 2755#ifdef ENABLE_LE_DATA_CHANNELS 2756 btstack_linked_list_iterator_t it; 2757 l2cap_channel_t * channel; 2758 uint16_t local_cid; 2759 uint16_t le_psm; 2760 uint16_t new_credits; 2761 uint16_t credits_before; --- 35 unchanged lines hidden (view full) --- 2797 } 2798 connection->le_con_param_update_identifier = sig_id; 2799 } 2800 2801 if (!l2cap_event_packet_handler) break; 2802 2803 event[0] = L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST; 2804 event[1] = 8; | 2754 2755#ifdef ENABLE_LE_DATA_CHANNELS 2756 btstack_linked_list_iterator_t it; 2757 l2cap_channel_t * channel; 2758 uint16_t local_cid; 2759 uint16_t le_psm; 2760 uint16_t new_credits; 2761 uint16_t credits_before; --- 35 unchanged lines hidden (view full) --- 2797 } 2798 connection->le_con_param_update_identifier = sig_id; 2799 } 2800 2801 if (!l2cap_event_packet_handler) break; 2802 2803 event[0] = L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST; 2804 event[1] = 8; |
2805 memcpy(&event[2], &command[4], 8); | 2805 little_endian_store_16(event, 2, handle); 2806 memcpy(&event[4], &command[4], 8); |
2806 hci_dump_packet( HCI_EVENT_PACKET, 0, event, sizeof(event)); 2807 (*l2cap_event_packet_handler)( HCI_EVENT_PACKET, 0, event, sizeof(event)); 2808 break; 2809 2810 case CONNECTION_PARAMETER_UPDATE_RESPONSE: 2811 // check size 2812 if (len < 2) return 0; 2813 result = little_endian_read_16(command, 4); --- 957 unchanged lines hidden --- | 2807 hci_dump_packet( HCI_EVENT_PACKET, 0, event, sizeof(event)); 2808 (*l2cap_event_packet_handler)( HCI_EVENT_PACKET, 0, event, sizeof(event)); 2809 break; 2810 2811 case CONNECTION_PARAMETER_UPDATE_RESPONSE: 2812 // check size 2813 if (len < 2) return 0; 2814 result = little_endian_read_16(command, 4); --- 957 unchanged lines hidden --- |