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