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
Diff: hci.cpp
- Revision:
- 8:d29e42b5ae53
- Parent:
- 7:99068afea04d
- Child:
- 9:c76a3f8f9245
diff -r 99068afea04d -r d29e42b5ae53 hci.cpp --- 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;