xref: /btstack/test/gatt_client/mock.c (revision f45e14b19041af909a6453287a1db1fda104302a)
1 #include <stdint.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <string.h>
5 
6 #include <btstack/btstack.h>
7 #include "hci.h"
8 #include "hci_dump.h"
9 #include "l2cap.h"
10 
11 int hci_can_send_packet_now_using_packet_buffer(uint8_t packet_type){
12 	printf("hci_can_send_packet_now_using_packet_buffer \n");
13 	return 1;
14 }
15 
16 void hci_disconnect_security_block(hci_con_handle_t con_handle){
17 	printf("hci_disconnect_security_block \n");
18 }
19 
20 void hci_dump_log(const char * format, ...){
21 	printf("hci_disconnect_security_block \n");
22 }
23 
24 int hci_send_cmd(const hci_cmd_t *cmd, ...){
25 	printf("hci_send_cmd \n");
26 	return 0;
27 }
28 
29 
30 int  l2cap_can_send_connectionless_packet_now(void){
31 	printf("l2cap_can_send_connectionless_packet_now \n");
32 	return 1;
33 }
34 
35 static uint8_t  l2cap_stack_buffer[20];
36 static uint16_t max_l2cap_data_packet_length = 20;
37 
38 
39 uint8_t *l2cap_get_outgoing_buffer(void){
40 	printf("l2cap_get_outgoing_buffer \n");
41 	return (uint8_t *)&l2cap_stack_buffer; // 8 bytes
42 }
43 
44 
45 
46 uint16_t l2cap_max_mtu(void){
47     printf("l2cap_max_mtu \n");
48     return max_l2cap_data_packet_length;
49 }
50 
51 
52 void l2cap_register_fixed_channel(btstack_packet_handler_t packet_handler, uint16_t channel_id) {
53 	printf("l2cap_register_fixed_channel \n");
54 }
55 
56 void l2cap_register_packet_handler(void (*handler)(void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size)){
57 	printf("l2cap_register_packet_handler \n");
58 }
59 
60 int hci_reserve_packet_buffer(void){
61 	printf("hci_reserve_packet_buffer \n");
62 	return 1;
63 }
64 
65 int l2cap_reserve_packet_buffer(void){
66 	printf("l2cap_reserve_packet_buffer \n");
67     return hci_reserve_packet_buffer();
68 }
69 
70 int l2cap_send_prepared_connectionless(uint16_t handle, uint16_t cid, uint16_t len){
71 	printf("l2cap_send_prepared_connectionless \n");
72 	return 0;
73 }
74 
75 
76 void l2cap_run(void){
77 }
78