mock.c (18cd0f45756bd438d3799d7aa67a6d3611dd4be2) mock.c (effffa37c0a3fa55a1b2c0e7b936dd0c471869be)
1#include <stdint.h>
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5
6#include "hci.h"
7#include "gap.h"
8#include "hci_dump.h"

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

57void gap_set_scan_parameters(uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window){
58}
59
60int gap_reconnect_security_setup_active(hci_con_handle_t con_handle){
61 UNUSED(con_handle);
62 return 0;
63}
64
1#include <stdint.h>
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5
6#include "hci.h"
7#include "gap.h"
8#include "hci_dump.h"

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

57void gap_set_scan_parameters(uint8_t scan_type, uint16_t scan_interval, uint16_t scan_window){
58}
59
60int gap_reconnect_security_setup_active(hci_con_handle_t con_handle){
61 UNUSED(con_handle);
62 return 0;
63}
64
65void hci_setup_le_connection(uint16_t con_handle){
65static void hci_setup_connection(uint16_t con_handle, bd_addr_type_t type){
66 hci_connection.att_connection.mtu = 23;
67 hci_connection.att_connection.con_handle = con_handle;
68 hci_connection.att_connection.max_mtu = 23;
69 hci_connection.att_connection.encryption_key_size = 0;
70 hci_connection.att_connection.authenticated = 0;
71 hci_connection.att_connection.authorized = 0;
72
73 hci_connection.att_server.ir_le_device_db_index = 0;
74
75 hci_connection.con_handle = con_handle;
66 hci_connection.att_connection.mtu = 23;
67 hci_connection.att_connection.con_handle = con_handle;
68 hci_connection.att_connection.max_mtu = 23;
69 hci_connection.att_connection.encryption_key_size = 0;
70 hci_connection.att_connection.authenticated = 0;
71 hci_connection.att_connection.authorized = 0;
72
73 hci_connection.att_server.ir_le_device_db_index = 0;
74
75 hci_connection.con_handle = con_handle;
76 hci_connection.address_type = type;
76
77 if (btstack_linked_list_empty(&connections)){
78 btstack_linked_list_add(&connections, (btstack_linked_item_t *)&hci_connection);
79 }
80}
81
77
78 if (btstack_linked_list_empty(&connections)){
79 btstack_linked_list_add(&connections, (btstack_linked_item_t *)&hci_connection);
80 }
81}
82
83void hci_setup_le_connection(uint16_t con_handle){
84 hci_setup_connection(con_handle, BD_ADDR_TYPE_LE_PUBLIC);
85}
86
87void hci_setup_classic_connection(uint16_t con_handle){
88 hci_setup_connection(con_handle, BD_ADDR_TYPE_ACL);
89}
90
91
82void mock_l2cap_set_max_mtu(uint16_t mtu){
83 max_mtu = mtu;
84}
85
86void hci_deinit(void){
87 hci_connection.att_connection.mtu = 0;
88 hci_connection.att_connection.con_handle = HCI_CON_HANDLE_INVALID;
89 hci_connection.att_connection.max_mtu = 0;

--- 212 unchanged lines hidden ---
92void mock_l2cap_set_max_mtu(uint16_t mtu){
93 max_mtu = mtu;
94}
95
96void hci_deinit(void){
97 hci_connection.att_connection.mtu = 0;
98 hci_connection.att_connection.con_handle = HCI_CON_HANDLE_INVALID;
99 hci_connection.att_connection.max_mtu = 0;

--- 212 unchanged lines hidden ---