aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.pbxproj442
-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--README11
-rw-r--r--pyfantom.py53
10 files changed, 17 insertions, 899 deletions
diff --git a/.gitignore b/.gitignore
index 12b4eb3..0d20b64 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1 @@
*.pyc
-.project
-# XCode related
-DerivedData/
-xcuserdata/
-project.xcworkspace/
diff --git a/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.pbxproj b/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.pbxproj
deleted file mode 100644
index 159ac79..0000000
--- a/IOBluetooth-Compat/IOBluetooth-Compat.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,442 +0,0 @@
-// !$*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/IOBluetooth-Compat-Prefix.pch b/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth-Compat-Prefix.pch
deleted file mode 100644
index 35d7640..0000000
--- a/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth-Compat-Prefix.pch
+++ /dev/null
@@ -1,9 +0,0 @@
-//
-// 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
deleted file mode 100644
index a06ed5f..0000000
--- a/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.h
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// 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
deleted file mode 100644
index 6398917..0000000
--- a/IOBluetooth-Compat/IOBluetooth-Compat/IOBluetooth_Compat.m
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// 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
deleted file mode 100644
index c4409df..0000000
--- a/IOBluetooth-Compat/IOBluetooth-CompatTests/IOBluetooth-CompatTests-Info.plist
+++ /dev/null
@@ -1,22 +0,0 @@
-<?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
deleted file mode 100644
index c49e840..0000000
--- a/IOBluetooth-Compat/IOBluetooth-CompatTests/IOBluetooth_CompatTests.m
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// 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
deleted file mode 100644
index 477b28f..0000000
--- a/IOBluetooth-Compat/IOBluetooth-CompatTests/en.lproj/InfoPlist.strings
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Localized versions of Info.plist keys */
-
diff --git a/README b/README
index 9beb5e6..7fd5ed0 100644
--- a/README
+++ b/README
@@ -36,12 +36,11 @@ 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
+Mountain Lion and newer. This results in old Fantom frameworks 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.
+To fix this problem, please update to Fantom 1.2.0f4. This file is newer
+than the version supplied by the Retail EV3 Software ISO. It can be downloaded
+from http://education.lego.com/downloads/?q={DC0CE993-6544-45A1-8680-B2A547D1EEB6}
+as Fantom Driver for Mac 10.8.
diff --git a/pyfantom.py b/pyfantom.py
index c65c275..75d6e3a 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-2013 Tat-Chee Wan
+# Copyright (C) 2011 Tat-Chee Wan
# Copyright (C) 2011 Nicolas Schodet
#
# --------------
@@ -36,20 +36,17 @@ 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 (Rel. %s)" % (platform_type, platform_rel)
+ print "Running on %s Platform" % platform_type
if platform_type == 'Darwin':
- import sys, os
-
+ 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"
@@ -58,19 +55,6 @@ 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
- if os.getenv("DYLD_FORCE_FLAT_NAMESPACE") is None:
- raise RuntimeError("Bluetooth Compat Framework needed.\n"
- "Enable IOBluetooth-Compat Framework using:\n"
- "$ export DYLD_FORCE_FLAT_NAMESPACE=1\n")
- #compatlibpath = ctypes.util.find_library('IOBluetooth-Compat.dylib')
- compatlibpath = '%s/Library/IOBluetooth-Compat.dylib' % os.getenv("HOME")
- if compatlibpath is None or not os.path.exists(compatlibpath):
- raise RuntimeError("IOBluetooth-Compat Framework not found")
-
from AppKit import NSAutoreleasePool, NSApplication
elif platform_type == 'Linux':
libpath = ctypes.util.find_library('fantom')
@@ -79,7 +63,6 @@ elif platform_type == 'Windows':
else:
raise RuntimeError('Unsupported platform')
-
if libpath is not None:
if DEBUG:
print "Found Fantom Library (", libpath, ")"
@@ -87,16 +70,7 @@ 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)
- compatdll = ctypes.CDLL(compatlibpath, ctypes.RTLD_GLOBAL)
-
-# 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)]
@@ -136,15 +110,12 @@ dll.nFANTOM100_iNXT_getResourceString.argtypes = [c_uint, c_char_p,
POINTER(c_int)]
dll.nFANTOM100_iNXT_getResourceString.restype = None
-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
-
+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"
@@ -280,7 +251,7 @@ class StatusVar(Structure):
class NXTIterator:
"""Interface to an iterator, to find connected NXT."""
- def __init__(self, search_bluetooth=False, bluetooth_search_timeout_s=5):
+ def __init__(self, search_bluetooth, bluetooth_search_timeout_s=5):
"""Initialize iterator."""
self.debug = DEBUG
self.search_bluetooth = search_bluetooth
@@ -289,7 +260,7 @@ class NXTIterator:
self.stop = False
self.nsapp = None
self.pool = None
- if platform_type == 'Darwin':
+ if platform.system() == 'Darwin':
self.nsapp = NSApplication.sharedApplication()
self.pool = NSAutoreleasePool.alloc().init()
def destroy():