]> rtime.felk.cvut.cz Git - mirosot.git/blob - bluetooth/hci_bluez.c
An unsucesfull attempt to clean bluetooth library and make it working.
[mirosot.git] / bluetooth / hci_bluez.c
1 #include "hci.h"
2 #include <unistd.h>
3 int hci_socket;
4 /**
5   //FIXME
6  *Sends data of the size hp_size from address hp to the bluetooth device (UART)
7  */
8 int bth_send_packet(uint8_t *hp, uint16_t hp_size)
9 {  
10   /*is bluetooth device free, or is it busy by the previous command?*/
11   if(bth_local_info.busy==0) {
12
13     write(hci_socket, hp, hp_size);
14
15     bth_local_info.busy=1;
16     return(0);    //everything sent ==== OK =====
17   } else {
18     return 2;    //busy
19   };
20 };
21