test: fix sm and sdp client

This commit is contained in:
Matthias Ringwald 2016-04-08 15:38:45 +02:00
parent ba92fcf681
commit 7d2c9f1338
2 changed files with 18 additions and 1 deletions

View File

@ -3,12 +3,22 @@
#include "btstack_defines.h"
#include "btstack_debug.h"
#include "btstack_util.h"
#include "bluetooth.h"
static btstack_packet_handler_t packet_handler;
extern "C" int l2cap_can_send_packet_now(uint16_t cid){
return 1;
}
extern "C" uint8_t l2cap_create_channel(btstack_packet_handler_t packet_handler, bd_addr_t address, uint16_t psm, uint16_t mtu, uint16_t * out_local_cid){
extern "C" void l2cap_request_can_send_now_event(uint16_t cid){
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));
}
extern "C" 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){
packet_handler = handler;
return 0x41;
}
extern "C" void l2cap_disconnect(uint16_t local_cid, uint8_t reason){

View File

@ -147,6 +147,13 @@ void gap_advertisements_get_address(uint8_t * addr_type, bd_addr_t addr){
uint8_t channel_map, uint8_t filter_policy) {
}
extern "C" void l2cap_request_can_send_fix_channel_now_event(hci_con_handle_t con_handle, uint16_t cid){
if (packet_buffer_len) return;
uint8_t event[] = { L2CAP_EVENT_CAN_SEND_NOW, 2, 0, 0};
little_endian_store_16(event, 2, cid);
le_data_handler(HCI_EVENT_PACKET, 0, event, sizeof(event));
}
int l2cap_can_send_connectionless_packet_now(void){
return packet_buffer_len == 0;
}