1 /* 2 * Copyright 2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef _CONNECTION_INTERFACE_H 6 #define _CONNECTION_INTERFACE_H 7 8 #include <net_buffer.h> 9 10 #include <bluetooth/bluetooth.h> 11 #include <bluetooth/HCI/btHCI.h> 12 13 #include <btCoreData.h> 14 15 extern mutex sConnectionListLock; 16 extern DoublyLinkedList<HciConnection> sConnectionList; 17 18 HciConnection* ConnectionByHandle(uint16 handle, hci_id hid); 19 HciConnection* ConnectionByDestination(const bdaddr_t& destination, 20 hci_id hid); 21 22 23 HciConnection* AddConnection(uint16 handle, int type, const bdaddr_t& dst, 24 hci_id hid); 25 status_t RemoveConnection(const bdaddr_t& destination, hci_id hid); 26 status_t RemoveConnection(uint16 handle, hci_id hid); 27 28 hci_id RouteConnection(const bdaddr_t& destination); 29 30 uint8 allocate_command_ident(HciConnection* conn, void* pointer); 31 void* lookup_command_ident(HciConnection* conn, uint8 ident); 32 void free_command_ident(HciConnection* conn, uint8 ident); 33 34 #endif // _CONNECTION_INTERFACE_H 35