btstack/test/sdp_client/mock.c

40 lines
1012 B
C
Raw Normal View History

2016-03-04 10:59:52 +00:00
#include <stdint.h>
#include <unistd.h>
#include "btstack_defines.h"
#include "btstack_debug.h"
2016-04-08 13:38:45 +00:00
#include "btstack_util.h"
2016-03-04 10:59:52 +00:00
#include "bluetooth.h"
2016-04-08 13:38:45 +00:00
static btstack_packet_handler_t packet_handler;
int l2cap_can_send_packet_now(uint16_t cid){
2016-03-04 10:59:52 +00:00
return 1;
}
uint8_t l2cap_request_can_send_now_event(uint16_t cid){
2016-04-08 13:38:45 +00:00
uint8_t event[] = { L2CAP_EVENT_CAN_SEND_NOW, 2, 0, 0};
little_endian_store_16(event, 2, cid);
packet_handler(HCI_EVENT_PACKET, 0, event, sizeof(event));
2021-11-23 09:10:39 +00:00
return ERROR_CODE_SUCCESS;
2016-04-08 13:38:45 +00:00
}
uint8_t l2cap_create_channel(btstack_packet_handler_t handler, bd_addr_t address, uint16_t psm, uint16_t mtu, uint16_t * out_local_cid){
2016-04-08 13:38:45 +00:00
packet_handler = handler;
2016-03-04 10:59:52 +00:00
return 0x41;
}
uint8_t l2cap_disconnect(uint16_t local_cid){
2021-11-23 09:10:39 +00:00
return ERROR_CODE_SUCCESS;
2016-03-04 10:59:52 +00:00
}
uint8_t *l2cap_get_outgoing_buffer(void){
2016-03-04 10:59:52 +00:00
return NULL;
}
uint16_t l2cap_max_mtu(void){
2016-03-04 10:59:52 +00:00
return 0;
}
int l2cap_reserve_packet_buffer(void){
2016-03-04 10:59:52 +00:00
return 0;
}
int l2cap_send_prepared(uint16_t local_cid, uint16_t len){
2016-03-04 10:59:52 +00:00
return 0;
2021-11-23 09:10:39 +00:00
}