2009-07-01 21:55:08 +00:00
|
|
|
/*
|
|
|
|
* btstack.h
|
|
|
|
*
|
|
|
|
* Created by Matthias Ringwald on 7/1/09.
|
|
|
|
*
|
|
|
|
* BTstack client API
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-07-14 20:41:14 +00:00
|
|
|
#pragma once
|
|
|
|
#include "hci.h"
|
2009-07-20 21:39:43 +00:00
|
|
|
#include "l2cap.h"
|
2009-07-14 20:41:14 +00:00
|
|
|
|
2009-07-14 18:29:29 +00:00
|
|
|
// init BTstack library
|
|
|
|
int bt_open();
|
|
|
|
|
|
|
|
// stop using BTstack library
|
|
|
|
int bt_close();
|
|
|
|
|
|
|
|
// send hci cmd packet
|
2009-07-14 20:41:14 +00:00
|
|
|
int bt_send_cmd(hci_cmd_t *cmd, ...);
|
2009-07-14 18:29:29 +00:00
|
|
|
|
|
|
|
// send hci acl packet
|
2009-07-14 20:41:14 +00:00
|
|
|
int bt_send_acl_packet(uint8_t *packet, int size);
|
2009-07-14 18:29:29 +00:00
|
|
|
|
2009-07-20 21:39:43 +00:00
|
|
|
// TODO: temp
|
|
|
|
int bt_send_l2cap_signaling_packet(hci_con_handle_t handle, L2CAP_SIGNALING_COMMANDS cmd, uint8_t identifier, ...);
|
|
|
|
|
2009-07-14 18:29:29 +00:00
|
|
|
// register packet and event handler
|
|
|
|
void bt_register_event_packet_handler(void (*handler)(uint8_t *packet, int size));
|
|
|
|
void bt_register_acl_packet_handler (void (*handler)(uint8_t *packet, int size));
|
|
|
|
|