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 DoublyLinkedList<HciConnection> sConnectionList; 16 17 HciConnection* ConnectionByHandle(uint16 handle, hci_id hid); 18 HciConnection* ConnectionByDestination(const bdaddr_t& destination, 19 hci_id hid); 20 21 22 HciConnection* AddConnection(uint16 handle, int type, const bdaddr_t& dst, 23 hci_id hid); 24 status_t RemoveConnection(const bdaddr_t& destination, hci_id hid); 25 status_t RemoveConnection(uint16 handle, hci_id hid); 26 27 hci_id RouteConnection(const bdaddr_t& destination); 28 29 void SetAclBuffer(HciConnection* conn, net_buffer* nbuf); 30 void SetAclExpectedSize(HciConnection* conn, size_t size); 31 void AclPutting(HciConnection* conn, size_t size); 32 bool AclComplete(HciConnection* conn); 33 bool AclOverFlowed(HciConnection* conn); 34 35 36 #endif // _CONNECTION_INTERFACE_H 37