Use 5 sec LinkSupervisionTimeout

This commit is contained in:
matthias.ringwald 2010-04-11 15:12:57 +00:00
parent 3c07ec4896
commit 91b7413008
2 changed files with 11 additions and 8 deletions

View File

@ -115,9 +115,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
hid_interrupt = local_cid;
}
if (hid_control && hid_interrupt){
//HID Control: 0x06 bytes - SET_FEATURE_REPORT [ 53 F4 42 03 00 00 ]
// uint8_t set_feature_report[] = { 0x53, 0xf4, 0x42, 0x03, 0x00, 0x00};
// bt_send_l2cap(hid_control, (uint8_t*) &set_feature_report, sizeof(set_feature_report));
bt_send_cmd(&hci_switch_role_command, &event_addr, 0);
}
} else {
printf("L2CAP connection to device ");
@ -126,7 +124,14 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
exit(1);
}
break;
case HCI_EVENT_ROLE_CHANGE: {
//HID Control: 0x06 bytes - SET_FEATURE_REPORT [ 53 F4 42 03 00 00 ]
uint8_t set_feature_report[] = { 0x53, 0xf4, 0x42, 0x03, 0x00, 0x00};
bt_send_l2cap(hid_control, (uint8_t*) &set_feature_report, sizeof(set_feature_report));
break;
}
case HCI_EVENT_DISCONNECTION_COMPLETE:
// connection closed -> quit tes app
printf("Basebank connection closed, exit.\n");

View File

@ -19,7 +19,6 @@
9C05FC971020D3F300255261 /* socket_connection.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C00F7301017ACC3008DAB17 /* socket_connection.c */; };
9C18015C108BAA7200824BE7 /* libusb-1.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C18015B108BAA7200824BE7 /* libusb-1.0.dylib */; };
9C46FC3A0FA906F700ABEF05 /* hci_transport_h4.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C46FC360FA906F700ABEF05 /* hci_transport_h4.c */; };
9C50953A112744AA00A30986 /* BTstackManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C509539112744AA00A30986 /* BTstackManager.m */; };
9C77E79210667F0600F39DCF /* platform_iphone.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C77E79110667F0600F39DCF /* platform_iphone.c */; };
9C7B5AC0100BD3340065D87E /* linked_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C7B5ABF100BD3340065D87E /* linked_list.c */; };
9C7B5D01100FC9AE0065D87E /* btstack.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CC813A10FFC0774002816F9 /* btstack.c */; };
@ -51,7 +50,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
8DD76FB20486AB0100D96B5E /* project */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = project; sourceTree = BUILT_PRODUCTS_DIR; };
8DD76FB20486AB0100D96B5E /* project */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = project; sourceTree = BUILT_PRODUCTS_DIR; };
9C00F7301017ACC3008DAB17 /* socket_connection.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = socket_connection.c; path = src/socket_connection.c; sourceTree = "<group>"; };
9C00F7311017ACC3008DAB17 /* socket_connection.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = socket_connection.h; path = src/socket_connection.h; sourceTree = "<group>"; };
9C00F7D61019082F008DAB17 /* hci_cmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hci_cmds.c; path = src/hci_cmds.c; sourceTree = "<group>"; };
@ -96,7 +95,7 @@
9C78A0BB103C9DEE003B2950 /* ch.ringwald.BTstack.plist */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.plist.xml; name = ch.ringwald.BTstack.plist; path = resources/ch.ringwald.BTstack.plist; sourceTree = "<group>"; };
9C7B5ABF100BD3340065D87E /* linked_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = linked_list.c; path = src/linked_list.c; sourceTree = "<group>"; };
9C7B5B7E100D04450065D87E /* test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = test.c; path = example/test.c; sourceTree = "<group>"; };
9C7B5CF6100FC96A0065D87E /* clientTest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = clientTest; sourceTree = BUILT_PRODUCTS_DIR; };
9C7B5CF6100FC96A0065D87E /* clientTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = clientTest; sourceTree = BUILT_PRODUCTS_DIR; };
9C7ECB810FCC85650085DAC5 /* bt_control.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = bt_control.h; path = src/bt_control.h; sourceTree = "<group>"; };
9C7ECB830FCC85650085DAC5 /* bt_control_iphone.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = bt_control_iphone.h; path = src/bt_control_iphone.h; sourceTree = "<group>"; };
9C7ECBB30FCC95DD0085DAC5 /* hci_dump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hci_dump.h; path = src/hci_dump.h; sourceTree = "<group>"; };
@ -420,7 +419,6 @@
9C04B826107D1CED002A63D0 /* run_loop.c in Sources */,
9C04B876107D2B7C002A63D0 /* run_loop_cocoa.m in Sources */,
9CF13C1610F8A1C6004C4EEE /* bt_control_iphone.m in Sources */,
9C50953A112744AA00A30986 /* BTstackManager.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};