Test version of BlueUSB stack. Includes SDP and RFCOMM. As Client it allows to connect to my fischertechnik TX Controller. As Server it echo\\\\\\\'s characters to Putty. PIN=1234

Dependencies:   mbed myUSBHost AvailableMemory

Dependents:   mbed_TANK_Kinect myBlueUSB_ros ftusbClass

Files at this revision

API Documentation at this revision

Comitter:
networker
Date:
Sun Jun 19 13:19:52 2011 +0000
Parent:
7:99068afea04d
Child:
9:c76a3f8f9245
Commit message:
added seteventfilter

Changed in this revision

hci.cpp Show annotated file Show diff for this revision Revisions of this file
hci.h Show annotated file Show diff for this revision Revisions of this file
--- a/hci.cpp	Sun Jun 19 12:43:19 2011 +0000
+++ b/hci.cpp	Sun Jun 19 13:19:52 2011 +0000
@@ -106,6 +106,30 @@
     return 0;
 }
 
+int HCI::SetEventFilter(u8 filterType, u8 filterConditionType, u8* condition) {
+    int len = 2;
+    u8 buf[8];
+    buf[0] = filterType;
+    buf[1] = filterConditionType;
+    switch (filterConditionType) {
+        case 0://all devices
+            if (filterType==2) { //connection setup
+                buf[2] = condition[0];
+                len++;
+            }
+            break;
+        case 1: //filter by class
+        case 2: //filter by BDADDR
+            memcpy(buf+2, condition, 6);
+            len += 6;
+            break;
+        default:
+            printf("Unknown filter condition type %d, filter type=%d\n", filterConditionType, filterType);
+    }
+    SendCmd(HCI_OP_SET_EVENT_FLT, buf, len);
+    return 0;
+}
+
 int HCI::SendCmd(int cmd, const u8* params, int len) {
     u8 b[256];
     b[0] = cmd;
--- a/hci.h	Sun Jun 19 12:43:19 2011 +0000
+++ b/hci.h	Sun Jun 19 13:19:52 2011 +0000
@@ -224,6 +224,7 @@
     //  see what devies are in the system
     int Inquiry(int duration = 10);
 
+    int SetEventFilter(u8 filterType, u8 filterConditionType, u8* condition);
     //  get a name, delivered in callback
     int RemoteNameRequest(const BD_ADDR* addr);
     int RemoteNameRequest(inquiry_info* ii);