]> rtime.felk.cvut.cz Git - mirosot.git/blobdiff - bth_tests/bluetooth/hci_sci.c
Added bth_test application. Not finished.
[mirosot.git] / bth_tests / bluetooth / hci_sci.c
diff --git a/bth_tests/bluetooth/hci_sci.c b/bth_tests/bluetooth/hci_sci.c
new file mode 100644 (file)
index 0000000..114b5e7
--- /dev/null
@@ -0,0 +1,28 @@
+#include <hci.h>
+
+/**
+  //FIXME
+ *Sends data of the size hp_size from address hp to the bluetooth device (UART)
+ */
+int bth_send_packet(uint8_t *hp, uint16_t hp_size)
+{  
+  /*is bluetooth device free, or is it busy by the previous command?*/
+  if(bth_local_info.busy==0) {
+#ifndef BTH_LX
+    VypisHexa(hp,hp_size);
+#else
+    int zn,i;
+
+    for(i=0; i<hp_size;i++) {
+      zn=*(hp+i);
+      sci_rs232_sendch(zn,2); //bth
+//      VypisHexa((hp+i),1);
+    };
+#endif
+    bth_local_info.busy=1;
+    return(0);    //everything sent ==== OK =====
+  } else {
+    return 2;    //busy
+  };
+};
+