mock.c (1a4496387c2c0e408abbf9aba9ac8d2ff633bf79) | mock.c (ae970bb91d228f4ea1065b8e4dd6ed1a861e278e) |
---|---|
1#include <stdint.h> 2#include <stdio.h> 3#include <stdlib.h> 4#include <string.h> 5 6#include "hci.h" 7#include "hci_dump.h" 8#include "l2cap.h" 9 10#include "ble/att_db.h" 11#include "ble/gatt_client.h" 12#include "ble/sm.h" 13 | 1#include <stdint.h> 2#include <stdio.h> 3#include <stdlib.h> 4#include <string.h> 5 6#include "hci.h" 7#include "hci_dump.h" 8#include "l2cap.h" 9 10#include "ble/att_db.h" 11#include "ble/gatt_client.h" 12#include "ble/sm.h" 13 |
14#include "btstack_debug.h" 15 |
|
14static btstack_packet_handler_t att_packet_handler; 15static void (*registered_hci_event_handler) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) = NULL; 16 17static btstack_linked_list_t connections; 18static const uint16_t max_mtu = 23; 19static uint8_t l2cap_stack_buffer[HCI_INCOMING_PRE_BUFFER_SIZE + 8 + max_mtu]; // pre buffer + HCI Header + L2CAP header 20static uint16_t gatt_client_handle = 0x40; 21static hci_connection_t hci_connection; --- 44 unchanged lines hidden (view full) --- 66 att_connection->authenticated = 0; 67 att_connection->authorized = 0; 68} 69 70int hci_can_send_acl_le_packet_now(void){ 71 return 1; 72} 73 | 16static btstack_packet_handler_t att_packet_handler; 17static void (*registered_hci_event_handler) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size) = NULL; 18 19static btstack_linked_list_t connections; 20static const uint16_t max_mtu = 23; 21static uint8_t l2cap_stack_buffer[HCI_INCOMING_PRE_BUFFER_SIZE + 8 + max_mtu]; // pre buffer + HCI Header + L2CAP header 22static uint16_t gatt_client_handle = 0x40; 23static hci_connection_t hci_connection; --- 44 unchanged lines hidden (view full) --- 68 att_connection->authenticated = 0; 69 att_connection->authorized = 0; 70} 71 72int hci_can_send_acl_le_packet_now(void){ 73 return 1; 74} 75 |
76int hci_can_send_command_packet_now(void){ 77 return 1; 78} 79 80HCI_STATE hci_get_state(void){ 81 return HCI_STATE_WORKING; 82} 83 84int hci_send_cmd(const hci_cmd_t *cmd, ...){ 85 btstack_assert(false); 86 return 0; 87} 88 89void hci_halting_defer(void){ 90} 91 |
|
74int l2cap_can_send_connectionless_packet_now(void){ 75 return 1; 76} 77 78uint8_t *l2cap_get_outgoing_buffer(void){ 79 // printf("l2cap_get_outgoing_buffer\n"); 80 return (uint8_t *)&l2cap_stack_buffer; // 8 bytes 81} --- 142 unchanged lines hidden --- | 92int l2cap_can_send_connectionless_packet_now(void){ 93 return 1; 94} 95 96uint8_t *l2cap_get_outgoing_buffer(void){ 97 // printf("l2cap_get_outgoing_buffer\n"); 98 return (uint8_t *)&l2cap_stack_buffer; // 8 bytes 99} --- 142 unchanged lines hidden --- |