1 /* 2 * hci.c 3 * 4 * Created by Matthias Ringwald on 4/29/09. 5 * 6 */ 7 8 #include <unistd.h> 9 10 #include "hci.h" 11 12 static hci_transport_t *hci_transport; 13 14 void hci_init(hci_transport_t *transport, void *config){ 15 16 // reference to use transport layer implementation 17 hci_transport = transport; 18 19 // open unix socket 20 21 // wait for connections 22 23 // enter loop 24 25 // handle events 26 } 27 28 int hci_power_control(HCI_POWER_MODE power_mode){ 29 return 0; 30 } 31 32 int hci_send_cmd(char *buffer, int size){ 33 return hci_transport->send_cmd_packet(buffer, size); 34 } 35 36 void hci_run(){ 37 while (1) { 38 // construct file descriptor set to wait for 39 // select 40 41 // for each ready file in FD - call handle_data 42 sleep(1); 43 } 44 }