aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTat-Chee Wan (USM Signature)2013-11-15 12:33:21 +0800
committerTat-Chee Wan (USM Signature)2013-11-15 12:33:21 +0800
commite084d19c4e17885437a9e71f2c3ae39ad830f5d8 (patch)
tree36be8069027d7232f7c9aaa3f0aa451a54daee0c
parente6d314586ea9e9b4d36efdf8568f0204cfd72f66 (diff)
added xcode project to define missing symbols
IOBluetooth for Mac OS X 10.8+ is missing symbols referenced in Fantom. Defined stub functions for the missing symbols to keep Fantom happy.
-rw-r--r--.gitignore3
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.pbxproj442
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/contents.xcworkspacedata7
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcshareddata/IOBluetooth-Compat.xccheckout41
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcuserdata/tcmac.xcuserdatad/UserInterfaceState.xcuserstatebin0 -> 51931 bytes
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcuserdata/tcmac.xcuserdatad/WorkspaceSettings.xcsettings24
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/xcuserdata/tcmac.xcuserdatad/xcschemes/IOBluetooth-Compat.xcscheme69
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/xcuserdata/tcmac.xcuserdatad/xcschemes/xcschememanagement.plist27
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth-Compat-Prefix.pch9
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.h236
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m102
-rw-r--r--IOBluetooth-Compat/IOBluetooth-CompatTests/IOBluetooth-CompatTests-Info.plist22
-rw-r--r--IOBluetooth-Compat/IOBluetooth-CompatTests/IOBluetooth_CompatTests.m34
-rw-r--r--IOBluetooth-Compat/IOBluetooth-CompatTests/en.lproj/InfoPlist.strings2
-rw-r--r--README12
-rw-r--r--pyfantom.py43
16 files changed, 1062 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 0d20b64..5afc77e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,4 @@
*.pyc
+.project
+# XCode related
+DerivedData/
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.pbxproj b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..159ac79
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.pbxproj
@@ -0,0 +1,442 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 43B43CE81835D78100C0D4EE /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43B43CE71835D78100C0D4EE /* Cocoa.framework */; };
+ 43B43CF21835D78100C0D4EE /* IOBluetooth_Compat.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B43CF11835D78100C0D4EE /* IOBluetooth_Compat.m */; };
+ 43B43CF91835D78100C0D4EE /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43B43CF81835D78100C0D4EE /* XCTest.framework */; };
+ 43B43CFA1835D78100C0D4EE /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43B43CE71835D78100C0D4EE /* Cocoa.framework */; };
+ 43B43CFD1835D78100C0D4EE /* IOBluetooth-Compat.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 43B43CE41835D78100C0D4EE /* IOBluetooth-Compat.dylib */; };
+ 43B43D031835D78100C0D4EE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 43B43D011835D78100C0D4EE /* InfoPlist.strings */; };
+ 43B43D051835D78100C0D4EE /* IOBluetooth_CompatTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B43D041835D78100C0D4EE /* IOBluetooth_CompatTests.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 43B43CFB1835D78100C0D4EE /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 43B43CDC1835D78100C0D4EE /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 43B43CE31835D78100C0D4EE;
+ remoteInfo = "IOBluetooth-Compat";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 43B43CE41835D78100C0D4EE /* IOBluetooth-Compat.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "IOBluetooth-Compat.dylib"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 43B43CE71835D78100C0D4EE /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+ 43B43CEA1835D78100C0D4EE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 43B43CEB1835D78100C0D4EE /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
+ 43B43CEC1835D78100C0D4EE /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+ 43B43CEF1835D78100C0D4EE /* IOBluetooth-Compat-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IOBluetooth-Compat-Prefix.pch"; sourceTree = "<group>"; };
+ 43B43CF01835D78100C0D4EE /* IOBluetooth_Compat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IOBluetooth_Compat.h; sourceTree = "<group>"; };
+ 43B43CF11835D78100C0D4EE /* IOBluetooth_Compat.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IOBluetooth_Compat.m; sourceTree = "<group>"; };
+ 43B43CF71835D78100C0D4EE /* IOBluetooth-CompatTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "IOBluetooth-CompatTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 43B43CF81835D78100C0D4EE /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
+ 43B43D001835D78100C0D4EE /* IOBluetooth-CompatTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "IOBluetooth-CompatTests-Info.plist"; sourceTree = "<group>"; };
+ 43B43D021835D78100C0D4EE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 43B43D041835D78100C0D4EE /* IOBluetooth_CompatTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IOBluetooth_CompatTests.m; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 43B43CE11835D78100C0D4EE /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 43B43CE81835D78100C0D4EE /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 43B43CF41835D78100C0D4EE /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 43B43CFD1835D78100C0D4EE /* IOBluetooth-Compat.dylib in Frameworks */,
+ 43B43CFA1835D78100C0D4EE /* Cocoa.framework in Frameworks */,
+ 43B43CF91835D78100C0D4EE /* XCTest.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 43B43CDB1835D78100C0D4EE = {
+ isa = PBXGroup;
+ children = (
+ 43B43CED1835D78100C0D4EE /* IOBluetooth-Compat */,
+ 43B43CFE1835D78100C0D4EE /* IOBluetooth-CompatTests */,
+ 43B43CE61835D78100C0D4EE /* Frameworks */,
+ 43B43CE51835D78100C0D4EE /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 43B43CE51835D78100C0D4EE /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 43B43CE41835D78100C0D4EE /* IOBluetooth-Compat.dylib */,
+ 43B43CF71835D78100C0D4EE /* IOBluetooth-CompatTests.xctest */,
+ );
+ name = Products;
+ sourceTree = SOURCE_ROOT;
+ };
+ 43B43CE61835D78100C0D4EE /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 43B43CE71835D78100C0D4EE /* Cocoa.framework */,
+ 43B43CF81835D78100C0D4EE /* XCTest.framework */,
+ 43B43CE91835D78100C0D4EE /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 43B43CE91835D78100C0D4EE /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 43B43CEA1835D78100C0D4EE /* Foundation.framework */,
+ 43B43CEB1835D78100C0D4EE /* CoreData.framework */,
+ 43B43CEC1835D78100C0D4EE /* AppKit.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 43B43CED1835D78100C0D4EE /* IOBluetooth-Compat */ = {
+ isa = PBXGroup;
+ children = (
+ 43B43CF01835D78100C0D4EE /* IOBluetooth_Compat.h */,
+ 43B43CF11835D78100C0D4EE /* IOBluetooth_Compat.m */,
+ 43B43CEE1835D78100C0D4EE /* Supporting Files */,
+ );
+ path = "IOBluetooth-Compat";
+ sourceTree = "<group>";
+ };
+ 43B43CEE1835D78100C0D4EE /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 43B43CEF1835D78100C0D4EE /* IOBluetooth-Compat-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 43B43CFE1835D78100C0D4EE /* IOBluetooth-CompatTests */ = {
+ isa = PBXGroup;
+ children = (
+ 43B43D041835D78100C0D4EE /* IOBluetooth_CompatTests.m */,
+ 43B43CFF1835D78100C0D4EE /* Supporting Files */,
+ );
+ path = "IOBluetooth-CompatTests";
+ sourceTree = "<group>";
+ };
+ 43B43CFF1835D78100C0D4EE /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 43B43D001835D78100C0D4EE /* IOBluetooth-CompatTests-Info.plist */,
+ 43B43D011835D78100C0D4EE /* InfoPlist.strings */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 43B43CE21835D78100C0D4EE /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 43B43CE31835D78100C0D4EE /* IOBluetooth-Compat */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 43B43D081835D78100C0D4EE /* Build configuration list for PBXNativeTarget "IOBluetooth-Compat" */;
+ buildPhases = (
+ 43B43CE01835D78100C0D4EE /* Sources */,
+ 43B43CE11835D78100C0D4EE /* Frameworks */,
+ 43B43CE21835D78100C0D4EE /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "IOBluetooth-Compat";
+ productName = "IOBluetooth-Compat";
+ productReference = 43B43CE41835D78100C0D4EE /* IOBluetooth-Compat.dylib */;
+ productType = "com.apple.product-type.library.dynamic";
+ };
+ 43B43CF61835D78100C0D4EE /* IOBluetooth-CompatTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 43B43D0B1835D78100C0D4EE /* Build configuration list for PBXNativeTarget "IOBluetooth-CompatTests" */;
+ buildPhases = (
+ 43B43CF31835D78100C0D4EE /* Sources */,
+ 43B43CF41835D78100C0D4EE /* Frameworks */,
+ 43B43CF51835D78100C0D4EE /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 43B43CFC1835D78100C0D4EE /* PBXTargetDependency */,
+ );
+ name = "IOBluetooth-CompatTests";
+ productName = "IOBluetooth-CompatTests";
+ productReference = 43B43CF71835D78100C0D4EE /* IOBluetooth-CompatTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 43B43CDC1835D78100C0D4EE /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0500;
+ ORGANIZATIONNAME = USM;
+ TargetAttributes = {
+ 43B43CF61835D78100C0D4EE = {
+ TestTargetID = 43B43CE31835D78100C0D4EE;
+ };
+ };
+ };
+ buildConfigurationList = 43B43CDF1835D78100C0D4EE /* Build configuration list for PBXProject "IOBluetooth-Compat" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 43B43CDB1835D78100C0D4EE;
+ productRefGroup = 43B43CE51835D78100C0D4EE /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 43B43CE31835D78100C0D4EE /* IOBluetooth-Compat */,
+ 43B43CF61835D78100C0D4EE /* IOBluetooth-CompatTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 43B43CF51835D78100C0D4EE /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 43B43D031835D78100C0D4EE /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 43B43CE01835D78100C0D4EE /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 43B43CF21835D78100C0D4EE /* IOBluetooth_Compat.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 43B43CF31835D78100C0D4EE /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 43B43D051835D78100C0D4EE /* IOBluetooth_CompatTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 43B43CFC1835D78100C0D4EE /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 43B43CE31835D78100C0D4EE /* IOBluetooth-Compat */;
+ targetProxy = 43B43CFB1835D78100C0D4EE /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 43B43D011835D78100C0D4EE /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 43B43D021835D78100C0D4EE /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 43B43D061835D78100C0D4EE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 43B43D071835D78100C0D4EE /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ 43B43D091835D78100C0D4EE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CLANG_ENABLE_OBJC_ARC = NO;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "IOBluetooth-Compat/IOBluetooth-Compat-Prefix.pch";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ ONLY_ACTIVE_ARCH = NO;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx10.8;
+ };
+ name = Debug;
+ };
+ 43B43D0A1835D78100C0D4EE /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CLANG_ENABLE_OBJC_ARC = NO;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "IOBluetooth-Compat/IOBluetooth-Compat-Prefix.pch";
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx10.8;
+ };
+ name = Release;
+ };
+ 43B43D0C1835D78100C0D4EE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/IOBluetooth-Compat.dylib";
+ COMBINE_HIDPI_IMAGES = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ "$(inherited)",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "IOBluetooth-Compat/IOBluetooth-Compat-Prefix.pch";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "IOBluetooth-CompatTests/IOBluetooth-CompatTests-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TEST_HOST = "$(BUNDLE_LOADER)";
+ WRAPPER_EXTENSION = xctest;
+ };
+ name = Debug;
+ };
+ 43B43D0D1835D78100C0D4EE /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/IOBluetooth-Compat.dylib";
+ COMBINE_HIDPI_IMAGES = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(DEVELOPER_FRAMEWORKS_DIR)",
+ "$(inherited)",
+ );
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "IOBluetooth-Compat/IOBluetooth-Compat-Prefix.pch";
+ INFOPLIST_FILE = "IOBluetooth-CompatTests/IOBluetooth-CompatTests-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TEST_HOST = "$(BUNDLE_LOADER)";
+ WRAPPER_EXTENSION = xctest;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 43B43CDF1835D78100C0D4EE /* Build configuration list for PBXProject "IOBluetooth-Compat" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 43B43D061835D78100C0D4EE /* Debug */,
+ 43B43D071835D78100C0D4EE /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 43B43D081835D78100C0D4EE /* Build configuration list for PBXNativeTarget "IOBluetooth-Compat" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 43B43D091835D78100C0D4EE /* Debug */,
+ 43B43D0A1835D78100C0D4EE /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+ 43B43D0B1835D78100C0D4EE /* Build configuration list for PBXNativeTarget "IOBluetooth-CompatTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 43B43D0C1835D78100C0D4EE /* Debug */,
+ 43B43D0D1835D78100C0D4EE /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 43B43CDC1835D78100C0D4EE /* Project object */;
+}
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..cc02987
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:IOBluetooth-Compat.xcodeproj">
+ </FileRef>
+</Workspace>
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcshareddata/IOBluetooth-Compat.xccheckout b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcshareddata/IOBluetooth-Compat.xccheckout
new file mode 100644
index 0000000..5986be0
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcshareddata/IOBluetooth-Compat.xccheckout
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IDESourceControlProjectFavoriteDictionaryKey</key>
+ <false/>
+ <key>IDESourceControlProjectIdentifier</key>
+ <string>402F1DA4-9EE8-42D6-8005-72CE111EE0ED</string>
+ <key>IDESourceControlProjectName</key>
+ <string>IOBluetooth-Compat</string>
+ <key>IDESourceControlProjectOriginsDictionary</key>
+ <dict>
+ <key>39F9C414-00E5-4EF2-A028-8019D12E78AC</key>
+ <string>git+ssh://ssh.git.ni.fr.eu.org/pyfantom.git</string>
+ </dict>
+ <key>IDESourceControlProjectPath</key>
+ <string>IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace</string>
+ <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
+ <dict>
+ <key>39F9C414-00E5-4EF2-A028-8019D12E78AC</key>
+ <string>../../..</string>
+ </dict>
+ <key>IDESourceControlProjectURL</key>
+ <string>git+ssh://ssh.git.ni.fr.eu.org/pyfantom.git</string>
+ <key>IDESourceControlProjectVersion</key>
+ <integer>110</integer>
+ <key>IDESourceControlProjectWCCIdentifier</key>
+ <string>39F9C414-00E5-4EF2-A028-8019D12E78AC</string>
+ <key>IDESourceControlProjectWCConfigurations</key>
+ <array>
+ <dict>
+ <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
+ <string>public.vcs.git</string>
+ <key>IDESourceControlWCCIdentifierKey</key>
+ <string>39F9C414-00E5-4EF2-A028-8019D12E78AC</string>
+ <key>IDESourceControlWCCName</key>
+ <string>pyfantom</string>
+ </dict>
+ </array>
+</dict>
+</plist>
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcuserdata/tcmac.xcuserdatad/UserInterfaceState.xcuserstate b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcuserdata/tcmac.xcuserdatad/UserInterfaceState.xcuserstate
new file mode 100644
index 0000000..b0d0171
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcuserdata/tcmac.xcuserdatad/UserInterfaceState.xcuserstate
Binary files differ
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcuserdata/tcmac.xcuserdatad/WorkspaceSettings.xcsettings b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcuserdata/tcmac.xcuserdatad/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..42e1f86
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.xcworkspace/xcuserdata/tcmac.xcuserdatad/WorkspaceSettings.xcsettings
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>BuildLocationStyle</key>
+ <string>CustomLocation</string>
+ <key>CustomBuildIntermediatesPath</key>
+ <string>Build/Intermediates</string>
+ <key>CustomBuildLocationType</key>
+ <string>RelativeToDerivedData</string>
+ <key>CustomBuildProductsPath</key>
+ <string>Build/Products</string>
+ <key>DerivedDataLocationStyle</key>
+ <string>Default</string>
+ <key>IssueFilterStyle</key>
+ <string>ShowActiveSchemeOnly</string>
+ <key>LiveSourceIssuesEnabled</key>
+ <true/>
+ <key>SnapshotAutomaticallyBeforeSignificantChanges</key>
+ <true/>
+ <key>SnapshotLocationStyle</key>
+ <string>Default</string>
+</dict>
+</plist>
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/xcuserdata/tcmac.xcuserdatad/xcschemes/IOBluetooth-Compat.xcscheme b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/xcuserdata/tcmac.xcuserdatad/xcschemes/IOBluetooth-Compat.xcscheme
new file mode 100644
index 0000000..fa6b2bb
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/xcuserdata/tcmac.xcuserdatad/xcschemes/IOBluetooth-Compat.xcscheme
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0500"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "43B43CE31835D78100C0D4EE"
+ BuildableName = "IOBluetooth-Compat.dylib"
+ BlueprintName = "IOBluetooth-Compat"
+ ReferencedContainer = "container:IOBluetooth-Compat.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "43B43CF61835D78100C0D4EE"
+ BuildableName = "IOBluetooth-CompatTests.xctest"
+ BlueprintName = "IOBluetooth-CompatTests"
+ ReferencedContainer = "container:IOBluetooth-Compat.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/xcuserdata/tcmac.xcuserdatad/xcschemes/xcschememanagement.plist b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/xcuserdata/tcmac.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644
index 0000000..e7d6c15
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/xcuserdata/tcmac.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>SchemeUserState</key>
+ <dict>
+ <key>IOBluetooth-Compat.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>43B43CE31835D78100C0D4EE</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ <key>43B43CF61835D78100C0D4EE</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</plist>
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth-Compat-Prefix.pch b/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth-Compat-Prefix.pch
new file mode 100644
index 0000000..35d7640
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth-Compat-Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header
+//
+// The contents of this file are implicitly included at the beginning of every source file.
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.h b/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.h
new file mode 100644
index 0000000..a06ed5f
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.h
@@ -0,0 +1,236 @@
+//
+// IOBluetooth_Compat.h
+// IOBluetooth-Compat
+//
+// Created by TCMac on 15/11/2013.
+// Original Header is (c) Apple Inc.
+//
+
+#import <Foundation/Foundation.h>
+#import <IOBluetooth/IOBluetooth.h>
+/*! @typedef IOBluetoothRFCOMMEvent
+ @discussion The events generated by an RFCOMM channel:
+
+ <br>
+ kIOBluetoothRFCOMMChannelEventTypeData: new data.
+ <br>
+ kIOBluetoothRFCOMMChannelEventTypeFlowControlChanged: flow control changed.
+ <br>
+ kIOBluetoothRFCOMMChannelEventTypeClosed: channel terminated.
+ <br>
+ kIOBluetoothRFCOMMChannelEventTypeControlSignalsChanged: signals (like DTR, CTR) changed. (not yet supported)
+ <br>
+ kIOBluetoothRFCOMMChannelEventTypeWriteComplete: write operation completed
+ <br>
+ kIOBluetoothRFCOMMChannelEventTypeQueueSpaceAvailable: more room in the RFCOMM channel output queue
+
+ Obsolete Event types:
+
+ <br>
+ kIOBluetoothRFCOMMNewDataEvent: new data.
+ <br>
+ kIOBluetoothRFCOMMFlowControlChangedEvent: flow control changed.
+ <br>
+ kIOBluetoothRFCOMMChannelTerminatedEvent: channel terminated.
+ <br>
+ kIOBluetoothRFCOMMControlSignalsChangedEvent: signals (like DTR, CTR) changed. (not yet supported)
+ <br>
+
+ See the description of kIOBluetoothRFCOMMChannelEventTypeDataType and kIOBluetoothRFCOMMChannelEventTypeFlowControlChangedType for more
+ information on these events.
+ */
+
+
+typedef enum IOBluetoothRFCOMMChannelEventType {
+ // New event types added in 1.2 (Mac OS X 10.2.5)
+ kIOBluetoothRFCOMMChannelEventTypeData = 0x0000,
+ kIOBluetoothRFCOMMChannelEventTypeFlowControlChanged = 0x0001,
+ kIOBluetoothRFCOMMChannelEventTypeClosed = 0x0002,
+ kIOBluetoothRFCOMMChannelEventTypeOpenComplete = 0x0003,
+ kIOBluetoothRFCOMMChannelEventTypeControlSignalsChanged = 0x0004,
+ kIOBluetoothRFCOMMChannelEventTypeWriteComplete = 0x0005,
+ kIOBluetoothRFCOMMChannelEventTypeQueueSpaceAvailable = 0x0006,
+
+ // Obsolete Event names:
+ kIOBluetoothRFCOMMNewDataEvent = 0x0000,
+ kIOBluetoothRFCOMMFlowControlChangedEvent = 0x0001,
+ kIOBluetoothRFCOMMChannelTerminatedEvent = 0x0002
+} IOBluetoothRFCOMMChannelEventType;
+
+// This is to keep build build. Please use the new type, this is going to be deprecated
+typedef IOBluetoothRFCOMMChannelEventType IOBluetoothRFCOMMEvent;
+
+//--------------------------------------------------------------------------------------------------------------------------
+/*! @typedef IOBluetoothRFCOMMDataBlock
+ @discussion Associted to the kIOBluetoothRFCOMMNewDataEvent it carries a pointer and a size of the new incoming data.
+
+ */
+
+typedef struct IOBluetoothRFCOMMDataBlock
+{
+ void *dataPtr;
+ size_t dataSize;
+} IOBluetoothRFCOMMDataBlock;
+
+//--------------------------------------------------------------------------------------------------------------------------
+/*! @typedef IOBluetoothRFCOMMFlowControlStatus
+ @discussion Related to the kIOBluetoothRFCOMMFlowControlChangedEvent it carries the status of the flow control.
+ For the first release of the APIs this event is generated only when flow control switches from OFF
+ to ON. Future releases will support the switch from ON to OFF as well.
+ */
+
+typedef enum IOBluetoothRFCOMMFlowControlStatus {
+ kIOBluetoothRFCOMMChannelFlowControlStatusIsOff = 0x0000,
+ kIOBluetoothRFCOMMChannelFlowControlStatusIsOn = 0x0001
+} IOBluetoothRFCOMMFlowControlStatus;
+
+//--------------------------------------------------------------------------------------------------------------------------
+/*! @typedef IOBluetoothRFCOMMChannelEvent
+ @discussion Structure that holds an RFCOMM event.
+ */
+
+typedef struct IOBluetoothRFCOMMChannelEvent {
+ // Caution: You cannot add any more values here for binary compatibility reasons
+ IOBluetoothRFCOMMChannelEventType eventType;
+ union
+ {
+ // Caution: An element of this union cannot grow beyond 32 bytes in size for binary compatibility reasons.
+ IOBluetoothRFCOMMDataBlock data;
+ IOBluetoothRFCOMMFlowControlStatus flowStatus;
+ IOBluetoothRFCOMMChannelRef terminatedChannel;
+ void* writeRefCon;
+
+ UInt8 padding[32];
+
+ // Old name, is going to be deprecated, use data instead
+ IOBluetoothRFCOMMDataBlock newData;
+ } u;
+ IOReturn status;
+ // Add new items above this comment.
+} IOBluetoothRFCOMMChannelEvent;
+
+@interface IOBluetooth_Compat : NSObject
+/*! @typedef IOBluetoothRFCOMMChannelIncomingEventListener
+ @abstract Typedef for the RFCOMM channel event listener.
+ @param rfcommChannel (IOBluetoothRFCOMMChannelRef) RFCOMM channel which received the events.
+ @param refCon (void *) User-defined refCon provided upon registration.
+ @param event (IOBluetoothRFCOMMChannelEvent) The type of event for this notification.
+ @discussion This is the definition for the callback which will be invoked upon receiving data on a RFCOMM channel.
+
+ For example an event listener function:
+
+ <pre>
+
+ void rfcommEventListener (IOBluetoothRFCOMMChannelRef rfcommChannel, void *refCon, IOBluetoothRFCOMMChannelEvent *event)
+ {
+ switch (event->eventType)
+ {
+ case kIOBluetoothRFCOMMNewDataEvent:
+ // In thise case:
+ // event->u.newData.dataPtr is a pointer to the block of data received.
+ // event->u.newData.dataSize is the size of the block of data.
+ break;
+
+ case kIOBluetoothRFCOMMFlowControlChangedEvent:
+ // In thise case:
+ // event->u.flowStatus is the status of flow control (see IOBluetoothRFCOMMFlowControlStatus for current restrictions)
+ break;
+
+ case kIOBluetoothRFCOMMChannelTerminatedEvent:
+ // In this case:
+ // event->u.terminatedChannel is the channel that was terminated. It can be converted in an IOBluetoothRFCOMMChannel
+ // object with [IOBluetoothRFCOMMChannel withRFCOMMChannelRef:]. (see below).
+ break;
+ }
+ }
+
+ </pre>
+
+ rfcommChannel is the channel that generated the event and it is the channel where the callback was generated.
+ rfcommChannel is a IOBluetoothRFCOMMChannelRef reference, it can be converted in an Objective C IOBluetoothRFCOMMChannel
+ object with:
+
+ <pre>
+
+ IOBluetoothRFCOMMChannel *myOBJCChannel = [IOBluetoothRFCOMMChannel withRFCOMMChannelRef:rfcommChannel];
+
+ </pre>
+ */
+
+typedef void (*IOBluetoothRFCOMMChannelIncomingEventListener)(IOBluetoothRFCOMMChannelRef rfcommChannel, void *refCon, IOBluetoothRFCOMMChannelEvent *event);
+
+/*!
+ @function IOBluetoothSDPServiceRecordGetRFCOMMChannelID
+ @abstract Allows the discovery of the RFCOMM channel ID assigned to the service.
+ @discussion This function will search through the ProtoclDescriptorList attribute to find an entry
+ with the RFCOMM UUID (UUID16: 0x0003). If one is found, it gets the second element of
+ the data element sequence and sets the rfcommChannelID pointer to it. The channel ID
+ only gets set when kIOReturnSuccess is returned.
+ @param serviceRecord The target IOBluetoothSDPServiceRecordRef
+ @param rfcommChannelID A pointer to the location that will get the found RFCOMM channel ID.
+ @result Returns kIOReturnSuccess if the channel ID is found.
+ */
+
+IOReturn IOBluetoothSDPServiceRecordGetRFCOMMChannelID(IOBluetoothSDPServiceRecordRef serviceRecord, BluetoothRFCOMMChannelID *channelID);
+
+/*! @function IOBluetoothRFCOMMChannelGetMTU
+ @abstract
+ @param rfcommChannel (IOBluetoothRFCOMMChannelRef) The channel reference
+ @result Channel MTU size.
+ @discussion Returns the length of the largest chunk of data that this channel can carry. If the
+ caller wishes to use the write:length:sleep: api the length of the data can not be bigger than
+ the channel MTU (maximum transfer unit).
+ */
+
+BluetoothRFCOMMMTU IOBluetoothRFCOMMChannelGetMTU( IOBluetoothRFCOMMChannelRef rfcommChannel );
+
+/*! @function IOBluetoothRFCOMMChannelCloseChannel
+ @param rfcommChannel (IOBluetoothRFCOMMChannelRef) The channel reference
+ @result An error code value. 0 if successful.
+ @discussion
+ */
+
+IOReturn IOBluetoothRFCOMMChannelCloseChannel(IOBluetoothRFCOMMChannelRef rfcommChannel);
+
+/*! @function IOBluetoothRFCOMMChannelWriteAsync
+ @abstract Write data to a RFCOMM channel asynchronously.
+ @param rfcommChannel (IOBluetoothRFCOMMChannelRef) The channel reference
+ @param data is a pointer to the data buffer to be sent.
+ @param length the length of the buffer to be sent (in bytes).
+ @param refcon a NON NULL value that will be contained in the return event (once the data is sent).
+ @result An error code value. 0 if successful.
+ @discussion Sends data tough the channel. The number of bytes to be sent must not exceed the channel MTU.
+ If the return value is an error condition none of the data was sent.
+
+ NOTE: This function is only available in Mac OS X 10.2.5 (Bluetooth v1.2) or later.
+ */
+
+IOReturn IOBluetoothRFCOMMChannelWriteAsync(IOBluetoothRFCOMMChannelRef rfcommChannel, void *data, UInt16 length, void *refcon);
+
+/*!
+ @function IOBluetoothDeviceOpenRFCOMMChannelAsync
+ @abstract Opens a new RFCOMM channel to the target device. Returns immedialty after starting the opening process.
+ @discussion This function will begin the process of opening a new RFCOMM channel to the target device.
+ The baseband connection to the device will be opened if it is not open already. The RFCOMM
+ channel open process will not complete until the client has registered an incoming data
+ listener on the new channel.
+
+ Because a new IOBluetoothL2CAPChannelRef will be created for the client as a result of this
+ function, the client is responsible for releasing the resulting IOBluetoothL2CAPChannelRef
+ (by calling IOBluetoothObjectRelease()).
+
+ NOTE: This function is only available in Mac OS X 10.2.5 (Bluetooth v1.2) or later.
+ @param btDevice The target IOBluetoothDeviceRef
+ @param rfcommChannel A pointer to an IOBluetoothRFCOMMChannelRef to receive the RFCOMM channel
+ requested to be opened. The rfcommChannel pointer will only be set if
+ kIOReturnSuccess is returned.
+ @param channelID The RFCOMM channel ID for the new channel.
+ @param withEventListener a IOBluetoothRFCOMMChannelIncomingEventListener where to receive events
+ regarding the channel (MUST be specified).
+ @param refCon a refcon pointer (for the callback specified above).
+ @result Returns kIOReturnSuccess if the open process was successfully started .
+ */
+
+IOReturn IOBluetoothDeviceOpenRFCOMMChannelAsync(IOBluetoothDeviceRef btDevice, IOBluetoothRFCOMMChannelRef *newChannel, BluetoothRFCOMMChannelID channelID, IOBluetoothRFCOMMChannelIncomingEventListener eventListener, void *refcon);
+
+@end
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m b/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m
new file mode 100644
index 0000000..6398917
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m
@@ -0,0 +1,102 @@
+//
+// IOBluetooth_Compat.m
+// IOBluetooth-Compat
+//
+// Created by TCMac on 15/11/2013.
+// Original Header is (c) Apple Inc.
+// Copyright (c) 2013 TC Wan
+//
+
+#import "IOBluetooth_Compat.h"
+
+@implementation IOBluetooth_Compat
+
+
+/*!
+ @function IOBluetoothSDPServiceRecordGetRFCOMMChannelID
+ @abstract Allows the discovery of the RFCOMM channel ID assigned to the service.
+ @discussion This function will search through the ProtoclDescriptorList attribute to find an entry
+ with the RFCOMM UUID (UUID16: 0x0003). If one is found, it gets the second element of
+ the data element sequence and sets the rfcommChannelID pointer to it. The channel ID
+ only gets set when kIOReturnSuccess is returned.
+ @param serviceRecord The target IOBluetoothSDPServiceRecordRef
+ @param rfcommChannelID A pointer to the location that will get the found RFCOMM channel ID.
+ @result Returns kIOReturnSuccess if the channel ID is found.
+ */
+
+IOReturn IOBluetoothSDPServiceRecordGetRFCOMMChannelID(IOBluetoothSDPServiceRecordRef serviceRecord, BluetoothRFCOMMChannelID *channelID)
+{
+ return kIOReturnError;
+}
+
+/*! @function IOBluetoothRFCOMMChannelGetMTU
+ @abstract
+ @param rfcommChannel (IOBluetoothRFCOMMChannelRef) The channel reference
+ @result Channel MTU size.
+ @discussion Returns the length of the largest chunk of data that this channel can carry. If the
+ caller wishes to use the write:length:sleep: api the length of the data can not be bigger than
+ the channel MTU (maximum transfer unit).
+ */
+
+BluetoothRFCOMMMTU IOBluetoothRFCOMMChannelGetMTU( IOBluetoothRFCOMMChannelRef rfcommChannel ) {
+ return 0;
+}
+
+/*! @function IOBluetoothRFCOMMChannelCloseChannel
+ @param rfcommChannel (IOBluetoothRFCOMMChannelRef) The channel reference
+ @result An error code value. 0 if successful.
+ @discussion
+ */
+
+IOReturn IOBluetoothRFCOMMChannelCloseChannel(IOBluetoothRFCOMMChannelRef rfcommChannel)
+{
+ return kIOReturnError;
+}
+
+/*! @function IOBluetoothRFCOMMChannelWriteAsync
+ @abstract Write data to a RFCOMM channel asynchronously.
+ @param rfcommChannel (IOBluetoothRFCOMMChannelRef) The channel reference
+ @param data is a pointer to the data buffer to be sent.
+ @param length the length of the buffer to be sent (in bytes).
+ @param refcon a NON NULL value that will be contained in the return event (once the data is sent).
+ @result An error code value. 0 if successful.
+ @discussion Sends data tough the channel. The number of bytes to be sent must not exceed the channel MTU.
+ If the return value is an error condition none of the data was sent.
+
+ NOTE: This function is only available in Mac OS X 10.2.5 (Bluetooth v1.2) or later.
+ */
+
+IOReturn IOBluetoothRFCOMMChannelWriteAsync(IOBluetoothRFCOMMChannelRef rfcommChannel, void *data, UInt16 length, void *refcon)
+{
+ return kIOReturnError;
+}
+
+/*!
+ @function IOBluetoothDeviceOpenRFCOMMChannelAsync
+ @abstract Opens a new RFCOMM channel to the target device. Returns immedialty after starting the opening process.
+ @discussion This function will begin the process of opening a new RFCOMM channel to the target device.
+ The baseband connection to the device will be opened if it is not open already. The RFCOMM
+ channel open process will not complete until the client has registered an incoming data
+ listener on the new channel.
+
+ Because a new IOBluetoothL2CAPChannelRef will be created for the client as a result of this
+ function, the client is responsible for releasing the resulting IOBluetoothL2CAPChannelRef
+ (by calling IOBluetoothObjectRelease()).
+
+ NOTE: This function is only available in Mac OS X 10.2.5 (Bluetooth v1.2) or later.
+ @param btDevice The target IOBluetoothDeviceRef
+ @param rfcommChannel A pointer to an IOBluetoothRFCOMMChannelRef to receive the RFCOMM channel
+ requested to be opened. The rfcommChannel pointer will only be set if
+ kIOReturnSuccess is returned.
+ @param channelID The RFCOMM channel ID for the new channel.
+ @param withEventListener a IOBluetoothRFCOMMChannelIncomingEventListener where to receive events
+ regarding the channel (MUST be specified).
+ @param refCon a refcon pointer (for the callback specified above).
+ @result Returns kIOReturnSuccess if the open process was successfully started .
+ */
+
+IOReturn IOBluetoothDeviceOpenRFCOMMChannelAsync(IOBluetoothDeviceRef btDevice, IOBluetoothRFCOMMChannelRef *newChannel, BluetoothRFCOMMChannelID channelID, IOBluetoothRFCOMMChannelIncomingEventListener eventListener, void *refcon) {
+ return kIOReturnError;
+}
+
+@end
diff --git a/IOBluetooth-Compat/IOBluetooth-CompatTests/IOBluetooth-CompatTests-Info.plist b/IOBluetooth-Compat/IOBluetooth-CompatTests/IOBluetooth-CompatTests-Info.plist
new file mode 100644
index 0000000..c4409df
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-CompatTests/IOBluetooth-CompatTests-Info.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>USM.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
diff --git a/IOBluetooth-Compat/IOBluetooth-CompatTests/IOBluetooth_CompatTests.m b/IOBluetooth-Compat/IOBluetooth-CompatTests/IOBluetooth_CompatTests.m
new file mode 100644
index 0000000..c49e840
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-CompatTests/IOBluetooth_CompatTests.m
@@ -0,0 +1,34 @@
+//
+// IOBluetooth_CompatTests.m
+// IOBluetooth-CompatTests
+//
+// Created by TCMac on 15/11/2013.
+// Copyright (c) 2013 USM. All rights reserved.
+//
+
+#import <XCTest/XCTest.h>
+
+@interface IOBluetooth_CompatTests : XCTestCase
+
+@end
+
+@implementation IOBluetooth_CompatTests
+
+- (void)setUp
+{
+ [super setUp];
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+}
+
+- (void)tearDown
+{
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ [super tearDown];
+}
+
+- (void)testExample
+{
+ XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
+}
+
+@end
diff --git a/IOBluetooth-Compat/IOBluetooth-CompatTests/en.lproj/InfoPlist.strings b/IOBluetooth-Compat/IOBluetooth-CompatTests/en.lproj/InfoPlist.strings
new file mode 100644
index 0000000..477b28f
--- /dev/null
+++ b/IOBluetooth-Compat/IOBluetooth-CompatTests/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
diff --git a/README b/README
index 36ce528..9beb5e6 100644
--- a/README
+++ b/README
@@ -33,3 +33,15 @@ If you're installing using the source package, first extract the source package,
# python setup.py install
inside the package directory. This should be run as root (or use sudo)
+
+Running pyfantom on Mac OS X Mountain Lion (10.8) and Mavericks (10.9)
+======================================================================
+
+Some Bluetooth related functions have been deprecated in Mac OS X
+Mountain Lion and newer. This results in the Fantom framework encountering
+unresolved symbol errors when attempting to load it into pyfantom.
+
+To work around this problem, a stub library IOBluetooth-Compat has been
+created, which defines the missing symbols. Unfortunately, it means that
+Bluetooth support is not available for pyfantom running on Mountain Lion
+and newer releases.
diff --git a/pyfantom.py b/pyfantom.py
index 75d6e3a..3570479 100644
--- a/pyfantom.py
+++ b/pyfantom.py
@@ -3,7 +3,7 @@
# License version 2 or any later version, or the Mozilla Public License
# version 2.0.
#
-# Copyright (C) 2011 Tat-Chee Wan
+# Copyright (C) 2011-2013 Tat-Chee Wan
# Copyright (C) 2011 Nicolas Schodet
#
# --------------
@@ -36,17 +36,20 @@ import collections
kMaxFileNameLength = 101
BT_PIN = "1234"
VI_ERROR_IO = -0x4000ffc2 # Equivalent to 0xBFFF003E
-
+MACOSX_BTMODVER = "12.0.0"
+MACOSX_BTENABLE = True
DEBUG = True
libpath = None
# Check platform.
platform_type = platform.system()
+platform_rel = platform.release()
if DEBUG:
- print "Running on %s Platform" % platform_type
+ print "Running on %s Platform (Rel. %s)" % (platform_type, platform_rel)
if platform_type == 'Darwin':
import sys
+
if sys.maxsize > 2**32:
raise RuntimeError("fantom drivers not available in 64 bit mode.\n"
"You can run python in 32 bit mode (Bash shell syntax) using:\n"
@@ -55,6 +58,13 @@ if platform_type == 'Darwin':
"\n\tNote: This approach will work for for both Apple's Python >= 2.6\n\t\tand MacPorts' Python >= 2.7 installation\n")
#libpath = '/Library/Frameworks/Fantom.framework/Fantom'
libpath = ctypes.util.find_library('fantom')
+
+ if platform_rel >= MACOSX_BTMODVER:
+ print " Bluetooth Stack not supported (Rel >= %s)" % MACOSX_BTMODVER
+ MACOSX_BTENABLE = False
+ compatlibpath = './IOBluetooth-Compat.dylib'
+
+
from AppKit import NSAutoreleasePool, NSApplication
elif platform_type == 'Linux':
libpath = ctypes.util.find_library('fantom')
@@ -70,7 +80,15 @@ else:
raise RuntimeError("Fantom Driver not found")
# Load library.
+if not MACOSX_BTENABLE:
+ print "Loading IOBluetooth-Compat Library (", compatlibpath, ")"
+ # Need to set DYLD_FORCE_FLAT_NAMESPACE in env
+ compatdll = ctypes.cdll.LoadLibrary(compatlibpath)
+
+# RTLD_NOW is set by ctypes and can't be overridden
+# http://hg.python.org/cpython/file/2.7/Modules/_ctypes/callproc.c#l1432
dll = ctypes.cdll.LoadLibrary(libpath)
+
dll.nFANTOM100_createNXTIterator.argtypes = [c_ushort, c_uint, POINTER(c_int)]
dll.nFANTOM100_createNXTIterator.restype = c_uint
dll.nFANTOM100_destroyNXTIterator.argtypes = [c_int, POINTER(c_int)]
@@ -110,12 +128,15 @@ dll.nFANTOM100_iNXT_getResourceString.argtypes = [c_uint, c_char_p,
POINTER(c_int)]
dll.nFANTOM100_iNXT_getResourceString.restype = None
-dll.nFANTOM100_pairBluetooth.argtypes = [c_char_p, c_char_p, c_char_p, POINTER(c_int)]
-dll.nFANTOM100_pairBluetooth.restype = None
-dll.nFANTOM100_unpairBluetooth.argtypes = [c_char_p, POINTER(c_int)]
-dll.nFANTOM100_unpairBluetooth.restype = None
-dll.nFANTOM100_isPaired.argtypes = [c_char_p, POINTER(c_int)]
-dll.nFANTOM100_isPaired.restype = c_ushort
+if MACOSX_BTENABLE:
+ print "Binding Buletooth routines"
+ dll.nFANTOM100_pairBluetooth.argtypes = [c_char_p, c_char_p, c_char_p, POINTER(c_int)]
+ dll.nFANTOM100_pairBluetooth.restype = None
+ dll.nFANTOM100_unpairBluetooth.argtypes = [c_char_p, POINTER(c_int)]
+ dll.nFANTOM100_unpairBluetooth.restype = None
+ dll.nFANTOM100_isPaired.argtypes = [c_char_p, POINTER(c_int)]
+ dll.nFANTOM100_isPaired.restype = c_ushort
+
if DEBUG:
print "Load Library Done"
@@ -251,7 +272,7 @@ class StatusVar(Structure):
class NXTIterator:
"""Interface to an iterator, to find connected NXT."""
- def __init__(self, search_bluetooth, bluetooth_search_timeout_s=5):
+ def __init__(self, search_bluetooth=False, bluetooth_search_timeout_s=5):
"""Initialize iterator."""
self.debug = DEBUG
self.search_bluetooth = search_bluetooth
@@ -260,7 +281,7 @@ class NXTIterator:
self.stop = False
self.nsapp = None
self.pool = None
- if platform.system() == 'Darwin':
+ if platform_type == 'Darwin':
self.nsapp = NSApplication.sharedApplication()
self.pool = NSAutoreleasePool.alloc().init()
def destroy():