mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-31 19:20:26 +00:00
implemented create connection cancel command and hande it in l2cap
This commit is contained in:
parent
3ce394c4bc
commit
afde0c529f
@ -99,11 +99,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
|||||||
|
|
||||||
devices = [[NSMutableArray alloc] init];
|
devices = [[NSMutableArray alloc] init];
|
||||||
inqView = self;
|
inqView = self;
|
||||||
|
|
||||||
// check for the one missing method
|
|
||||||
onSDK20 = 0;
|
|
||||||
// [UITableViewCell instancesRespondToSelector:@selector(initWithFrame:reuseIdentifier:)];
|
|
||||||
NSLog(@"onSDK20 = %u", onSDK20);
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,6 +171,7 @@ extern hci_cmd_t hci_set_event_mask;
|
|||||||
extern hci_cmd_t hci_reset;
|
extern hci_cmd_t hci_reset;
|
||||||
extern hci_cmd_t hci_create_connection;
|
extern hci_cmd_t hci_create_connection;
|
||||||
extern hci_cmd_t hci_disconnect;
|
extern hci_cmd_t hci_disconnect;
|
||||||
|
extern hci_cmd_t hci_create_connection_cancel;
|
||||||
extern hci_cmd_t hci_host_buffer_size;
|
extern hci_cmd_t hci_host_buffer_size;
|
||||||
extern hci_cmd_t hci_write_authentication_enable;
|
extern hci_cmd_t hci_write_authentication_enable;
|
||||||
extern hci_cmd_t hci_write_local_name;
|
extern hci_cmd_t hci_write_local_name;
|
||||||
|
@ -15,6 +15,7 @@ echo "Version: $VERSION-$REVISION" >> $PACKAGE/DEBIAN/control
|
|||||||
|
|
||||||
mkdir -p $PACKAGE/usr/local/bin
|
mkdir -p $PACKAGE/usr/local/bin
|
||||||
cp src/BTdaemon $PACKAGE/usr/local/bin
|
cp src/BTdaemon $PACKAGE/usr/local/bin
|
||||||
|
cp example/inquiry $PACKAGE/usr/local/bin
|
||||||
|
|
||||||
mkdir -p $PACKAGE/usr/local/lib
|
mkdir -p $PACKAGE/usr/local/lib
|
||||||
cp src/libBTstack.dylib $PACKAGE/usr/local/lib
|
cp src/libBTstack.dylib $PACKAGE/usr/local/lib
|
||||||
|
@ -28,19 +28,6 @@
|
|||||||
9C7ECB840FCC85650085DAC5 /* bt_control_iphone.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C7ECB820FCC85650085DAC5 /* bt_control_iphone.c */; };
|
9C7ECB840FCC85650085DAC5 /* bt_control_iphone.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C7ECB820FCC85650085DAC5 /* bt_control_iphone.c */; };
|
||||||
9C7ECBB50FCC95DD0085DAC5 /* hci_dump.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C7ECBB40FCC95DD0085DAC5 /* hci_dump.c */; };
|
9C7ECBB50FCC95DD0085DAC5 /* hci_dump.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C7ECBB40FCC95DD0085DAC5 /* hci_dump.c */; };
|
||||||
9C88500E0FBF6702004980E4 /* l2cap.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C88500C0FBF6702004980E4 /* l2cap.c */; };
|
9C88500E0FBF6702004980E4 /* l2cap.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C88500C0FBF6702004980E4 /* l2cap.c */; };
|
||||||
9C88A1E010C7DE310003DF36 /* BTDevice.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C88A1AE10C7DE310003DF36 /* BTDevice.o */; };
|
|
||||||
9C88A1E110C7DE310003DF36 /* BTInquiryViewController.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C88A1AF10C7DE310003DF36 /* BTInquiryViewController.o */; };
|
|
||||||
9C88A1E210C7DE310003DF36 /* main.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C88A1B110C7DE310003DF36 /* main.o */; };
|
|
||||||
9C88A1E310C7DE310003DF36 /* BTDevice.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C88A1BF10C7DE310003DF36 /* BTDevice.o */; };
|
|
||||||
9C88A1E410C7DE310003DF36 /* BTInquiryViewController.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C88A1C010C7DE310003DF36 /* BTInquiryViewController.o */; };
|
|
||||||
9C88A1E510C7DE310003DF36 /* BTInquiryViewController.o~$ in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C88A1C110C7DE310003DF36 /* BTInquiryViewController.o~$ */; };
|
|
||||||
9C88A1E610C7DE310003DF36 /* BTstackCocoaAppDelegate.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C88A1C510C7DE310003DF36 /* BTstackCocoaAppDelegate.o */; };
|
|
||||||
9C88A1E710C7DE310003DF36 /* BTstackCocoaAppDelegate.o~$ in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C88A1C610C7DE310003DF36 /* BTstackCocoaAppDelegate.o~$ */; };
|
|
||||||
9C88A1E810C7DE310003DF36 /* main.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C88A1C810C7DE310003DF36 /* main.o */; };
|
|
||||||
9C88A1E910C7DE310003DF36 /* BTDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C88A1DB10C7DE310003DF36 /* BTDevice.m */; };
|
|
||||||
9C88A1EA10C7DE310003DF36 /* BTInquiryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C88A1DC10C7DE310003DF36 /* BTInquiryViewController.m */; };
|
|
||||||
9C88A1EB10C7DE310003DF36 /* BTstackCocoaAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C88A1DE10C7DE310003DF36 /* BTstackCocoaAppDelegate.m */; };
|
|
||||||
9C88A1EC10C7DE310003DF36 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C88A1DF10C7DE310003DF36 /* main.m */; };
|
|
||||||
9CC813A20FFC0774002816F9 /* btstack.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CC813A10FFC0774002816F9 /* btstack.c */; };
|
9CC813A20FFC0774002816F9 /* btstack.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CC813A10FFC0774002816F9 /* btstack.c */; };
|
||||||
9CC813A50FFC0A51002816F9 /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CC813A40FFC0A51002816F9 /* daemon.c */; };
|
9CC813A50FFC0A51002816F9 /* daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = 9CC813A40FFC0A51002816F9 /* daemon.c */; };
|
||||||
9CCE6CEA1025BD0000FCE9F4 /* hci.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C46FC340FA906F700ABEF05 /* hci.c */; };
|
9CCE6CEA1025BD0000FCE9F4 /* hci.c in Sources */ = {isa = PBXBuildFile; fileRef = 9C46FC340FA906F700ABEF05 /* hci.c */; };
|
||||||
@ -117,60 +104,12 @@
|
|||||||
9C88A18C10C7DE310003DF36 /* BTstackCocoa-Info.plist */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.plist.xml; path = "BTstackCocoa-Info.plist"; sourceTree = "<group>"; };
|
9C88A18C10C7DE310003DF36 /* BTstackCocoa-Info.plist */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.plist.xml; path = "BTstackCocoa-Info.plist"; sourceTree = "<group>"; };
|
||||||
9C88A18D10C7DE310003DF36 /* BTstackCocoa.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = BTstackCocoa.xcodeproj; sourceTree = "<group>"; };
|
9C88A18D10C7DE310003DF36 /* BTstackCocoa.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = BTstackCocoa.xcodeproj; sourceTree = "<group>"; };
|
||||||
9C88A19010C7DE310003DF36 /* BTstackCocoa_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = BTstackCocoa_Prefix.pch; sourceTree = "<group>"; };
|
9C88A19010C7DE310003DF36 /* BTstackCocoa_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = BTstackCocoa_Prefix.pch; sourceTree = "<group>"; };
|
||||||
9C88A19410C7DE310003DF36 /* categories.pbxbtree */ = {isa = PBXFileReference; lastKnownFileType = file; path = categories.pbxbtree; sourceTree = "<group>"; };
|
|
||||||
9C88A19510C7DE310003DF36 /* cdecls.pbxbtree */ = {isa = PBXFileReference; lastKnownFileType = file; path = cdecls.pbxbtree; sourceTree = "<group>"; };
|
|
||||||
9C88A19610C7DE310003DF36 /* decls.pbxbtree */ = {isa = PBXFileReference; lastKnownFileType = file; path = decls.pbxbtree; sourceTree = "<group>"; };
|
|
||||||
9C88A19710C7DE310003DF36 /* files.pbxbtree */ = {isa = PBXFileReference; lastKnownFileType = file; path = files.pbxbtree; sourceTree = "<group>"; };
|
|
||||||
9C88A19810C7DE310003DF36 /* imports.pbxbtree */ = {isa = PBXFileReference; lastKnownFileType = file; path = imports.pbxbtree; sourceTree = "<group>"; };
|
|
||||||
9C88A19910C7DE310003DF36 /* pbxindex.header */ = {isa = PBXFileReference; lastKnownFileType = file; path = pbxindex.header; sourceTree = "<group>"; };
|
|
||||||
9C88A19A10C7DE310003DF36 /* protocols.pbxbtree */ = {isa = PBXFileReference; lastKnownFileType = file; path = protocols.pbxbtree; sourceTree = "<group>"; };
|
|
||||||
9C88A19B10C7DE310003DF36 /* refs.pbxbtree */ = {isa = PBXFileReference; lastKnownFileType = file; path = refs.pbxbtree; sourceTree = "<group>"; };
|
|
||||||
9C88A19D10C7DE310003DF36 /* control */ = {isa = PBXFileReference; lastKnownFileType = file; path = control; sourceTree = "<group>"; };
|
9C88A19D10C7DE310003DF36 /* control */ = {isa = PBXFileReference; lastKnownFileType = file; path = control; sourceTree = "<group>"; };
|
||||||
9C88A19E10C7DE310003DF36 /* strings */ = {isa = PBXFileReference; lastKnownFileType = file; path = strings; sourceTree = "<group>"; };
|
|
||||||
9C88A19F10C7DE310003DF36 /* subclasses.pbxbtree */ = {isa = PBXFileReference; lastKnownFileType = file; path = subclasses.pbxbtree; sourceTree = "<group>"; };
|
|
||||||
9C88A1A010C7DE310003DF36 /* symbols0.pbxsymbols */ = {isa = PBXFileReference; lastKnownFileType = file; path = symbols0.pbxsymbols; sourceTree = "<group>"; };
|
|
||||||
9C88A1A310C7DE310003DF36 /* BTstackCocoa-all-target-headers.hmap */ = {isa = PBXFileReference; lastKnownFileType = file; path = "BTstackCocoa-all-target-headers.hmap"; sourceTree = "<group>"; };
|
|
||||||
9C88A1A410C7DE310003DF36 /* BTstackCocoa-generated-files.hmap */ = {isa = PBXFileReference; lastKnownFileType = file; path = "BTstackCocoa-generated-files.hmap"; sourceTree = "<group>"; };
|
|
||||||
9C88A1A510C7DE310003DF36 /* BTstackCocoa-own-target-headers.hmap */ = {isa = PBXFileReference; lastKnownFileType = file; path = "BTstackCocoa-own-target-headers.hmap"; sourceTree = "<group>"; };
|
|
||||||
9C88A1A610C7DE310003DF36 /* BTstackCocoa-project-headers.hmap */ = {isa = PBXFileReference; lastKnownFileType = file; path = "BTstackCocoa-project-headers.hmap"; sourceTree = "<group>"; };
|
|
||||||
9C88A1A710C7DE310003DF36 /* BTstackCocoa.dep */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = BTstackCocoa.dep; sourceTree = "<group>"; };
|
|
||||||
9C88A1A810C7DE310003DF36 /* BTstackCocoa.hmap */ = {isa = PBXFileReference; lastKnownFileType = file; path = BTstackCocoa.hmap; sourceTree = "<group>"; };
|
|
||||||
9C88A1A910C7DE310003DF36 /* BTstackCocoa~.dep */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "BTstackCocoa~.dep"; sourceTree = "<group>"; };
|
|
||||||
9C88A1AA10C7DE310003DF36 /* build-state.dat */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "build-state.dat"; sourceTree = "<group>"; };
|
|
||||||
9C88A1AB10C7DE310003DF36 /* build-state~.dat */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "build-state~.dat"; sourceTree = "<group>"; };
|
|
||||||
9C88A1AE10C7DE310003DF36 /* BTDevice.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = BTDevice.o; sourceTree = "<group>"; };
|
|
||||||
9C88A1AF10C7DE310003DF36 /* BTInquiryViewController.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = BTInquiryViewController.o; sourceTree = "<group>"; };
|
|
||||||
9C88A1B010C7DE310003DF36 /* BTstackCocoa.LinkFileList */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = BTstackCocoa.LinkFileList; sourceTree = "<group>"; };
|
|
||||||
9C88A1B110C7DE310003DF36 /* main.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = main.o; sourceTree = "<group>"; };
|
|
||||||
9C88A1B410C7DE310003DF36 /* BTstackCocoa-all-target-headers.hmap */ = {isa = PBXFileReference; lastKnownFileType = file; path = "BTstackCocoa-all-target-headers.hmap"; sourceTree = "<group>"; };
|
|
||||||
9C88A1B510C7DE310003DF36 /* BTstackCocoa-generated-files.hmap */ = {isa = PBXFileReference; lastKnownFileType = file; path = "BTstackCocoa-generated-files.hmap"; sourceTree = "<group>"; };
|
|
||||||
9C88A1B610C7DE310003DF36 /* BTstackCocoa-own-target-headers.hmap */ = {isa = PBXFileReference; lastKnownFileType = file; path = "BTstackCocoa-own-target-headers.hmap"; sourceTree = "<group>"; };
|
|
||||||
9C88A1B710C7DE310003DF36 /* BTstackCocoa-project-headers.hmap */ = {isa = PBXFileReference; lastKnownFileType = file; path = "BTstackCocoa-project-headers.hmap"; sourceTree = "<group>"; };
|
|
||||||
9C88A1B810C7DE310003DF36 /* BTstackCocoa.dep */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = BTstackCocoa.dep; sourceTree = "<group>"; };
|
|
||||||
9C88A1B910C7DE310003DF36 /* BTstackCocoa.hmap */ = {isa = PBXFileReference; lastKnownFileType = file; path = BTstackCocoa.hmap; sourceTree = "<group>"; };
|
|
||||||
9C88A1BA10C7DE310003DF36 /* BTstackCocoa~.dep */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "BTstackCocoa~.dep"; sourceTree = "<group>"; };
|
|
||||||
9C88A1BB10C7DE310003DF36 /* build-state.dat */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "build-state.dat"; sourceTree = "<group>"; };
|
|
||||||
9C88A1BC10C7DE310003DF36 /* build-state~.dat */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "build-state~.dat"; sourceTree = "<group>"; };
|
|
||||||
9C88A1BF10C7DE310003DF36 /* BTDevice.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = BTDevice.o; sourceTree = "<group>"; };
|
|
||||||
9C88A1C010C7DE310003DF36 /* BTInquiryViewController.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = BTInquiryViewController.o; sourceTree = "<group>"; };
|
|
||||||
9C88A1C110C7DE310003DF36 /* BTInquiryViewController.o~$ */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = "BTInquiryViewController.o~$"; sourceTree = "<group>"; };
|
|
||||||
9C88A1C210C7DE310003DF36 /* BTInquiryViewController.o~> */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "BTInquiryViewController.o~>"; sourceTree = "<group>"; };
|
|
||||||
9C88A1C310C7DE310003DF36 /* BTInquiryViewController.o~? */ = {isa = PBXFileReference; lastKnownFileType = file; path = "BTInquiryViewController.o~?"; sourceTree = "<group>"; };
|
|
||||||
9C88A1C410C7DE310003DF36 /* BTstackCocoa.LinkFileList */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = BTstackCocoa.LinkFileList; sourceTree = "<group>"; };
|
|
||||||
9C88A1C510C7DE310003DF36 /* BTstackCocoaAppDelegate.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = BTstackCocoaAppDelegate.o; sourceTree = "<group>"; };
|
|
||||||
9C88A1C610C7DE310003DF36 /* BTstackCocoaAppDelegate.o~$ */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = "BTstackCocoaAppDelegate.o~$"; sourceTree = "<group>"; };
|
|
||||||
9C88A1C710C7DE310003DF36 /* BTstackCocoaAppDelegate.o~> */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "BTstackCocoaAppDelegate.o~>"; sourceTree = "<group>"; };
|
|
||||||
9C88A1C810C7DE310003DF36 /* main.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = main.o; sourceTree = "<group>"; };
|
|
||||||
9C88A1CA10C7DE310003DF36 /* BTstackCocoa.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; path = BTstackCocoa.app; sourceTree = "<group>"; };
|
|
||||||
9C88A1CB10C7DE310003DF36 /* BTstackCocoa.app.dSYM */ = {isa = PBXFileReference; lastKnownFileType = wrapper.dsym; path = BTstackCocoa.app.dSYM; sourceTree = "<group>"; };
|
|
||||||
9C88A1CD10C7DE310003DF36 /* BTstackCocoa.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; path = BTstackCocoa.app; sourceTree = "<group>"; };
|
|
||||||
9C88A1CE10C7DE310003DF36 /* BTstackCocoa.app.dSYM */ = {isa = PBXFileReference; lastKnownFileType = wrapper.dsym; path = BTstackCocoa.app.dSYM; sourceTree = "<group>"; };
|
|
||||||
9C88A1D010C7DE310003DF36 /* bluetooth.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bluetooth.png; sourceTree = "<group>"; };
|
9C88A1D010C7DE310003DF36 /* bluetooth.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bluetooth.png; sourceTree = "<group>"; };
|
||||||
9C88A1D110C7DE310003DF36 /* computer.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = computer.png; sourceTree = "<group>"; };
|
9C88A1D110C7DE310003DF36 /* computer.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = computer.png; sourceTree = "<group>"; };
|
||||||
9C88A1D210C7DE310003DF36 /* keyboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = keyboard.png; sourceTree = "<group>"; };
|
9C88A1D210C7DE310003DF36 /* keyboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = keyboard.png; sourceTree = "<group>"; };
|
||||||
9C88A1D310C7DE310003DF36 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = LICENSE.txt; sourceTree = "<group>"; };
|
9C88A1D310C7DE310003DF36 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = LICENSE.txt; sourceTree = "<group>"; };
|
||||||
9C88A1D410C7DE310003DF36 /* smartphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = smartphone.png; sourceTree = "<group>"; };
|
9C88A1D410C7DE310003DF36 /* smartphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = smartphone.png; sourceTree = "<group>"; };
|
||||||
9C88A1D510C7DE310003DF36 /* Untitled.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Untitled.txt; sourceTree = "<group>"; };
|
|
||||||
9C88A1D810C7DE310003DF36 /* BTDevice.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = BTDevice.h; sourceTree = "<group>"; };
|
9C88A1D810C7DE310003DF36 /* BTDevice.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = BTDevice.h; sourceTree = "<group>"; };
|
||||||
9C88A1D910C7DE310003DF36 /* BTInquiryViewController.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = BTInquiryViewController.h; sourceTree = "<group>"; };
|
9C88A1D910C7DE310003DF36 /* BTInquiryViewController.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = BTInquiryViewController.h; sourceTree = "<group>"; };
|
||||||
9C88A1DB10C7DE310003DF36 /* BTDevice.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = BTDevice.m; sourceTree = "<group>"; };
|
9C88A1DB10C7DE310003DF36 /* BTDevice.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = BTDevice.m; sourceTree = "<group>"; };
|
||||||
@ -203,15 +142,6 @@
|
|||||||
files = (
|
files = (
|
||||||
9C04B87A107D2BA7002A63D0 /* CoreFoundation.framework in Frameworks */,
|
9C04B87A107D2BA7002A63D0 /* CoreFoundation.framework in Frameworks */,
|
||||||
9C18015C108BAA7200824BE7 /* libusb-1.0.dylib in Frameworks */,
|
9C18015C108BAA7200824BE7 /* libusb-1.0.dylib in Frameworks */,
|
||||||
9C88A1E010C7DE310003DF36 /* BTDevice.o in Frameworks */,
|
|
||||||
9C88A1E110C7DE310003DF36 /* BTInquiryViewController.o in Frameworks */,
|
|
||||||
9C88A1E210C7DE310003DF36 /* main.o in Frameworks */,
|
|
||||||
9C88A1E310C7DE310003DF36 /* BTDevice.o in Frameworks */,
|
|
||||||
9C88A1E410C7DE310003DF36 /* BTInquiryViewController.o in Frameworks */,
|
|
||||||
9C88A1E510C7DE310003DF36 /* BTInquiryViewController.o~$ in Frameworks */,
|
|
||||||
9C88A1E610C7DE310003DF36 /* BTstackCocoaAppDelegate.o in Frameworks */,
|
|
||||||
9C88A1E710C7DE310003DF36 /* BTstackCocoaAppDelegate.o~$ in Frameworks */,
|
|
||||||
9C88A1E810C7DE310003DF36 /* main.o in Frameworks */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -384,17 +314,7 @@
|
|||||||
9C88A19310C7DE310003DF36 /* BTstackCocoa.pbxindex */ = {
|
9C88A19310C7DE310003DF36 /* BTstackCocoa.pbxindex */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
9C88A19410C7DE310003DF36 /* categories.pbxbtree */,
|
|
||||||
9C88A19510C7DE310003DF36 /* cdecls.pbxbtree */,
|
|
||||||
9C88A19610C7DE310003DF36 /* decls.pbxbtree */,
|
|
||||||
9C88A19710C7DE310003DF36 /* files.pbxbtree */,
|
|
||||||
9C88A19810C7DE310003DF36 /* imports.pbxbtree */,
|
|
||||||
9C88A19910C7DE310003DF36 /* pbxindex.header */,
|
|
||||||
9C88A19A10C7DE310003DF36 /* protocols.pbxbtree */,
|
|
||||||
9C88A19B10C7DE310003DF36 /* refs.pbxbtree */,
|
|
||||||
9C88A19C10C7DE310003DF36 /* strings.pbxstrings */,
|
9C88A19C10C7DE310003DF36 /* strings.pbxstrings */,
|
||||||
9C88A19F10C7DE310003DF36 /* subclasses.pbxbtree */,
|
|
||||||
9C88A1A010C7DE310003DF36 /* symbols0.pbxsymbols */,
|
|
||||||
);
|
);
|
||||||
path = BTstackCocoa.pbxindex;
|
path = BTstackCocoa.pbxindex;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -403,7 +323,6 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
9C88A19D10C7DE310003DF36 /* control */,
|
9C88A19D10C7DE310003DF36 /* control */,
|
||||||
9C88A19E10C7DE310003DF36 /* strings */,
|
|
||||||
);
|
);
|
||||||
path = strings.pbxstrings;
|
path = strings.pbxstrings;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -419,15 +338,6 @@
|
|||||||
9C88A1A210C7DE310003DF36 /* BTstackCocoa.build */ = {
|
9C88A1A210C7DE310003DF36 /* BTstackCocoa.build */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
9C88A1A310C7DE310003DF36 /* BTstackCocoa-all-target-headers.hmap */,
|
|
||||||
9C88A1A410C7DE310003DF36 /* BTstackCocoa-generated-files.hmap */,
|
|
||||||
9C88A1A510C7DE310003DF36 /* BTstackCocoa-own-target-headers.hmap */,
|
|
||||||
9C88A1A610C7DE310003DF36 /* BTstackCocoa-project-headers.hmap */,
|
|
||||||
9C88A1A710C7DE310003DF36 /* BTstackCocoa.dep */,
|
|
||||||
9C88A1A810C7DE310003DF36 /* BTstackCocoa.hmap */,
|
|
||||||
9C88A1A910C7DE310003DF36 /* BTstackCocoa~.dep */,
|
|
||||||
9C88A1AA10C7DE310003DF36 /* build-state.dat */,
|
|
||||||
9C88A1AB10C7DE310003DF36 /* build-state~.dat */,
|
|
||||||
9C88A1AC10C7DE310003DF36 /* Objects-normal */,
|
9C88A1AC10C7DE310003DF36 /* Objects-normal */,
|
||||||
);
|
);
|
||||||
path = BTstackCocoa.build;
|
path = BTstackCocoa.build;
|
||||||
@ -444,10 +354,6 @@
|
|||||||
9C88A1AD10C7DE310003DF36 /* armv6 */ = {
|
9C88A1AD10C7DE310003DF36 /* armv6 */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
9C88A1AE10C7DE310003DF36 /* BTDevice.o */,
|
|
||||||
9C88A1AF10C7DE310003DF36 /* BTInquiryViewController.o */,
|
|
||||||
9C88A1B010C7DE310003DF36 /* BTstackCocoa.LinkFileList */,
|
|
||||||
9C88A1B110C7DE310003DF36 /* main.o */,
|
|
||||||
);
|
);
|
||||||
path = armv6;
|
path = armv6;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -463,15 +369,6 @@
|
|||||||
9C88A1B310C7DE310003DF36 /* BTstackCocoa.build */ = {
|
9C88A1B310C7DE310003DF36 /* BTstackCocoa.build */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
9C88A1B410C7DE310003DF36 /* BTstackCocoa-all-target-headers.hmap */,
|
|
||||||
9C88A1B510C7DE310003DF36 /* BTstackCocoa-generated-files.hmap */,
|
|
||||||
9C88A1B610C7DE310003DF36 /* BTstackCocoa-own-target-headers.hmap */,
|
|
||||||
9C88A1B710C7DE310003DF36 /* BTstackCocoa-project-headers.hmap */,
|
|
||||||
9C88A1B810C7DE310003DF36 /* BTstackCocoa.dep */,
|
|
||||||
9C88A1B910C7DE310003DF36 /* BTstackCocoa.hmap */,
|
|
||||||
9C88A1BA10C7DE310003DF36 /* BTstackCocoa~.dep */,
|
|
||||||
9C88A1BB10C7DE310003DF36 /* build-state.dat */,
|
|
||||||
9C88A1BC10C7DE310003DF36 /* build-state~.dat */,
|
|
||||||
9C88A1BD10C7DE310003DF36 /* Objects-normal */,
|
9C88A1BD10C7DE310003DF36 /* Objects-normal */,
|
||||||
);
|
);
|
||||||
path = BTstackCocoa.build;
|
path = BTstackCocoa.build;
|
||||||
@ -488,16 +385,6 @@
|
|||||||
9C88A1BE10C7DE310003DF36 /* i386 */ = {
|
9C88A1BE10C7DE310003DF36 /* i386 */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
9C88A1BF10C7DE310003DF36 /* BTDevice.o */,
|
|
||||||
9C88A1C010C7DE310003DF36 /* BTInquiryViewController.o */,
|
|
||||||
9C88A1C110C7DE310003DF36 /* BTInquiryViewController.o~$ */,
|
|
||||||
9C88A1C210C7DE310003DF36 /* BTInquiryViewController.o~> */,
|
|
||||||
9C88A1C310C7DE310003DF36 /* BTInquiryViewController.o~? */,
|
|
||||||
9C88A1C410C7DE310003DF36 /* BTstackCocoa.LinkFileList */,
|
|
||||||
9C88A1C510C7DE310003DF36 /* BTstackCocoaAppDelegate.o */,
|
|
||||||
9C88A1C610C7DE310003DF36 /* BTstackCocoaAppDelegate.o~$ */,
|
|
||||||
9C88A1C710C7DE310003DF36 /* BTstackCocoaAppDelegate.o~> */,
|
|
||||||
9C88A1C810C7DE310003DF36 /* main.o */,
|
|
||||||
);
|
);
|
||||||
path = i386;
|
path = i386;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -505,8 +392,6 @@
|
|||||||
9C88A1C910C7DE310003DF36 /* Debug-iphoneos */ = {
|
9C88A1C910C7DE310003DF36 /* Debug-iphoneos */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
9C88A1CA10C7DE310003DF36 /* BTstackCocoa.app */,
|
|
||||||
9C88A1CB10C7DE310003DF36 /* BTstackCocoa.app.dSYM */,
|
|
||||||
);
|
);
|
||||||
path = "Debug-iphoneos";
|
path = "Debug-iphoneos";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -514,8 +399,6 @@
|
|||||||
9C88A1CC10C7DE310003DF36 /* Debug-iphonesimulator */ = {
|
9C88A1CC10C7DE310003DF36 /* Debug-iphonesimulator */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
9C88A1CD10C7DE310003DF36 /* BTstackCocoa.app */,
|
|
||||||
9C88A1CE10C7DE310003DF36 /* BTstackCocoa.app.dSYM */,
|
|
||||||
);
|
);
|
||||||
path = "Debug-iphonesimulator";
|
path = "Debug-iphonesimulator";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -528,7 +411,6 @@
|
|||||||
9C88A1D210C7DE310003DF36 /* keyboard.png */,
|
9C88A1D210C7DE310003DF36 /* keyboard.png */,
|
||||||
9C88A1D310C7DE310003DF36 /* LICENSE.txt */,
|
9C88A1D310C7DE310003DF36 /* LICENSE.txt */,
|
||||||
9C88A1D410C7DE310003DF36 /* smartphone.png */,
|
9C88A1D410C7DE310003DF36 /* smartphone.png */,
|
||||||
9C88A1D510C7DE310003DF36 /* Untitled.txt */,
|
|
||||||
);
|
);
|
||||||
path = icons;
|
path = icons;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -674,10 +556,6 @@
|
|||||||
9CEB4F17107AAAEF00DD5720 /* run_loop_posix.c in Sources */,
|
9CEB4F17107AAAEF00DD5720 /* run_loop_posix.c in Sources */,
|
||||||
9C04B826107D1CED002A63D0 /* run_loop.c in Sources */,
|
9C04B826107D1CED002A63D0 /* run_loop.c in Sources */,
|
||||||
9C04B876107D2B7C002A63D0 /* run_loop_cocoa.m in Sources */,
|
9C04B876107D2B7C002A63D0 /* run_loop_cocoa.m in Sources */,
|
||||||
9C88A1E910C7DE310003DF36 /* BTDevice.m in Sources */,
|
|
||||||
9C88A1EA10C7DE310003DF36 /* BTInquiryViewController.m in Sources */,
|
|
||||||
9C88A1EB10C7DE310003DF36 /* BTstackCocoaAppDelegate.m in Sources */,
|
|
||||||
9C88A1EC10C7DE310003DF36 /* main.m in Sources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
@ -157,7 +157,10 @@ OPCODE(OGF_LINK_CONTROL, 0x06), "H1"
|
|||||||
// Handle, Reason: 0x05, 0x13-0x15, 0x1a, 0x29
|
// Handle, Reason: 0x05, 0x13-0x15, 0x1a, 0x29
|
||||||
// see Errors Codes in BT Spec Part D
|
// see Errors Codes in BT Spec Part D
|
||||||
};
|
};
|
||||||
|
hci_cmd_t hci_create_connection_cancel = {
|
||||||
|
OPCODE(OGF_LINK_CONTROL, 0x08), "B"
|
||||||
|
// BD_ADDR
|
||||||
|
};
|
||||||
hci_cmd_t hci_accept_connection_request = {
|
hci_cmd_t hci_accept_connection_request = {
|
||||||
OPCODE(OGF_LINK_CONTROL, 0x09), "B1"
|
OPCODE(OGF_LINK_CONTROL, 0x09), "B1"
|
||||||
// BD_ADDR, Role: become master, stay slave
|
// BD_ADDR, Role: become master, stay slave
|
||||||
|
147
src/l2cap.c
147
src/l2cap.c
@ -137,72 +137,109 @@ void l2cap_disconnect_internal(uint16_t source_cid, uint8_t reason){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void l2cap_handle_connection_failed_for_addr(bd_addr_t address, uint8_t status){
|
||||||
|
linked_item_t *it;
|
||||||
|
for (it = (linked_item_t *) l2cap_channels; it ; it = it->next){
|
||||||
|
l2cap_channel_t * channel = (l2cap_channel_t *) it;
|
||||||
|
if ( ! BD_ADDR_CMP( channel->address, address) ){
|
||||||
|
if (channel->state == L2CAP_STATE_CLOSED) {
|
||||||
|
// failure, forward error code
|
||||||
|
l2cap_emit_channel_opened(channel, status);
|
||||||
|
// discard channel
|
||||||
|
linked_list_remove(&l2cap_channels, (linked_item_t *) channel);
|
||||||
|
free (channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void l2cap_handle_connection_success_for_addr(bd_addr_t address, hci_con_handle_t handle){
|
||||||
|
linked_item_t *it;
|
||||||
|
for (it = (linked_item_t *) l2cap_channels; it ; it = it->next){
|
||||||
|
l2cap_channel_t * channel = (l2cap_channel_t *) it;
|
||||||
|
if ( ! BD_ADDR_CMP( channel->address, address) ){
|
||||||
|
if (channel->state == L2CAP_STATE_CLOSED) {
|
||||||
|
// success, start l2cap handshake
|
||||||
|
channel->handle = handle;
|
||||||
|
channel->sig_id = l2cap_next_sig_id();
|
||||||
|
channel->source_cid = l2cap_next_source_cid();
|
||||||
|
channel->state = L2CAP_STATE_WAIT_CONNECT_RSP;
|
||||||
|
l2cap_send_signaling_packet( channel->handle, CONNECTION_REQUEST, channel->sig_id, channel->psm, channel->source_cid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void l2cap_event_handler( uint8_t *packet, uint16_t size ){
|
void l2cap_event_handler( uint8_t *packet, uint16_t size ){
|
||||||
// handle connection complete events
|
|
||||||
if (packet[0] == HCI_EVENT_CONNECTION_COMPLETE) {
|
bd_addr_t address;
|
||||||
bd_addr_t address;
|
hci_con_handle_t handle;
|
||||||
bt_flip_addr(address, &packet[5]);
|
|
||||||
|
switch(packet[0]){
|
||||||
linked_item_t *it;
|
|
||||||
for (it = (linked_item_t *) l2cap_channels; it ; it = it->next){
|
// handle connection complete events
|
||||||
l2cap_channel_t * channel = (l2cap_channel_t *) it;
|
case HCI_EVENT_CONNECTION_COMPLETE:
|
||||||
if ( ! BD_ADDR_CMP( channel->address, address) ){
|
bt_flip_addr(address, &packet[5]);
|
||||||
if (channel->state == L2CAP_STATE_CLOSED) {
|
if (packet[2] == 0){
|
||||||
if (packet[2] == 0){
|
handle = READ_BT_16(packet, 3);
|
||||||
// success, start l2cap handshake
|
l2cap_handle_connection_success_for_addr(address, handle);
|
||||||
channel->handle = READ_BT_16(packet, 3);
|
} else {
|
||||||
channel->sig_id = l2cap_next_sig_id();
|
l2cap_handle_connection_failed_for_addr(address, packet[2]);
|
||||||
channel->source_cid = l2cap_next_source_cid();
|
}
|
||||||
channel->state = L2CAP_STATE_WAIT_CONNECT_RSP;
|
break;
|
||||||
l2cap_send_signaling_packet( channel->handle, CONNECTION_REQUEST, channel->sig_id, channel->psm, channel->source_cid);
|
|
||||||
} else {
|
// handle successful create connection cancel command
|
||||||
// failure, forward error code
|
case HCI_EVENT_COMMAND_COMPLETE:
|
||||||
l2cap_emit_channel_opened(channel, packet[2]);
|
if ( COMMAND_COMPLETE_EVENT(packet, hci_create_connection_cancel) ) {
|
||||||
// discard channel
|
if (packet[5] == 0){
|
||||||
linked_list_remove(&l2cap_channels, (linked_item_t *) channel);
|
bt_flip_addr(address, &packet[6]);
|
||||||
free (channel);
|
// CONNECTION TERMINATED BY LOCAL HOST (0X16)
|
||||||
|
l2cap_handle_connection_failed_for_addr(address, 0x16);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
}
|
|
||||||
|
// handle disconnection complete events
|
||||||
// handle disconnection complete events
|
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
||||||
if (packet[0] == HCI_EVENT_DISCONNECTION_COMPLETE) {
|
// send l2cap disconnect events for all channels on this handle
|
||||||
// send l2cap disconnect events for all channels on this handle
|
handle = READ_BT_16(packet, 3);
|
||||||
hci_con_handle_t handle = READ_BT_16(packet, 3);
|
linked_item_t *it;
|
||||||
linked_item_t *it;
|
for (it = (linked_item_t *) l2cap_channels; it ; it = it->next){
|
||||||
for (it = (linked_item_t *) l2cap_channels; it ; it = it->next){
|
l2cap_channel_t * channel = (l2cap_channel_t *) it;
|
||||||
l2cap_channel_t * channel = (l2cap_channel_t *) it;
|
if ( channel->handle == handle ){
|
||||||
if ( channel->handle == handle ){
|
l2cap_finialize_channel_close(channel);
|
||||||
l2cap_finialize_channel_close(channel);
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
}
|
|
||||||
|
// HCI Connection Timeouts
|
||||||
// HCI Connection Timeouts
|
case L2CAP_EVENT_TIMEOUT_CHECK:
|
||||||
if (packet[0] == L2CAP_EVENT_TIMEOUT_CHECK && !capture_connection){
|
if (!capture_connection){
|
||||||
hci_con_handle_t handle = READ_BT_16(packet, 2);
|
hci_con_handle_t handle = READ_BT_16(packet, 2);
|
||||||
linked_item_t *it;
|
linked_item_t *it;
|
||||||
l2cap_channel_t * channel;
|
l2cap_channel_t * channel;
|
||||||
int used = 0;
|
int used = 0;
|
||||||
for (it = (linked_item_t *) l2cap_channels; it ; it = it->next){
|
for (it = (linked_item_t *) l2cap_channels; it ; it = it->next){
|
||||||
channel = (l2cap_channel_t *) it;
|
channel = (l2cap_channel_t *) it;
|
||||||
if (channel->handle == handle) {
|
if (channel->handle == handle) {
|
||||||
used = 1;
|
used = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!used) {
|
||||||
|
hci_send_cmd(&hci_disconnect, handle, 0x13); // remote closed connection
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
if (!used) {
|
|
||||||
hci_send_cmd(&hci_disconnect, handle, 0x13); // remote closed connection
|
default:
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pass on
|
||||||
(*event_packet_handler)(packet, size);
|
(*event_packet_handler)(packet, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static l2cap_handle_disconnect_request(l2cap_channel_t *channel, uint16_t identifier){
|
static void l2cap_handle_disconnect_request(l2cap_channel_t *channel, uint16_t identifier){
|
||||||
l2cap_send_signaling_packet( channel->handle, DISCONNECTION_RESPONSE, identifier, channel->dest_cid, channel->source_cid);
|
l2cap_send_signaling_packet( channel->handle, DISCONNECTION_RESPONSE, identifier, channel->dest_cid, channel->source_cid);
|
||||||
l2cap_finialize_channel_close(channel);
|
l2cap_finialize_channel_close(channel);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user