Bluetooth device discovery example program.

Dependencies:   F401RE-USBHost mbed-rtos mbed


Files at this revision

API Documentation at this revision

Comitter:
va009039
Date:
Tue Jul 01 15:00:24 2014 +0000
Child:
1:f91b852334b5
Commit message:
first commit

Changed in this revision

F401RE-USBHost.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/F401RE-USBHost.lib	Tue Jul 01 15:00:24 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/va009039/code/F401RE-USBHost/#61554f238584
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jul 01 15:00:24 2014 +0000
@@ -0,0 +1,23 @@
+#include "USBHostRSSI.h"
+
+DigitalOut led1(LED1);
+
+void callback(inquiry_with_rssi_info* info) {
+    static int n = 0;
+    char buf[18];
+    info->bdaddr.str(buf, sizeof(buf));
+    printf("%d %s %d\n", n++, buf, info->rssi);
+    led1 = !led1;
+}
+
+int main() {
+    USBHostRSSI bt;
+    if (!bt.connect()) {
+        error("USB Bluetooth dongle not found.\n");
+    }
+    bt.attachEvent(callback);
+    while(1) {
+        USBHost::poll();
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Tue Jul 01 15:00:24 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#1520481a219c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jul 01 15:00:24 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721
\ No newline at end of file