Initial Commit
This commit is contained in:
commit
b340c7c594
412
JCPrinterSDK.xcodeproj/project.pbxproj
Normal file
412
JCPrinterSDK.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,412 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 56;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
177B44812AE424F9001E3EE6 /* JCPrinterSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 177B44802AE424F9001E3EE6 /* JCPrinterSDK.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
|
177B448D2AE42549001E3EE6 /* FWnetworkWIFI.mm in Sources */ = {isa = PBXBuildFile; fileRef = 177B44872AE42549001E3EE6 /* FWnetworkWIFI.mm */; };
|
||||||
|
177B448E2AE42549001E3EE6 /* JCAPI.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 177B44882AE42549001E3EE6 /* JCAPI.a */; };
|
||||||
|
177B448F2AE42549001E3EE6 /* JCAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 177B44892AE42549001E3EE6 /* JCAPI.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
|
177B44902AE42549001E3EE6 /* FWnetworkWIFI.h in Headers */ = {isa = PBXBuildFile; fileRef = 177B448A2AE42549001E3EE6 /* FWnetworkWIFI.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
|
177B44952AE425A3001E3EE6 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177B44942AE425A3001E3EE6 /* AVFoundation.framework */; };
|
||||||
|
177B44972AE425B5001E3EE6 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177B44962AE425B5001E3EE6 /* CoreMedia.framework */; };
|
||||||
|
177B449B2AE42605001E3EE6 /* JCSDKPringterConfig.json in Resources */ = {isa = PBXBuildFile; fileRef = 177B449A2AE42605001E3EE6 /* JCSDKPringterConfig.json */; };
|
||||||
|
177B44B32AE42892001E3EE6 /* libbz2.1.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 177B44982AE425BF001E3EE6 /* libbz2.1.0.tbd */; };
|
||||||
|
177B44B42AE42899001E3EE6 /* libiconv.2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 177B44992AE425CE001E3EE6 /* libiconv.2.tbd */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
177B447D2AE424F9001E3EE6 /* JCPrinterSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JCPrinterSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
177B44802AE424F9001E3EE6 /* JCPrinterSDK.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JCPrinterSDK.h; sourceTree = "<group>"; };
|
||||||
|
177B44872AE42549001E3EE6 /* FWnetworkWIFI.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FWnetworkWIFI.mm; sourceTree = "<group>"; };
|
||||||
|
177B44882AE42549001E3EE6 /* JCAPI.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = JCAPI.a; sourceTree = "<group>"; };
|
||||||
|
177B44892AE42549001E3EE6 /* JCAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JCAPI.h; sourceTree = "<group>"; };
|
||||||
|
177B448A2AE42549001E3EE6 /* FWnetworkWIFI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FWnetworkWIFI.h; sourceTree = "<group>"; };
|
||||||
|
177B448C2AE42549001E3EE6 /* Source */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Source; sourceTree = "<group>"; };
|
||||||
|
177B44942AE425A3001E3EE6 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; };
|
||||||
|
177B44962AE425B5001E3EE6 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/CoreMedia.framework; sourceTree = DEVELOPER_DIR; };
|
||||||
|
177B44982AE425BF001E3EE6 /* libbz2.1.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.1.0.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libbz2.1.0.tbd; sourceTree = DEVELOPER_DIR; };
|
||||||
|
177B44992AE425CE001E3EE6 /* libiconv.2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.2.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libiconv.2.tbd; sourceTree = DEVELOPER_DIR; };
|
||||||
|
177B449A2AE42605001E3EE6 /* JCSDKPringterConfig.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = JCSDKPringterConfig.json; path = JCPrinterSDK/Source/JCSDKPringterConfig.json; sourceTree = "<group>"; };
|
||||||
|
177B44C52AE42D5F001E3EE6 /* CocoaAsyncSocket.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CocoaAsyncSocket.framework; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
177B447A2AE424F9001E3EE6 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
177B44B42AE42899001E3EE6 /* libiconv.2.tbd in Frameworks */,
|
||||||
|
177B44972AE425B5001E3EE6 /* CoreMedia.framework in Frameworks */,
|
||||||
|
177B44B32AE42892001E3EE6 /* libbz2.1.0.tbd in Frameworks */,
|
||||||
|
177B44952AE425A3001E3EE6 /* AVFoundation.framework in Frameworks */,
|
||||||
|
177B448E2AE42549001E3EE6 /* JCAPI.a in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
177B44732AE424F9001E3EE6 = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
177B449A2AE42605001E3EE6 /* JCSDKPringterConfig.json */,
|
||||||
|
177B447F2AE424F9001E3EE6 /* JCPrinterSDK */,
|
||||||
|
177B447E2AE424F9001E3EE6 /* Products */,
|
||||||
|
177B44932AE425A3001E3EE6 /* Frameworks */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
177B447E2AE424F9001E3EE6 /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
177B447D2AE424F9001E3EE6 /* JCPrinterSDK.framework */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
177B447F2AE424F9001E3EE6 /* JCPrinterSDK */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
177B44C52AE42D5F001E3EE6 /* CocoaAsyncSocket.framework */,
|
||||||
|
177B448A2AE42549001E3EE6 /* FWnetworkWIFI.h */,
|
||||||
|
177B44872AE42549001E3EE6 /* FWnetworkWIFI.mm */,
|
||||||
|
177B44882AE42549001E3EE6 /* JCAPI.a */,
|
||||||
|
177B44892AE42549001E3EE6 /* JCAPI.h */,
|
||||||
|
177B448C2AE42549001E3EE6 /* Source */,
|
||||||
|
177B44802AE424F9001E3EE6 /* JCPrinterSDK.h */,
|
||||||
|
);
|
||||||
|
path = JCPrinterSDK;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
177B44932AE425A3001E3EE6 /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
177B44982AE425BF001E3EE6 /* libbz2.1.0.tbd */,
|
||||||
|
177B44992AE425CE001E3EE6 /* libiconv.2.tbd */,
|
||||||
|
177B44962AE425B5001E3EE6 /* CoreMedia.framework */,
|
||||||
|
177B44942AE425A3001E3EE6 /* AVFoundation.framework */,
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXHeadersBuildPhase section */
|
||||||
|
177B44782AE424F9001E3EE6 /* Headers */ = {
|
||||||
|
isa = PBXHeadersBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
177B44902AE42549001E3EE6 /* FWnetworkWIFI.h in Headers */,
|
||||||
|
177B448F2AE42549001E3EE6 /* JCAPI.h in Headers */,
|
||||||
|
177B44812AE424F9001E3EE6 /* JCPrinterSDK.h in Headers */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXHeadersBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
177B447C2AE424F9001E3EE6 /* JCPrinterSDK */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 177B44842AE424F9001E3EE6 /* Build configuration list for PBXNativeTarget "JCPrinterSDK" */;
|
||||||
|
buildPhases = (
|
||||||
|
177B44782AE424F9001E3EE6 /* Headers */,
|
||||||
|
177B44792AE424F9001E3EE6 /* Sources */,
|
||||||
|
177B447A2AE424F9001E3EE6 /* Frameworks */,
|
||||||
|
177B447B2AE424F9001E3EE6 /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = JCPrinterSDK;
|
||||||
|
productName = JCPrinterSDK;
|
||||||
|
productReference = 177B447D2AE424F9001E3EE6 /* JCPrinterSDK.framework */;
|
||||||
|
productType = "com.apple.product-type.framework";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
177B44742AE424F9001E3EE6 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
BuildIndependentTargetsInParallel = 1;
|
||||||
|
LastUpgradeCheck = 1500;
|
||||||
|
TargetAttributes = {
|
||||||
|
177B447C2AE424F9001E3EE6 = {
|
||||||
|
CreatedOnToolsVersion = 15.0.1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 177B44772AE424F9001E3EE6 /* Build configuration list for PBXProject "JCPrinterSDK" */;
|
||||||
|
compatibilityVersion = "Xcode 14.0";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 177B44732AE424F9001E3EE6;
|
||||||
|
productRefGroup = 177B447E2AE424F9001E3EE6 /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
177B447C2AE424F9001E3EE6 /* JCPrinterSDK */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
177B447B2AE424F9001E3EE6 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
177B449B2AE42605001E3EE6 /* JCSDKPringterConfig.json in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
177B44792AE424F9001E3EE6 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
177B448D2AE42549001E3EE6 /* FWnetworkWIFI.mm in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
177B44822AE424F9001E3EE6 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
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_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
|
||||||
|
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
VERSION_INFO_PREFIX = "";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
177B44832AE424F9001E3EE6 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||||
|
GCC_NO_COMMON_BLOCKS = 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_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
|
||||||
|
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
VERSION_INFO_PREFIX = "";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
177B44852AE424F9001E3EE6 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
DEFINES_MODULE = YES;
|
||||||
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
|
ENABLE_MODULE_VERIFIER = YES;
|
||||||
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"$(PROJECT_DIR)/JCPrinterSDK",
|
||||||
|
"$(PROJECT_DIR)",
|
||||||
|
);
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||||
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
"@loader_path/Frameworks",
|
||||||
|
);
|
||||||
|
LIBRARY_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"$(PROJECT_DIR)/JCPrinterSDK",
|
||||||
|
);
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
|
||||||
|
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
|
||||||
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = cc.nasme.JCPrinterSDK;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
177B44862AE424F9001E3EE6 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
DEFINES_MODULE = YES;
|
||||||
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
|
ENABLE_MODULE_VERIFIER = YES;
|
||||||
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"$(PROJECT_DIR)/JCPrinterSDK",
|
||||||
|
"$(PROJECT_DIR)",
|
||||||
|
);
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||||
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
"@loader_path/Frameworks",
|
||||||
|
);
|
||||||
|
LIBRARY_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"$(PROJECT_DIR)/JCPrinterSDK",
|
||||||
|
);
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
|
||||||
|
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
|
||||||
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = cc.nasme.JCPrinterSDK;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
177B44772AE424F9001E3EE6 /* Build configuration list for PBXProject "JCPrinterSDK" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
177B44822AE424F9001E3EE6 /* Debug */,
|
||||||
|
177B44832AE424F9001E3EE6 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
177B44842AE424F9001E3EE6 /* Build configuration list for PBXNativeTarget "JCPrinterSDK" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
177B44852AE424F9001E3EE6 /* Debug */,
|
||||||
|
177B44862AE424F9001E3EE6 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 177B44742AE424F9001E3EE6 /* Project object */;
|
||||||
|
}
|
7
JCPrinterSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
JCPrinterSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?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>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -0,0 +1,66 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1500"
|
||||||
|
version = "1.7">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "177B447C2AE424F9001E3EE6"
|
||||||
|
BuildableName = "JCPrinterSDK.framework"
|
||||||
|
BlueprintName = "JCPrinterSDK"
|
||||||
|
ReferencedContainer = "container:JCPrinterSDK.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
shouldAutocreateTestPlan = "YES">
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "177B447C2AE424F9001E3EE6"
|
||||||
|
BuildableName = "JCPrinterSDK.framework"
|
||||||
|
BlueprintName = "JCPrinterSDK"
|
||||||
|
ReferencedContainer = "container:JCPrinterSDK.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
@ -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>SchemeUserState</key>
|
||||||
|
<dict>
|
||||||
|
<key>JCPrinterSDK.xcscheme_^#shared#^_</key>
|
||||||
|
<dict>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
<dict>
|
||||||
|
<key>177B447C2AE424F9001E3EE6</key>
|
||||||
|
<dict>
|
||||||
|
<key>primary</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
BIN
JCPrinterSDK/CocoaAsyncSocket.framework/CocoaAsyncSocket
Normal file
BIN
JCPrinterSDK/CocoaAsyncSocket.framework/CocoaAsyncSocket
Normal file
Binary file not shown.
657
JCPrinterSDK/CocoaAsyncSocket.framework/Headers/AsyncSocket.h
Normal file
657
JCPrinterSDK/CocoaAsyncSocket.framework/Headers/AsyncSocket.h
Normal file
@ -0,0 +1,657 @@
|
|||||||
|
//
|
||||||
|
// AsyncSocket.h
|
||||||
|
//
|
||||||
|
// This class is in the public domain.
|
||||||
|
// Originally created by Dustin Voss on Wed Jan 29 2003.
|
||||||
|
// Updated and maintained by Deusty Designs and the Mac development community.
|
||||||
|
//
|
||||||
|
// http://code.google.com/p/cocoaasyncsocket/
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@class AsyncSocket;
|
||||||
|
@class AsyncReadPacket;
|
||||||
|
@class AsyncWritePacket;
|
||||||
|
|
||||||
|
extern NSString *const AsyncSocketException;
|
||||||
|
extern NSString *const AsyncSocketErrorDomain;
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, AsyncSocketError) {
|
||||||
|
AsyncSocketCFSocketError = kCFSocketError, // From CFSocketError enum.
|
||||||
|
AsyncSocketNoError = 0, // Never used.
|
||||||
|
AsyncSocketCanceledError, // onSocketWillConnect: returned NO.
|
||||||
|
AsyncSocketConnectTimeoutError,
|
||||||
|
AsyncSocketReadMaxedOutError, // Reached set maxLength without completing
|
||||||
|
AsyncSocketReadTimeoutError,
|
||||||
|
AsyncSocketWriteTimeoutError
|
||||||
|
};
|
||||||
|
|
||||||
|
@protocol AsyncSocketDelegate
|
||||||
|
@optional
|
||||||
|
|
||||||
|
/**
|
||||||
|
* In the event of an error, the socket is closed.
|
||||||
|
* You may call "unreadData" during this call-back to get the last bit of data off the socket.
|
||||||
|
* When connecting, this delegate method may be called
|
||||||
|
* before"onSocket:didAcceptNewSocket:" or "onSocket:didConnectToHost:".
|
||||||
|
**/
|
||||||
|
- (void)onSocket:(AsyncSocket *)sock willDisconnectWithError:(NSError *)err;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a socket disconnects with or without error. If you want to release a socket after it disconnects,
|
||||||
|
* do so here. It is not safe to do that during "onSocket:willDisconnectWithError:".
|
||||||
|
*
|
||||||
|
* If you call the disconnect method, and the socket wasn't already disconnected,
|
||||||
|
* this delegate method will be called before the disconnect method returns.
|
||||||
|
**/
|
||||||
|
- (void)onSocketDidDisconnect:(AsyncSocket *)sock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a socket accepts a connection. Another socket is spawned to handle it. The new socket will have
|
||||||
|
* the same delegate and will call "onSocket:didConnectToHost:port:".
|
||||||
|
**/
|
||||||
|
- (void)onSocket:(AsyncSocket *)sock didAcceptNewSocket:(AsyncSocket *)newSocket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a new socket is spawned to handle a connection. This method should return the run-loop of the
|
||||||
|
* thread on which the new socket and its delegate should operate. If omitted, [NSRunLoop currentRunLoop] is used.
|
||||||
|
**/
|
||||||
|
- (NSRunLoop *)onSocket:(AsyncSocket *)sock wantsRunLoopForNewSocket:(AsyncSocket *)newSocket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a socket is about to connect. This method should return YES to continue, or NO to abort.
|
||||||
|
* If aborted, will result in AsyncSocketCanceledError.
|
||||||
|
*
|
||||||
|
* If the connectToHost:onPort:error: method was called, the delegate will be able to access and configure the
|
||||||
|
* CFReadStream and CFWriteStream as desired prior to connection.
|
||||||
|
*
|
||||||
|
* If the connectToAddress:error: method was called, the delegate will be able to access and configure the
|
||||||
|
* CFSocket and CFSocketNativeHandle (BSD socket) as desired prior to connection. You will be able to access and
|
||||||
|
* configure the CFReadStream and CFWriteStream in the onSocket:didConnectToHost:port: method.
|
||||||
|
**/
|
||||||
|
- (BOOL)onSocketWillConnect:(AsyncSocket *)sock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a socket connects and is ready for reading and writing.
|
||||||
|
* The host parameter will be an IP address, not a DNS name.
|
||||||
|
**/
|
||||||
|
- (void)onSocket:(AsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16)port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a socket has completed reading the requested data into memory.
|
||||||
|
* Not called if there is an error.
|
||||||
|
**/
|
||||||
|
- (void)onSocket:(AsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a socket has read in data, but has not yet completed the read.
|
||||||
|
* This would occur if using readToData: or readToLength: methods.
|
||||||
|
* It may be used to for things such as updating progress bars.
|
||||||
|
**/
|
||||||
|
- (void)onSocket:(AsyncSocket *)sock didReadPartialDataOfLength:(NSUInteger)partialLength tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a socket has completed writing the requested data. Not called if there is an error.
|
||||||
|
**/
|
||||||
|
- (void)onSocket:(AsyncSocket *)sock didWriteDataWithTag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a socket has written some data, but has not yet completed the entire write.
|
||||||
|
* It may be used to for things such as updating progress bars.
|
||||||
|
**/
|
||||||
|
- (void)onSocket:(AsyncSocket *)sock didWritePartialDataOfLength:(NSUInteger)partialLength tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called if a read operation has reached its timeout without completing.
|
||||||
|
* This method allows you to optionally extend the timeout.
|
||||||
|
* If you return a positive time interval (> 0) the read's timeout will be extended by the given amount.
|
||||||
|
* If you don't implement this method, or return a non-positive time interval (<= 0) the read will timeout as usual.
|
||||||
|
*
|
||||||
|
* The elapsed parameter is the sum of the original timeout, plus any additions previously added via this method.
|
||||||
|
* The length parameter is the number of bytes that have been read so far for the read operation.
|
||||||
|
*
|
||||||
|
* Note that this method may be called multiple times for a single read if you return positive numbers.
|
||||||
|
**/
|
||||||
|
- (NSTimeInterval)onSocket:(AsyncSocket *)sock
|
||||||
|
shouldTimeoutReadWithTag:(long)tag
|
||||||
|
elapsed:(NSTimeInterval)elapsed
|
||||||
|
bytesDone:(NSUInteger)length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called if a write operation has reached its timeout without completing.
|
||||||
|
* This method allows you to optionally extend the timeout.
|
||||||
|
* If you return a positive time interval (> 0) the write's timeout will be extended by the given amount.
|
||||||
|
* If you don't implement this method, or return a non-positive time interval (<= 0) the write will timeout as usual.
|
||||||
|
*
|
||||||
|
* The elapsed parameter is the sum of the original timeout, plus any additions previously added via this method.
|
||||||
|
* The length parameter is the number of bytes that have been written so far for the write operation.
|
||||||
|
*
|
||||||
|
* Note that this method may be called multiple times for a single write if you return positive numbers.
|
||||||
|
**/
|
||||||
|
- (NSTimeInterval)onSocket:(AsyncSocket *)sock
|
||||||
|
shouldTimeoutWriteWithTag:(long)tag
|
||||||
|
elapsed:(NSTimeInterval)elapsed
|
||||||
|
bytesDone:(NSUInteger)length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called after the socket has successfully completed SSL/TLS negotiation.
|
||||||
|
* This method is not called unless you use the provided startTLS method.
|
||||||
|
*
|
||||||
|
* If a SSL/TLS negotiation fails (invalid certificate, etc) then the socket will immediately close,
|
||||||
|
* and the onSocket:willDisconnectWithError: delegate method will be called with the specific SSL error code.
|
||||||
|
**/
|
||||||
|
- (void)onSocketDidSecure:(AsyncSocket *)sock;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma mark -
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@interface AsyncSocket : NSObject
|
||||||
|
{
|
||||||
|
CFSocketNativeHandle theNativeSocket4;
|
||||||
|
CFSocketNativeHandle theNativeSocket6;
|
||||||
|
|
||||||
|
CFSocketRef theSocket4; // IPv4 accept or connect socket
|
||||||
|
CFSocketRef theSocket6; // IPv6 accept or connect socket
|
||||||
|
|
||||||
|
CFReadStreamRef theReadStream;
|
||||||
|
CFWriteStreamRef theWriteStream;
|
||||||
|
|
||||||
|
CFRunLoopSourceRef theSource4; // For theSocket4
|
||||||
|
CFRunLoopSourceRef theSource6; // For theSocket6
|
||||||
|
CFRunLoopRef theRunLoop;
|
||||||
|
CFSocketContext theContext;
|
||||||
|
NSArray *theRunLoopModes;
|
||||||
|
|
||||||
|
NSTimer *theConnectTimer;
|
||||||
|
|
||||||
|
NSMutableArray *theReadQueue;
|
||||||
|
AsyncReadPacket *theCurrentRead;
|
||||||
|
NSTimer *theReadTimer;
|
||||||
|
NSMutableData *partialReadBuffer;
|
||||||
|
|
||||||
|
NSMutableArray *theWriteQueue;
|
||||||
|
AsyncWritePacket *theCurrentWrite;
|
||||||
|
NSTimer *theWriteTimer;
|
||||||
|
|
||||||
|
id theDelegate;
|
||||||
|
UInt16 theFlags;
|
||||||
|
|
||||||
|
long theUserData;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id)init;
|
||||||
|
- (id)initWithDelegate:(id)delegate;
|
||||||
|
- (id)initWithDelegate:(id)delegate userData:(long)userData;
|
||||||
|
|
||||||
|
/* String representation is long but has no "\n". */
|
||||||
|
- (NSString *)description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use "canSafelySetDelegate" to see if there is any pending business (reads and writes) with the current delegate
|
||||||
|
* before changing it. It is, of course, safe to change the delegate before connecting or accepting connections.
|
||||||
|
**/
|
||||||
|
- (id)delegate;
|
||||||
|
- (BOOL)canSafelySetDelegate;
|
||||||
|
- (void)setDelegate:(id)delegate;
|
||||||
|
|
||||||
|
/* User data can be a long, or an id or void * cast to a long. */
|
||||||
|
- (long)userData;
|
||||||
|
- (void)setUserData:(long)userData;
|
||||||
|
|
||||||
|
/* Don't use these to read or write. And don't close them either! */
|
||||||
|
- (CFSocketRef)getCFSocket;
|
||||||
|
- (CFReadStreamRef)getCFReadStream;
|
||||||
|
- (CFWriteStreamRef)getCFWriteStream;
|
||||||
|
|
||||||
|
// Once one of the accept or connect methods are called, the AsyncSocket instance is locked in
|
||||||
|
// and the other accept/connect methods can't be called without disconnecting the socket first.
|
||||||
|
// If the attempt fails or times out, these methods either return NO or
|
||||||
|
// call "onSocket:willDisconnectWithError:" and "onSockedDidDisconnect:".
|
||||||
|
|
||||||
|
// When an incoming connection is accepted, AsyncSocket invokes several delegate methods.
|
||||||
|
// These methods are (in chronological order):
|
||||||
|
// 1. onSocket:didAcceptNewSocket:
|
||||||
|
// 2. onSocket:wantsRunLoopForNewSocket:
|
||||||
|
// 3. onSocketWillConnect:
|
||||||
|
//
|
||||||
|
// Your server code will need to retain the accepted socket (if you want to accept it).
|
||||||
|
// The best place to do this is probably in the onSocket:didAcceptNewSocket: method.
|
||||||
|
//
|
||||||
|
// After the read and write streams have been setup for the newly accepted socket,
|
||||||
|
// the onSocket:didConnectToHost:port: method will be called on the proper run loop.
|
||||||
|
//
|
||||||
|
// Multithreading Note: If you're going to be moving the newly accepted socket to another run
|
||||||
|
// loop by implementing onSocket:wantsRunLoopForNewSocket:, then you should wait until the
|
||||||
|
// onSocket:didConnectToHost:port: method before calling read, write, or startTLS methods.
|
||||||
|
// Otherwise read/write events are scheduled on the incorrect runloop, and chaos may ensue.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tells the socket to begin listening and accepting connections on the given port.
|
||||||
|
* When a connection comes in, the AsyncSocket instance will call the various delegate methods (see above).
|
||||||
|
* The socket will listen on all available interfaces (e.g. wifi, ethernet, etc)
|
||||||
|
**/
|
||||||
|
- (BOOL)acceptOnPort:(UInt16)port error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is the same as acceptOnPort:error: with the additional option
|
||||||
|
* of specifying which interface to listen on. So, for example, if you were writing code for a server that
|
||||||
|
* has multiple IP addresses, you could specify which address you wanted to listen on. Or you could use it
|
||||||
|
* to specify that the socket should only accept connections over ethernet, and not other interfaces such as wifi.
|
||||||
|
* You may also use the special strings "localhost" or "loopback" to specify that
|
||||||
|
* the socket only accept connections from the local machine.
|
||||||
|
*
|
||||||
|
* To accept connections on any interface pass nil, or simply use the acceptOnPort:error: method.
|
||||||
|
**/
|
||||||
|
- (BOOL)acceptOnInterface:(NSString *)interface port:(UInt16)port error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connects to the given host and port.
|
||||||
|
* The host may be a domain name (e.g. "deusty.com") or an IP address string (e.g. "192.168.0.2")
|
||||||
|
**/
|
||||||
|
- (BOOL)connectToHost:(NSString *)hostname onPort:(UInt16)port error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is the same as connectToHost:onPort:error: with an additional timeout option.
|
||||||
|
* To not time out use a negative time interval, or simply use the connectToHost:onPort:error: method.
|
||||||
|
**/
|
||||||
|
- (BOOL)connectToHost:(NSString *)hostname
|
||||||
|
onPort:(UInt16)port
|
||||||
|
withTimeout:(NSTimeInterval)timeout
|
||||||
|
error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connects to the given address, specified as a sockaddr structure wrapped in a NSData object.
|
||||||
|
* For example, a NSData object returned from NSNetService's addresses method.
|
||||||
|
*
|
||||||
|
* If you have an existing struct sockaddr you can convert it to a NSData object like so:
|
||||||
|
* struct sockaddr sa -> NSData *dsa = [NSData dataWithBytes:&remoteAddr length:remoteAddr.sa_len];
|
||||||
|
* struct sockaddr *sa -> NSData *dsa = [NSData dataWithBytes:remoteAddr length:remoteAddr->sa_len];
|
||||||
|
**/
|
||||||
|
- (BOOL)connectToAddress:(NSData *)remoteAddr error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is the same as connectToAddress:error: with an additional timeout option.
|
||||||
|
* To not time out use a negative time interval, or simply use the connectToAddress:error: method.
|
||||||
|
**/
|
||||||
|
- (BOOL)connectToAddress:(NSData *)remoteAddr withTimeout:(NSTimeInterval)timeout error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
- (BOOL)connectToAddress:(NSData *)remoteAddr
|
||||||
|
viaInterfaceAddress:(NSData *)interfaceAddr
|
||||||
|
withTimeout:(NSTimeInterval)timeout
|
||||||
|
error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disconnects immediately. Any pending reads or writes are dropped.
|
||||||
|
* If the socket is not already disconnected, the onSocketDidDisconnect delegate method
|
||||||
|
* will be called immediately, before this method returns.
|
||||||
|
*
|
||||||
|
* Please note the recommended way of releasing an AsyncSocket instance (e.g. in a dealloc method)
|
||||||
|
* [asyncSocket setDelegate:nil];
|
||||||
|
* [asyncSocket disconnect];
|
||||||
|
* [asyncSocket release];
|
||||||
|
**/
|
||||||
|
- (void)disconnect;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disconnects after all pending reads have completed.
|
||||||
|
* After calling this, the read and write methods will do nothing.
|
||||||
|
* The socket will disconnect even if there are still pending writes.
|
||||||
|
**/
|
||||||
|
- (void)disconnectAfterReading;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disconnects after all pending writes have completed.
|
||||||
|
* After calling this, the read and write methods will do nothing.
|
||||||
|
* The socket will disconnect even if there are still pending reads.
|
||||||
|
**/
|
||||||
|
- (void)disconnectAfterWriting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disconnects after all pending reads and writes have completed.
|
||||||
|
* After calling this, the read and write methods will do nothing.
|
||||||
|
**/
|
||||||
|
- (void)disconnectAfterReadingAndWriting;
|
||||||
|
|
||||||
|
/* Returns YES if the socket and streams are open, connected, and ready for reading and writing. */
|
||||||
|
- (BOOL)isConnected;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the local or remote host and port to which this socket is connected, or nil and 0 if not connected.
|
||||||
|
* The host will be an IP address.
|
||||||
|
**/
|
||||||
|
- (NSString *)connectedHost;
|
||||||
|
- (UInt16)connectedPort;
|
||||||
|
|
||||||
|
- (NSString *)localHost;
|
||||||
|
- (UInt16)localPort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the local or remote address to which this socket is connected,
|
||||||
|
* specified as a sockaddr structure wrapped in a NSData object.
|
||||||
|
*
|
||||||
|
* See also the connectedHost, connectedPort, localHost and localPort methods.
|
||||||
|
**/
|
||||||
|
- (NSData *)connectedAddress;
|
||||||
|
- (NSData *)localAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the socket is IPv4 or IPv6.
|
||||||
|
* An accepting socket may be both.
|
||||||
|
**/
|
||||||
|
- (BOOL)isIPv4;
|
||||||
|
- (BOOL)isIPv6;
|
||||||
|
|
||||||
|
// The readData and writeData methods won't block (they are asynchronous).
|
||||||
|
//
|
||||||
|
// When a read is complete the onSocket:didReadData:withTag: delegate method is called.
|
||||||
|
// When a write is complete the onSocket:didWriteDataWithTag: delegate method is called.
|
||||||
|
//
|
||||||
|
// You may optionally set a timeout for any read/write operation. (To not timeout, use a negative time interval.)
|
||||||
|
// If a read/write opertion times out, the corresponding "onSocket:shouldTimeout..." delegate method
|
||||||
|
// is called to optionally allow you to extend the timeout.
|
||||||
|
// Upon a timeout, the "onSocket:willDisconnectWithError:" method is called, followed by "onSocketDidDisconnect".
|
||||||
|
//
|
||||||
|
// The tag is for your convenience.
|
||||||
|
// You can use it as an array index, step number, state id, pointer, etc.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the first available bytes that become available on the socket.
|
||||||
|
*
|
||||||
|
* If the timeout value is negative, the read operation will not use a timeout.
|
||||||
|
**/
|
||||||
|
- (void)readDataWithTimeout:(NSTimeInterval)timeout tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the first available bytes that become available on the socket.
|
||||||
|
* The bytes will be appended to the given byte buffer starting at the given offset.
|
||||||
|
* The given buffer will automatically be increased in size if needed.
|
||||||
|
*
|
||||||
|
* If the timeout value is negative, the read operation will not use a timeout.
|
||||||
|
* If the buffer if nil, the socket will create a buffer for you.
|
||||||
|
*
|
||||||
|
* If the bufferOffset is greater than the length of the given buffer,
|
||||||
|
* the method will do nothing, and the delegate will not be called.
|
||||||
|
*
|
||||||
|
* If you pass a buffer, you must not alter it in any way while AsyncSocket is using it.
|
||||||
|
* After completion, the data returned in onSocket:didReadData:withTag: will be a subset of the given buffer.
|
||||||
|
* That is, it will reference the bytes that were appended to the given buffer.
|
||||||
|
**/
|
||||||
|
- (void)readDataWithTimeout:(NSTimeInterval)timeout
|
||||||
|
buffer:(NSMutableData *)buffer
|
||||||
|
bufferOffset:(NSUInteger)offset
|
||||||
|
tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the first available bytes that become available on the socket.
|
||||||
|
* The bytes will be appended to the given byte buffer starting at the given offset.
|
||||||
|
* The given buffer will automatically be increased in size if needed.
|
||||||
|
* A maximum of length bytes will be read.
|
||||||
|
*
|
||||||
|
* If the timeout value is negative, the read operation will not use a timeout.
|
||||||
|
* If the buffer if nil, a buffer will automatically be created for you.
|
||||||
|
* If maxLength is zero, no length restriction is enforced.
|
||||||
|
*
|
||||||
|
* If the bufferOffset is greater than the length of the given buffer,
|
||||||
|
* the method will do nothing, and the delegate will not be called.
|
||||||
|
*
|
||||||
|
* If you pass a buffer, you must not alter it in any way while AsyncSocket is using it.
|
||||||
|
* After completion, the data returned in onSocket:didReadData:withTag: will be a subset of the given buffer.
|
||||||
|
* That is, it will reference the bytes that were appended to the given buffer.
|
||||||
|
**/
|
||||||
|
- (void)readDataWithTimeout:(NSTimeInterval)timeout
|
||||||
|
buffer:(NSMutableData *)buffer
|
||||||
|
bufferOffset:(NSUInteger)offset
|
||||||
|
maxLength:(NSUInteger)length
|
||||||
|
tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the given number of bytes.
|
||||||
|
*
|
||||||
|
* If the timeout value is negative, the read operation will not use a timeout.
|
||||||
|
*
|
||||||
|
* If the length is 0, this method does nothing and the delegate is not called.
|
||||||
|
**/
|
||||||
|
- (void)readDataToLength:(NSUInteger)length withTimeout:(NSTimeInterval)timeout tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the given number of bytes.
|
||||||
|
* The bytes will be appended to the given byte buffer starting at the given offset.
|
||||||
|
* The given buffer will automatically be increased in size if needed.
|
||||||
|
*
|
||||||
|
* If the timeout value is negative, the read operation will not use a timeout.
|
||||||
|
* If the buffer if nil, a buffer will automatically be created for you.
|
||||||
|
*
|
||||||
|
* If the length is 0, this method does nothing and the delegate is not called.
|
||||||
|
* If the bufferOffset is greater than the length of the given buffer,
|
||||||
|
* the method will do nothing, and the delegate will not be called.
|
||||||
|
*
|
||||||
|
* If you pass a buffer, you must not alter it in any way while AsyncSocket is using it.
|
||||||
|
* After completion, the data returned in onSocket:didReadData:withTag: will be a subset of the given buffer.
|
||||||
|
* That is, it will reference the bytes that were appended to the given buffer.
|
||||||
|
**/
|
||||||
|
- (void)readDataToLength:(NSUInteger)length
|
||||||
|
withTimeout:(NSTimeInterval)timeout
|
||||||
|
buffer:(NSMutableData *)buffer
|
||||||
|
bufferOffset:(NSUInteger)offset
|
||||||
|
tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads bytes until (and including) the passed "data" parameter, which acts as a separator.
|
||||||
|
*
|
||||||
|
* If the timeout value is negative, the read operation will not use a timeout.
|
||||||
|
*
|
||||||
|
* If you pass nil or zero-length data as the "data" parameter,
|
||||||
|
* the method will do nothing, and the delegate will not be called.
|
||||||
|
*
|
||||||
|
* To read a line from the socket, use the line separator (e.g. CRLF for HTTP, see below) as the "data" parameter.
|
||||||
|
* Note that this method is not character-set aware, so if a separator can occur naturally as part of the encoding for
|
||||||
|
* a character, the read will prematurely end.
|
||||||
|
**/
|
||||||
|
- (void)readDataToData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads bytes until (and including) the passed "data" parameter, which acts as a separator.
|
||||||
|
* The bytes will be appended to the given byte buffer starting at the given offset.
|
||||||
|
* The given buffer will automatically be increased in size if needed.
|
||||||
|
*
|
||||||
|
* If the timeout value is negative, the read operation will not use a timeout.
|
||||||
|
* If the buffer if nil, a buffer will automatically be created for you.
|
||||||
|
*
|
||||||
|
* If the bufferOffset is greater than the length of the given buffer,
|
||||||
|
* the method will do nothing, and the delegate will not be called.
|
||||||
|
*
|
||||||
|
* If you pass a buffer, you must not alter it in any way while AsyncSocket is using it.
|
||||||
|
* After completion, the data returned in onSocket:didReadData:withTag: will be a subset of the given buffer.
|
||||||
|
* That is, it will reference the bytes that were appended to the given buffer.
|
||||||
|
*
|
||||||
|
* To read a line from the socket, use the line separator (e.g. CRLF for HTTP, see below) as the "data" parameter.
|
||||||
|
* Note that this method is not character-set aware, so if a separator can occur naturally as part of the encoding for
|
||||||
|
* a character, the read will prematurely end.
|
||||||
|
**/
|
||||||
|
- (void)readDataToData:(NSData *)data
|
||||||
|
withTimeout:(NSTimeInterval)timeout
|
||||||
|
buffer:(NSMutableData *)buffer
|
||||||
|
bufferOffset:(NSUInteger)offset
|
||||||
|
tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads bytes until (and including) the passed "data" parameter, which acts as a separator.
|
||||||
|
*
|
||||||
|
* If the timeout value is negative, the read operation will not use a timeout.
|
||||||
|
*
|
||||||
|
* If maxLength is zero, no length restriction is enforced.
|
||||||
|
* Otherwise if maxLength bytes are read without completing the read,
|
||||||
|
* it is treated similarly to a timeout - the socket is closed with a AsyncSocketReadMaxedOutError.
|
||||||
|
* The read will complete successfully if exactly maxLength bytes are read and the given data is found at the end.
|
||||||
|
*
|
||||||
|
* If you pass nil or zero-length data as the "data" parameter,
|
||||||
|
* the method will do nothing, and the delegate will not be called.
|
||||||
|
* If you pass a maxLength parameter that is less than the length of the data parameter,
|
||||||
|
* the method will do nothing, and the delegate will not be called.
|
||||||
|
*
|
||||||
|
* To read a line from the socket, use the line separator (e.g. CRLF for HTTP, see below) as the "data" parameter.
|
||||||
|
* Note that this method is not character-set aware, so if a separator can occur naturally as part of the encoding for
|
||||||
|
* a character, the read will prematurely end.
|
||||||
|
**/
|
||||||
|
- (void)readDataToData:(NSData *)data withTimeout:(NSTimeInterval)timeout maxLength:(NSUInteger)length tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads bytes until (and including) the passed "data" parameter, which acts as a separator.
|
||||||
|
* The bytes will be appended to the given byte buffer starting at the given offset.
|
||||||
|
* The given buffer will automatically be increased in size if needed.
|
||||||
|
* A maximum of length bytes will be read.
|
||||||
|
*
|
||||||
|
* If the timeout value is negative, the read operation will not use a timeout.
|
||||||
|
* If the buffer if nil, a buffer will automatically be created for you.
|
||||||
|
*
|
||||||
|
* If maxLength is zero, no length restriction is enforced.
|
||||||
|
* Otherwise if maxLength bytes are read without completing the read,
|
||||||
|
* it is treated similarly to a timeout - the socket is closed with a AsyncSocketReadMaxedOutError.
|
||||||
|
* The read will complete successfully if exactly maxLength bytes are read and the given data is found at the end.
|
||||||
|
*
|
||||||
|
* If you pass a maxLength parameter that is less than the length of the data parameter,
|
||||||
|
* the method will do nothing, and the delegate will not be called.
|
||||||
|
* If the bufferOffset is greater than the length of the given buffer,
|
||||||
|
* the method will do nothing, and the delegate will not be called.
|
||||||
|
*
|
||||||
|
* If you pass a buffer, you must not alter it in any way while AsyncSocket is using it.
|
||||||
|
* After completion, the data returned in onSocket:didReadData:withTag: will be a subset of the given buffer.
|
||||||
|
* That is, it will reference the bytes that were appended to the given buffer.
|
||||||
|
*
|
||||||
|
* To read a line from the socket, use the line separator (e.g. CRLF for HTTP, see below) as the "data" parameter.
|
||||||
|
* Note that this method is not character-set aware, so if a separator can occur naturally as part of the encoding for
|
||||||
|
* a character, the read will prematurely end.
|
||||||
|
**/
|
||||||
|
- (void)readDataToData:(NSData *)data
|
||||||
|
withTimeout:(NSTimeInterval)timeout
|
||||||
|
buffer:(NSMutableData *)buffer
|
||||||
|
bufferOffset:(NSUInteger)offset
|
||||||
|
maxLength:(NSUInteger)length
|
||||||
|
tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes data to the socket, and calls the delegate when finished.
|
||||||
|
*
|
||||||
|
* If you pass in nil or zero-length data, this method does nothing and the delegate will not be called.
|
||||||
|
* If the timeout value is negative, the write operation will not use a timeout.
|
||||||
|
**/
|
||||||
|
- (void)writeData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns progress of current read or write, from 0.0 to 1.0, or NaN if no read/write (use isnan() to check).
|
||||||
|
* "tag", "done" and "total" will be filled in if they aren't NULL.
|
||||||
|
**/
|
||||||
|
- (float)progressOfReadReturningTag:(long *)tag bytesDone:(NSUInteger *)done total:(NSUInteger *)total;
|
||||||
|
- (float)progressOfWriteReturningTag:(long *)tag bytesDone:(NSUInteger *)done total:(NSUInteger *)total;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Secures the connection using SSL/TLS.
|
||||||
|
*
|
||||||
|
* This method may be called at any time, and the TLS handshake will occur after all pending reads and writes
|
||||||
|
* are finished. This allows one the option of sending a protocol dependent StartTLS message, and queuing
|
||||||
|
* the upgrade to TLS at the same time, without having to wait for the write to finish.
|
||||||
|
* Any reads or writes scheduled after this method is called will occur over the secured connection.
|
||||||
|
*
|
||||||
|
* The possible keys and values for the TLS settings are well documented.
|
||||||
|
* Some possible keys are:
|
||||||
|
* - kCFStreamSSLLevel
|
||||||
|
* - kCFStreamSSLAllowsExpiredCertificates
|
||||||
|
* - kCFStreamSSLAllowsExpiredRoots
|
||||||
|
* - kCFStreamSSLAllowsAnyRoot
|
||||||
|
* - kCFStreamSSLValidatesCertificateChain
|
||||||
|
* - kCFStreamSSLPeerName
|
||||||
|
* - kCFStreamSSLCertificates
|
||||||
|
* - kCFStreamSSLIsServer
|
||||||
|
*
|
||||||
|
* Please refer to Apple's documentation for associated values, as well as other possible keys.
|
||||||
|
*
|
||||||
|
* If you pass in nil or an empty dictionary, the default settings will be used.
|
||||||
|
*
|
||||||
|
* The default settings will check to make sure the remote party's certificate is signed by a
|
||||||
|
* trusted 3rd party certificate agency (e.g. verisign) and that the certificate is not expired.
|
||||||
|
* However it will not verify the name on the certificate unless you
|
||||||
|
* give it a name to verify against via the kCFStreamSSLPeerName key.
|
||||||
|
* The security implications of this are important to understand.
|
||||||
|
* Imagine you are attempting to create a secure connection to MySecureServer.com,
|
||||||
|
* but your socket gets directed to MaliciousServer.com because of a hacked DNS server.
|
||||||
|
* If you simply use the default settings, and MaliciousServer.com has a valid certificate,
|
||||||
|
* the default settings will not detect any problems since the certificate is valid.
|
||||||
|
* To properly secure your connection in this particular scenario you
|
||||||
|
* should set the kCFStreamSSLPeerName property to "MySecureServer.com".
|
||||||
|
* If you do not know the peer name of the remote host in advance (for example, you're not sure
|
||||||
|
* if it will be "domain.com" or "www.domain.com"), then you can use the default settings to validate the
|
||||||
|
* certificate, and then use the X509Certificate class to verify the issuer after the socket has been secured.
|
||||||
|
* The X509Certificate class is part of the CocoaAsyncSocket open source project.
|
||||||
|
**/
|
||||||
|
- (void)startTLS:(NSDictionary *)tlsSettings;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For handling readDataToData requests, data is necessarily read from the socket in small increments.
|
||||||
|
* The performance can be much improved by allowing AsyncSocket to read larger chunks at a time and
|
||||||
|
* store any overflow in a small internal buffer.
|
||||||
|
* This is termed pre-buffering, as some data may be read for you before you ask for it.
|
||||||
|
* If you use readDataToData a lot, enabling pre-buffering will result in better performance, especially on the iPhone.
|
||||||
|
*
|
||||||
|
* The default pre-buffering state is controlled by the DEFAULT_PREBUFFERING definition.
|
||||||
|
* It is highly recommended one leave this set to YES.
|
||||||
|
*
|
||||||
|
* This method exists in case pre-buffering needs to be disabled by default for some unforeseen reason.
|
||||||
|
* In that case, this method exists to allow one to easily enable pre-buffering when ready.
|
||||||
|
**/
|
||||||
|
- (void)enablePreBuffering;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When you create an AsyncSocket, it is added to the runloop of the current thread.
|
||||||
|
* So for manually created sockets, it is easiest to simply create the socket on the thread you intend to use it.
|
||||||
|
*
|
||||||
|
* If a new socket is accepted, the delegate method onSocket:wantsRunLoopForNewSocket: is called to
|
||||||
|
* allow you to place the socket on a separate thread. This works best in conjunction with a thread pool design.
|
||||||
|
*
|
||||||
|
* If, however, you need to move the socket to a separate thread at a later time, this
|
||||||
|
* method may be used to accomplish the task.
|
||||||
|
*
|
||||||
|
* This method must be called from the thread/runloop the socket is currently running on.
|
||||||
|
*
|
||||||
|
* Note: After calling this method, all further method calls to this object should be done from the given runloop.
|
||||||
|
* Also, all delegate calls will be sent on the given runloop.
|
||||||
|
**/
|
||||||
|
- (BOOL)moveToRunLoop:(NSRunLoop *)runLoop;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows you to configure which run loop modes the socket uses.
|
||||||
|
* The default set of run loop modes is NSDefaultRunLoopMode.
|
||||||
|
*
|
||||||
|
* If you'd like your socket to continue operation during other modes, you may want to add modes such as
|
||||||
|
* NSModalPanelRunLoopMode or NSEventTrackingRunLoopMode. Or you may simply want to use NSRunLoopCommonModes.
|
||||||
|
*
|
||||||
|
* Accepted sockets will automatically inherit the same run loop modes as the listening socket.
|
||||||
|
*
|
||||||
|
* Note: NSRunLoopCommonModes is defined in 10.5. For previous versions one can use kCFRunLoopCommonModes.
|
||||||
|
**/
|
||||||
|
- (BOOL)setRunLoopModes:(NSArray *)runLoopModes;
|
||||||
|
- (BOOL)addRunLoopMode:(NSString *)runLoopMode;
|
||||||
|
- (BOOL)removeRunLoopMode:(NSString *)runLoopMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current run loop modes the AsyncSocket instance is operating in.
|
||||||
|
* The default set of run loop modes is NSDefaultRunLoopMode.
|
||||||
|
**/
|
||||||
|
- (NSArray *)runLoopModes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* In the event of an error, this method may be called during onSocket:willDisconnectWithError: to read
|
||||||
|
* any data that's left on the socket.
|
||||||
|
**/
|
||||||
|
- (NSData *)unreadData;
|
||||||
|
|
||||||
|
/* A few common line separators, for use with the readDataToData:... methods. */
|
||||||
|
+ (NSData *)CRLFData; // 0x0D0A
|
||||||
|
+ (NSData *)CRData; // 0x0D
|
||||||
|
+ (NSData *)LFData; // 0x0A
|
||||||
|
+ (NSData *)ZeroData; // 0x00
|
||||||
|
|
||||||
|
@end
|
368
JCPrinterSDK/CocoaAsyncSocket.framework/Headers/AsyncUdpSocket.h
Normal file
368
JCPrinterSDK/CocoaAsyncSocket.framework/Headers/AsyncUdpSocket.h
Normal file
@ -0,0 +1,368 @@
|
|||||||
|
//
|
||||||
|
// AsyncUdpSocket.h
|
||||||
|
//
|
||||||
|
// This class is in the public domain.
|
||||||
|
// Originally created by Robbie Hanson on Wed Oct 01 2008.
|
||||||
|
// Updated and maintained by Deusty Designs and the Mac development community.
|
||||||
|
//
|
||||||
|
// http://code.google.com/p/cocoaasyncsocket/
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@class AsyncSendPacket;
|
||||||
|
@class AsyncReceivePacket;
|
||||||
|
|
||||||
|
extern NSString *const AsyncUdpSocketException;
|
||||||
|
extern NSString *const AsyncUdpSocketErrorDomain;
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSInteger, AsyncUdpSocketError) {
|
||||||
|
AsyncUdpSocketCFSocketError = kCFSocketError, // From CFSocketError enum
|
||||||
|
AsyncUdpSocketNoError = 0, // Never used
|
||||||
|
AsyncUdpSocketBadParameter, // Used if given a bad parameter (such as an improper address)
|
||||||
|
AsyncUdpSocketIPv4Unavailable, // Used if you bind/connect using IPv6 only
|
||||||
|
AsyncUdpSocketIPv6Unavailable, // Used if you bind/connect using IPv4 only (or iPhone)
|
||||||
|
AsyncUdpSocketSendTimeoutError,
|
||||||
|
AsyncUdpSocketReceiveTimeoutError
|
||||||
|
};
|
||||||
|
|
||||||
|
@interface AsyncUdpSocket : NSObject
|
||||||
|
{
|
||||||
|
CFSocketRef theSocket4; // IPv4 socket
|
||||||
|
CFSocketRef theSocket6; // IPv6 socket
|
||||||
|
|
||||||
|
CFRunLoopSourceRef theSource4; // For theSocket4
|
||||||
|
CFRunLoopSourceRef theSource6; // For theSocket6
|
||||||
|
CFRunLoopRef theRunLoop;
|
||||||
|
CFSocketContext theContext;
|
||||||
|
NSArray *theRunLoopModes;
|
||||||
|
|
||||||
|
NSMutableArray *theSendQueue;
|
||||||
|
AsyncSendPacket *theCurrentSend;
|
||||||
|
NSTimer *theSendTimer;
|
||||||
|
|
||||||
|
NSMutableArray *theReceiveQueue;
|
||||||
|
AsyncReceivePacket *theCurrentReceive;
|
||||||
|
NSTimer *theReceiveTimer;
|
||||||
|
|
||||||
|
id theDelegate;
|
||||||
|
UInt16 theFlags;
|
||||||
|
|
||||||
|
long theUserData;
|
||||||
|
|
||||||
|
NSString *cachedLocalHost;
|
||||||
|
UInt16 cachedLocalPort;
|
||||||
|
|
||||||
|
NSString *cachedConnectedHost;
|
||||||
|
UInt16 cachedConnectedPort;
|
||||||
|
|
||||||
|
UInt32 maxReceiveBufferSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates new instances of AsyncUdpSocket.
|
||||||
|
**/
|
||||||
|
- (id)init;
|
||||||
|
- (id)initWithDelegate:(id)delegate;
|
||||||
|
- (id)initWithDelegate:(id)delegate userData:(long)userData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates new instances of AsyncUdpSocket that support only IPv4 or IPv6.
|
||||||
|
* The other init methods will support both, unless specifically binded or connected to one protocol.
|
||||||
|
* If you know you'll only be using one protocol, these init methods may be a bit more efficient.
|
||||||
|
**/
|
||||||
|
- (id)initIPv4;
|
||||||
|
- (id)initIPv6;
|
||||||
|
|
||||||
|
- (id)delegate;
|
||||||
|
- (void)setDelegate:(id)delegate;
|
||||||
|
|
||||||
|
- (long)userData;
|
||||||
|
- (void)setUserData:(long)userData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the local address info for the socket.
|
||||||
|
*
|
||||||
|
* Note: Address info may not be available until after the socket has been bind'ed,
|
||||||
|
* or until after data has been sent.
|
||||||
|
**/
|
||||||
|
- (NSString *)localHost;
|
||||||
|
- (UInt16)localPort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the remote address info for the socket.
|
||||||
|
*
|
||||||
|
* Note: Since UDP is connectionless by design, connected address info
|
||||||
|
* will not be available unless the socket is explicitly connected to a remote host/port
|
||||||
|
**/
|
||||||
|
- (NSString *)connectedHost;
|
||||||
|
- (UInt16)connectedPort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether or not this socket has been connected to a single host.
|
||||||
|
* By design, UDP is a connectionless protocol, and connecting is not needed.
|
||||||
|
* If connected, the socket will only be able to send/receive data to/from the connected host.
|
||||||
|
**/
|
||||||
|
- (BOOL)isConnected;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether or not this socket has been closed.
|
||||||
|
* The only way a socket can be closed is if you explicitly call one of the close methods.
|
||||||
|
**/
|
||||||
|
- (BOOL)isClosed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether or not this socket supports IPv4.
|
||||||
|
* By default this will be true, unless the socket is specifically initialized as IPv6 only,
|
||||||
|
* or is binded or connected to an IPv6 address.
|
||||||
|
**/
|
||||||
|
- (BOOL)isIPv4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether or not this socket supports IPv6.
|
||||||
|
* By default this will be true, unless the socket is specifically initialized as IPv4 only,
|
||||||
|
* or is binded or connected to an IPv4 address.
|
||||||
|
*
|
||||||
|
* This method will also return false on platforms that do not support IPv6.
|
||||||
|
* Note: The iPhone does not currently support IPv6.
|
||||||
|
**/
|
||||||
|
- (BOOL)isIPv6;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the mtu of the socket.
|
||||||
|
* If unknown, returns zero.
|
||||||
|
*
|
||||||
|
* Sending data larger than this may result in an error.
|
||||||
|
* This is an advanced topic, and one should understand the wide range of mtu's on networks and the internet.
|
||||||
|
* Therefore this method is only for reference and may be of little use in many situations.
|
||||||
|
**/
|
||||||
|
- (unsigned int)maximumTransmissionUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Binds the UDP socket to the given port and optional address.
|
||||||
|
* Binding should be done for server sockets that receive data prior to sending it.
|
||||||
|
* Client sockets can skip binding,
|
||||||
|
* as the OS will automatically assign the socket an available port when it starts sending data.
|
||||||
|
*
|
||||||
|
* You cannot bind a socket after its been connected.
|
||||||
|
* You can only bind a socket once.
|
||||||
|
* You can still connect a socket (if desired) after binding.
|
||||||
|
*
|
||||||
|
* On success, returns YES.
|
||||||
|
* Otherwise returns NO, and sets errPtr. If you don't care about the error, you can pass nil for errPtr.
|
||||||
|
**/
|
||||||
|
- (BOOL)bindToPort:(UInt16)port error:(NSError **)errPtr;
|
||||||
|
- (BOOL)bindToAddress:(NSString *)localAddr port:(UInt16)port error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connects the UDP socket to the given host and port.
|
||||||
|
* By design, UDP is a connectionless protocol, and connecting is not needed.
|
||||||
|
*
|
||||||
|
* Choosing to connect to a specific host/port has the following effect:
|
||||||
|
* - You will only be able to send data to the connected host/port.
|
||||||
|
* - You will only be able to receive data from the connected host/port.
|
||||||
|
* - You will receive ICMP messages that come from the connected host/port, such as "connection refused".
|
||||||
|
*
|
||||||
|
* Connecting a UDP socket does not result in any communication on the socket.
|
||||||
|
* It simply changes the internal state of the socket.
|
||||||
|
*
|
||||||
|
* You cannot bind a socket after its been connected.
|
||||||
|
* You can only connect a socket once.
|
||||||
|
*
|
||||||
|
* On success, returns YES.
|
||||||
|
* Otherwise returns NO, and sets errPtr. If you don't care about the error, you can pass nil for errPtr.
|
||||||
|
**/
|
||||||
|
- (BOOL)connectToHost:(NSString *)host onPort:(UInt16)port error:(NSError **)errPtr;
|
||||||
|
- (BOOL)connectToAddress:(NSData *)remoteAddr error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join multicast group
|
||||||
|
*
|
||||||
|
* Group should be an IP address (eg @"225.228.0.1")
|
||||||
|
**/
|
||||||
|
- (BOOL)joinMulticastGroup:(NSString *)group error:(NSError **)errPtr;
|
||||||
|
- (BOOL)joinMulticastGroup:(NSString *)group withAddress:(NSString *)interface error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* By default, the underlying socket in the OS will not allow you to send broadcast messages.
|
||||||
|
* In order to send broadcast messages, you need to enable this functionality in the socket.
|
||||||
|
*
|
||||||
|
* A broadcast is a UDP message to addresses like "192.168.255.255" or "255.255.255.255" that is
|
||||||
|
* delivered to every host on the network.
|
||||||
|
* The reason this is generally disabled by default is to prevent
|
||||||
|
* accidental broadcast messages from flooding the network.
|
||||||
|
**/
|
||||||
|
- (BOOL)enableBroadcast:(BOOL)flag error:(NSError **)errPtr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asynchronously sends the given data, with the given timeout and tag.
|
||||||
|
*
|
||||||
|
* This method may only be used with a connected socket.
|
||||||
|
*
|
||||||
|
* If data is nil or zero-length, this method does nothing and immediately returns NO.
|
||||||
|
* If the socket is not connected, this method does nothing and immediately returns NO.
|
||||||
|
**/
|
||||||
|
- (BOOL)sendData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asynchronously sends the given data, with the given timeout and tag, to the given host and port.
|
||||||
|
*
|
||||||
|
* This method cannot be used with a connected socket.
|
||||||
|
*
|
||||||
|
* If data is nil or zero-length, this method does nothing and immediately returns NO.
|
||||||
|
* If the socket is connected, this method does nothing and immediately returns NO.
|
||||||
|
* If unable to resolve host to a valid IPv4 or IPv6 address, this method returns NO.
|
||||||
|
**/
|
||||||
|
- (BOOL)sendData:(NSData *)data toHost:(NSString *)host port:(UInt16)port withTimeout:(NSTimeInterval)timeout tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asynchronously sends the given data, with the given timeout and tag, to the given address.
|
||||||
|
*
|
||||||
|
* This method cannot be used with a connected socket.
|
||||||
|
*
|
||||||
|
* If data is nil or zero-length, this method does nothing and immediately returns NO.
|
||||||
|
* If the socket is connected, this method does nothing and immediately returns NO.
|
||||||
|
**/
|
||||||
|
- (BOOL)sendData:(NSData *)data toAddress:(NSData *)remoteAddr withTimeout:(NSTimeInterval)timeout tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asynchronously receives a single datagram packet.
|
||||||
|
*
|
||||||
|
* If the receive succeeds, the onUdpSocket:didReceiveData:fromHost:port:tag delegate method will be called.
|
||||||
|
* Otherwise, a timeout will occur, and the onUdpSocket:didNotReceiveDataWithTag: delegate method will be called.
|
||||||
|
**/
|
||||||
|
- (void)receiveWithTimeout:(NSTimeInterval)timeout tag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes the socket immediately. Any pending send or receive operations are dropped.
|
||||||
|
**/
|
||||||
|
- (void)close;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes after all pending send operations have completed.
|
||||||
|
* After calling this, the sendData: and receive: methods will do nothing.
|
||||||
|
* In other words, you won't be able to add any more send or receive operations to the queue.
|
||||||
|
* The socket will close even if there are still pending receive operations.
|
||||||
|
**/
|
||||||
|
- (void)closeAfterSending;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes after all pending receive operations have completed.
|
||||||
|
* After calling this, the sendData: and receive: methods will do nothing.
|
||||||
|
* In other words, you won't be able to add any more send or receive operations to the queue.
|
||||||
|
* The socket will close even if there are still pending send operations.
|
||||||
|
**/
|
||||||
|
- (void)closeAfterReceiving;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes after all pending send and receive operations have completed.
|
||||||
|
* After calling this, the sendData: and receive: methods will do nothing.
|
||||||
|
* In other words, you won't be able to add any more send or receive operations to the queue.
|
||||||
|
**/
|
||||||
|
- (void)closeAfterSendingAndReceiving;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets/Sets the maximum size of the buffer that will be allocated for receive operations.
|
||||||
|
* The default size is 9216 bytes.
|
||||||
|
*
|
||||||
|
* The theoretical maximum size of any IPv4 UDP packet is UINT16_MAX = 65535.
|
||||||
|
* The theoretical maximum size of any IPv6 UDP packet is UINT32_MAX = 4294967295.
|
||||||
|
*
|
||||||
|
* In practice, however, the size of UDP packets will be much smaller.
|
||||||
|
* Indeed most protocols will send and receive packets of only a few bytes,
|
||||||
|
* or will set a limit on the size of packets to prevent fragmentation in the IP layer.
|
||||||
|
*
|
||||||
|
* If you set the buffer size too small, the sockets API in the OS will silently discard
|
||||||
|
* any extra data, and you will not be notified of the error.
|
||||||
|
**/
|
||||||
|
- (UInt32)maxReceiveBufferSize;
|
||||||
|
- (void)setMaxReceiveBufferSize:(UInt32)max;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When you create an AsyncUdpSocket, it is added to the runloop of the current thread.
|
||||||
|
* So it is easiest to simply create the socket on the thread you intend to use it.
|
||||||
|
*
|
||||||
|
* If, however, you need to move the socket to a separate thread at a later time, this
|
||||||
|
* method may be used to accomplish the task.
|
||||||
|
*
|
||||||
|
* This method must be called from the thread/runloop the socket is currently running on.
|
||||||
|
*
|
||||||
|
* Note: After calling this method, all further method calls to this object should be done from the given runloop.
|
||||||
|
* Also, all delegate calls will be sent on the given runloop.
|
||||||
|
**/
|
||||||
|
- (BOOL)moveToRunLoop:(NSRunLoop *)runLoop;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows you to configure which run loop modes the socket uses.
|
||||||
|
* The default set of run loop modes is NSDefaultRunLoopMode.
|
||||||
|
*
|
||||||
|
* If you'd like your socket to continue operation during other modes, you may want to add modes such as
|
||||||
|
* NSModalPanelRunLoopMode or NSEventTrackingRunLoopMode. Or you may simply want to use NSRunLoopCommonModes.
|
||||||
|
*
|
||||||
|
* Note: NSRunLoopCommonModes is defined in 10.5. For previous versions one can use kCFRunLoopCommonModes.
|
||||||
|
**/
|
||||||
|
- (BOOL)setRunLoopModes:(NSArray *)runLoopModes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current run loop modes the AsyncSocket instance is operating in.
|
||||||
|
* The default set of run loop modes is NSDefaultRunLoopMode.
|
||||||
|
**/
|
||||||
|
- (NSArray *)runLoopModes;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
#pragma mark -
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@protocol AsyncUdpSocketDelegate
|
||||||
|
@optional
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the datagram with the given tag has been sent.
|
||||||
|
**/
|
||||||
|
- (void)onUdpSocket:(AsyncUdpSocket *)sock didSendDataWithTag:(long)tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called if an error occurs while trying to send a datagram.
|
||||||
|
* This could be due to a timeout, or something more serious such as the data being too large to fit in a sigle packet.
|
||||||
|
**/
|
||||||
|
- (void)onUdpSocket:(AsyncUdpSocket *)sock didNotSendDataWithTag:(long)tag dueToError:(NSError *)error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the socket has received the requested datagram.
|
||||||
|
*
|
||||||
|
* Due to the nature of UDP, you may occasionally receive undesired packets.
|
||||||
|
* These may be rogue UDP packets from unknown hosts,
|
||||||
|
* or they may be delayed packets arriving after retransmissions have already occurred.
|
||||||
|
* It's important these packets are properly ignored, while not interfering with the flow of your implementation.
|
||||||
|
* As an aid, this delegate method has a boolean return value.
|
||||||
|
* If you ever need to ignore a received packet, simply return NO,
|
||||||
|
* and AsyncUdpSocket will continue as if the packet never arrived.
|
||||||
|
* That is, the original receive request will still be queued, and will still timeout as usual if a timeout was set.
|
||||||
|
* For example, say you requested to receive data, and you set a timeout of 500 milliseconds, using a tag of 15.
|
||||||
|
* If rogue data arrives after 250 milliseconds, this delegate method would be invoked, and you could simply return NO.
|
||||||
|
* If the expected data then arrives within the next 250 milliseconds,
|
||||||
|
* this delegate method will be invoked, with a tag of 15, just as if the rogue data never appeared.
|
||||||
|
*
|
||||||
|
* Under normal circumstances, you simply return YES from this method.
|
||||||
|
**/
|
||||||
|
- (BOOL)onUdpSocket:(AsyncUdpSocket *)sock
|
||||||
|
didReceiveData:(NSData *)data
|
||||||
|
withTag:(long)tag
|
||||||
|
fromHost:(NSString *)host
|
||||||
|
port:(UInt16)port;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called if an error occurs while trying to receive a requested datagram.
|
||||||
|
* This is generally due to a timeout, but could potentially be something else if some kind of OS error occurred.
|
||||||
|
**/
|
||||||
|
- (void)onUdpSocket:(AsyncUdpSocket *)sock didNotReceiveDataWithTag:(long)tag dueToError:(NSError *)error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the socket is closed.
|
||||||
|
* A socket is only closed if you explicitly call one of the close methods.
|
||||||
|
**/
|
||||||
|
- (void)onUdpSocketDidClose:(AsyncUdpSocket *)sock;
|
||||||
|
|
||||||
|
@end
|
@ -0,0 +1,20 @@
|
|||||||
|
//
|
||||||
|
// CocoaAsyncSocket.h
|
||||||
|
// CocoaAsyncSocket
|
||||||
|
//
|
||||||
|
// Created by Derek Clarkson on 10/08/2015.
|
||||||
|
// Copyright © 2015 Robbie Hanson. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
@import Foundation;
|
||||||
|
|
||||||
|
//! Project version number for CocoaAsyncSocket.
|
||||||
|
FOUNDATION_EXPORT double cocoaAsyncSocketVersionNumber;
|
||||||
|
|
||||||
|
//! Project version string for CocoaAsyncSocket.
|
||||||
|
FOUNDATION_EXPORT const unsigned char cocoaAsyncSocketVersionString[];
|
||||||
|
|
||||||
|
#import <CocoaAsyncSocket/AsyncSocket.h>
|
||||||
|
#import <CocoaAsyncSocket/AsyncUdpSocket.h>
|
||||||
|
#import <CocoaAsyncSocket/GCDAsyncSocket.h>
|
||||||
|
#import <CocoaAsyncSocket/GCDAsyncUdpSocket.h>
|
1177
JCPrinterSDK/CocoaAsyncSocket.framework/Headers/GCDAsyncSocket.h
Normal file
1177
JCPrinterSDK/CocoaAsyncSocket.framework/Headers/GCDAsyncSocket.h
Normal file
File diff suppressed because it is too large
Load Diff
1007
JCPrinterSDK/CocoaAsyncSocket.framework/Headers/GCDAsyncUdpSocket.h
Normal file
1007
JCPrinterSDK/CocoaAsyncSocket.framework/Headers/GCDAsyncUdpSocket.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
JCPrinterSDK/CocoaAsyncSocket.framework/Info.plist
Normal file
BIN
JCPrinterSDK/CocoaAsyncSocket.framework/Info.plist
Normal file
Binary file not shown.
@ -0,0 +1,6 @@
|
|||||||
|
framework module CocoaAsyncSocket {
|
||||||
|
umbrella header "CocoaAsyncSocket.h"
|
||||||
|
|
||||||
|
export *
|
||||||
|
module * { export * }
|
||||||
|
}
|
@ -0,0 +1,201 @@
|
|||||||
|
<?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>files</key>
|
||||||
|
<dict>
|
||||||
|
<key>Headers/AsyncSocket.h</key>
|
||||||
|
<data>
|
||||||
|
GyStCmhuxAWLghA+fHLwPiSbVNI=
|
||||||
|
</data>
|
||||||
|
<key>Headers/AsyncUdpSocket.h</key>
|
||||||
|
<data>
|
||||||
|
oqLPl3ROAyiOqTaqhuupNjuxVU0=
|
||||||
|
</data>
|
||||||
|
<key>Headers/CocoaAsyncSocket.h</key>
|
||||||
|
<data>
|
||||||
|
fwx/DHzHzUQhtlfC9ffKAK+SFx0=
|
||||||
|
</data>
|
||||||
|
<key>Headers/GCDAsyncSocket.h</key>
|
||||||
|
<data>
|
||||||
|
/7aHrd4SpiKhqk1H7YRnTBSmJow=
|
||||||
|
</data>
|
||||||
|
<key>Headers/GCDAsyncUdpSocket.h</key>
|
||||||
|
<data>
|
||||||
|
LH5V3wgNYRH1dy/fNu8r4lu8puI=
|
||||||
|
</data>
|
||||||
|
<key>Info.plist</key>
|
||||||
|
<data>
|
||||||
|
hIIk3iGpMXJkFPisCMWGNsBtuQI=
|
||||||
|
</data>
|
||||||
|
<key>Modules/module.modulemap</key>
|
||||||
|
<data>
|
||||||
|
+n94rYTWDjekX3imyh+PSyA9vgA=
|
||||||
|
</data>
|
||||||
|
</dict>
|
||||||
|
<key>files2</key>
|
||||||
|
<dict>
|
||||||
|
<key>Headers/AsyncSocket.h</key>
|
||||||
|
<dict>
|
||||||
|
<key>hash</key>
|
||||||
|
<data>
|
||||||
|
GyStCmhuxAWLghA+fHLwPiSbVNI=
|
||||||
|
</data>
|
||||||
|
<key>hash2</key>
|
||||||
|
<data>
|
||||||
|
FK+dN4jyAlPVkpV5Ai//YboXm9aUxPv3x3Q3viDjqTU=
|
||||||
|
</data>
|
||||||
|
</dict>
|
||||||
|
<key>Headers/AsyncUdpSocket.h</key>
|
||||||
|
<dict>
|
||||||
|
<key>hash</key>
|
||||||
|
<data>
|
||||||
|
oqLPl3ROAyiOqTaqhuupNjuxVU0=
|
||||||
|
</data>
|
||||||
|
<key>hash2</key>
|
||||||
|
<data>
|
||||||
|
aTSbXrHSbcwPrz3/NoP6Q+jWZEwou6OSHQh/8WRkf/0=
|
||||||
|
</data>
|
||||||
|
</dict>
|
||||||
|
<key>Headers/CocoaAsyncSocket.h</key>
|
||||||
|
<dict>
|
||||||
|
<key>hash</key>
|
||||||
|
<data>
|
||||||
|
fwx/DHzHzUQhtlfC9ffKAK+SFx0=
|
||||||
|
</data>
|
||||||
|
<key>hash2</key>
|
||||||
|
<data>
|
||||||
|
OeCNZd4h1R70nH11jcrFn8m1hnTuvTAHjDhMuhI/3Ao=
|
||||||
|
</data>
|
||||||
|
</dict>
|
||||||
|
<key>Headers/GCDAsyncSocket.h</key>
|
||||||
|
<dict>
|
||||||
|
<key>hash</key>
|
||||||
|
<data>
|
||||||
|
/7aHrd4SpiKhqk1H7YRnTBSmJow=
|
||||||
|
</data>
|
||||||
|
<key>hash2</key>
|
||||||
|
<data>
|
||||||
|
bOafNUOs6luKovAV0sGzRLmHYf/vKZPF/Wg0IJD1zwQ=
|
||||||
|
</data>
|
||||||
|
</dict>
|
||||||
|
<key>Headers/GCDAsyncUdpSocket.h</key>
|
||||||
|
<dict>
|
||||||
|
<key>hash</key>
|
||||||
|
<data>
|
||||||
|
LH5V3wgNYRH1dy/fNu8r4lu8puI=
|
||||||
|
</data>
|
||||||
|
<key>hash2</key>
|
||||||
|
<data>
|
||||||
|
CAMdz3VphGMLZyKBHhxLfGK4d70mHUiuHsG45jRPi+0=
|
||||||
|
</data>
|
||||||
|
</dict>
|
||||||
|
<key>Modules/module.modulemap</key>
|
||||||
|
<dict>
|
||||||
|
<key>hash</key>
|
||||||
|
<data>
|
||||||
|
+n94rYTWDjekX3imyh+PSyA9vgA=
|
||||||
|
</data>
|
||||||
|
<key>hash2</key>
|
||||||
|
<data>
|
||||||
|
RoVn8xMeEnU3Izg0DtYjYL/krI8V7qw0sa7Ggf+08Rs=
|
||||||
|
</data>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>rules</key>
|
||||||
|
<dict>
|
||||||
|
<key>^</key>
|
||||||
|
<true/>
|
||||||
|
<key>^.*\.lproj/</key>
|
||||||
|
<dict>
|
||||||
|
<key>optional</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>1000</real>
|
||||||
|
</dict>
|
||||||
|
<key>^.*\.lproj/locversion.plist$</key>
|
||||||
|
<dict>
|
||||||
|
<key>omit</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>1100</real>
|
||||||
|
</dict>
|
||||||
|
<key>^version.plist$</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
<key>rules2</key>
|
||||||
|
<dict>
|
||||||
|
<key>.*\.dSYM($|/)</key>
|
||||||
|
<dict>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>11</real>
|
||||||
|
</dict>
|
||||||
|
<key>^</key>
|
||||||
|
<dict>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>20</real>
|
||||||
|
</dict>
|
||||||
|
<key>^(.*/)?\.DS_Store$</key>
|
||||||
|
<dict>
|
||||||
|
<key>omit</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>2000</real>
|
||||||
|
</dict>
|
||||||
|
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
||||||
|
<dict>
|
||||||
|
<key>nested</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>10</real>
|
||||||
|
</dict>
|
||||||
|
<key>^.*</key>
|
||||||
|
<true/>
|
||||||
|
<key>^.*\.lproj/</key>
|
||||||
|
<dict>
|
||||||
|
<key>optional</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>1000</real>
|
||||||
|
</dict>
|
||||||
|
<key>^.*\.lproj/locversion.plist$</key>
|
||||||
|
<dict>
|
||||||
|
<key>omit</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>1100</real>
|
||||||
|
</dict>
|
||||||
|
<key>^Info\.plist$</key>
|
||||||
|
<dict>
|
||||||
|
<key>omit</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>20</real>
|
||||||
|
</dict>
|
||||||
|
<key>^PkgInfo$</key>
|
||||||
|
<dict>
|
||||||
|
<key>omit</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>20</real>
|
||||||
|
</dict>
|
||||||
|
<key>^[^/]+$</key>
|
||||||
|
<dict>
|
||||||
|
<key>nested</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>10</real>
|
||||||
|
</dict>
|
||||||
|
<key>^embedded\.provisionprofile$</key>
|
||||||
|
<dict>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>20</real>
|
||||||
|
</dict>
|
||||||
|
<key>^version\.plist$</key>
|
||||||
|
<dict>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>20</real>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
33
JCPrinterSDK/FWnetworkWIFI.h
Normal file
33
JCPrinterSDK/FWnetworkWIFI.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
//
|
||||||
|
// FWnetworkWIFI.h
|
||||||
|
// FeasyWifiSDK
|
||||||
|
//
|
||||||
|
// Created by wenyewei on 2019/5/30.
|
||||||
|
// Copyright © 2019年 Feasycom. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
typedef struct Dev
|
||||||
|
{
|
||||||
|
__unsafe_unretained NSString * _Nullable macAddress;
|
||||||
|
unsigned char type[2];
|
||||||
|
unsigned int ip;
|
||||||
|
__unsafe_unretained NSString * _Nonnull dev_name;
|
||||||
|
}Dev_Info;
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
@protocol WIFIManagerDelegate <NSObject>
|
||||||
|
-(void)didWIFIContect;
|
||||||
|
-(void)didFindDeviceList:(NSArray *)arr;
|
||||||
|
|
||||||
|
@end
|
||||||
|
@interface FWnetworkWIFI : NSObject
|
||||||
|
@property (weak,nonatomic) id <WIFIManagerDelegate> delegate;
|
||||||
|
@property (strong,nonatomic) NSMutableArray *configDeviceList;
|
||||||
|
+(instancetype)shareManager;
|
||||||
|
-(BOOL)isEnableWIFI;
|
||||||
|
-(void)connectWIFIWithSSID:(NSString *)SSID pass:(NSString *)pass;
|
||||||
|
-(void)startScan;
|
||||||
|
-(void)stop;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
27
JCPrinterSDK/FWnetworkWIFI.mm
Normal file
27
JCPrinterSDK/FWnetworkWIFI.mm
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
#include "FWnetworkWIFI.h"
|
||||||
|
|
||||||
|
@implementation FWnetworkWIFI
|
||||||
|
|
||||||
|
+(instancetype)shareManager{
|
||||||
|
FWnetworkWIFI * manager = [super init];
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
-(BOOL)isEnableWIFI{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-(void)connectWIFIWithSSID:(NSString *)SSID pass:(NSString *)pass{
|
||||||
|
|
||||||
|
}
|
||||||
|
-(void)startScan{
|
||||||
|
|
||||||
|
}
|
||||||
|
-(void)stop{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
BIN
JCPrinterSDK/JCAPI.a
Normal file
BIN
JCPrinterSDK/JCAPI.a
Normal file
Binary file not shown.
680
JCPrinterSDK/JCAPI.h
Normal file
680
JCPrinterSDK/JCAPI.h
Normal file
@ -0,0 +1,680 @@
|
|||||||
|
//
|
||||||
|
// JCAPI.h
|
||||||
|
// JCPrinterSDK
|
||||||
|
//
|
||||||
|
// Created by ydong on 2019/1/29.
|
||||||
|
// Copyright © 2019 ydong. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
建议在iOS9以上系统使用
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger, JCBarcodeMode){
|
||||||
|
//CODEBAR 1D format.
|
||||||
|
JCBarcodeFormatCodebar ,
|
||||||
|
|
||||||
|
//Code 39 1D format.
|
||||||
|
JCBarcodeFormatCode39 ,
|
||||||
|
|
||||||
|
//Code 93 1D format.
|
||||||
|
JCBarcodeFormatCode93 ,
|
||||||
|
|
||||||
|
//Code 128 1D format.
|
||||||
|
JCBarcodeFormatCode128 ,
|
||||||
|
|
||||||
|
//EAN-8 1D format.
|
||||||
|
JCBarcodeFormatEan8 ,
|
||||||
|
|
||||||
|
//EAN-13 1D format.
|
||||||
|
JCBarcodeFormatEan13 ,
|
||||||
|
|
||||||
|
//ITF (Interleaved Two of Five) 1D format.
|
||||||
|
JCBarcodeFormatITF ,
|
||||||
|
|
||||||
|
//UPC-A 1D format.
|
||||||
|
JCBarcodeFormatUPCA ,
|
||||||
|
|
||||||
|
//UPC-E 1D format.
|
||||||
|
JCBarcodeFormatUPCE
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger,JCSDKCacheStatus){
|
||||||
|
JCSDKCacheWillPrinting,
|
||||||
|
JCSDKCachePrinting,
|
||||||
|
JCSDKCacheWillPause,
|
||||||
|
JCSDKCachePaused,
|
||||||
|
JCSDKCacheWillCancel,
|
||||||
|
JCSDKCacheCanceled,
|
||||||
|
JCSDKCacheWillDone,
|
||||||
|
JCSDKCacheDone,
|
||||||
|
JCSDKCacheWillResume,
|
||||||
|
JCSDKCacheResumed,
|
||||||
|
} ;
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger,JCSDKCammodFontType) {
|
||||||
|
JCSDKCammodFontTypeStandard = 0,
|
||||||
|
JCSDKCammodFontTypeFreestyleScript,
|
||||||
|
JCSDKCammodFontTypeOCRA,
|
||||||
|
JCSDKCammodFontTypeHelveticaNeueLTPro,
|
||||||
|
JCSDKCammodFontTypeTimesNewRoman,
|
||||||
|
JCSDKCammodFontTypeMICR,
|
||||||
|
JCSDKCammodFontTypeTerU24b,
|
||||||
|
JCSDKCammodFontTypeSimpleChinese16Point = 55,
|
||||||
|
JCSDKCammodFontTypeSimpleChinese24Point
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger,JCSDKCammodRotation) {
|
||||||
|
JCSDKCammodRotationDefault = 0,
|
||||||
|
JCSDKCammodRotation90 = 90,
|
||||||
|
JCSDKCammodRotation180 = 180,
|
||||||
|
JCSDKCammodRotation270 = 270
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger,JCSDKCammodGraphicsType) {
|
||||||
|
JCSDKCammodGraphicsTypeHorizontalExt ,
|
||||||
|
JCSDKCammodGraphicsTypeVerticalExt,
|
||||||
|
JCSDKCammodGraphicsTypeHorizontalZip,
|
||||||
|
JCSDKCammodGraphicsTypeVerticalZip
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef void (^DidOpened_Printer_Block) (BOOL isSuccess) ;
|
||||||
|
typedef void (^DidPrinted_Block) (BOOL isSuccess) ;
|
||||||
|
typedef void (^PRINT_INFO) (NSString * printInfo) ;
|
||||||
|
typedef void (^PRINT_STATE) (BOOL isSuccess) ;
|
||||||
|
typedef void (^PRINT_DIC_INFO) (NSDictionary * printDicInfo) ;
|
||||||
|
typedef void (^JCSDKCACHE_STATE) (JCSDKCacheStatus status) ;
|
||||||
|
|
||||||
|
|
||||||
|
@interface JCAPI : NSObject
|
||||||
|
|
||||||
|
|
||||||
|
/// @{@"serial":@"V1.0.0",@"date":@"2021/05/06",@"description":@"描述"}
|
||||||
|
+ (NSDictionary *)version;
|
||||||
|
|
||||||
|
|
||||||
|
/// 设置连接的打印机厂商id,需要在连接之前设置
|
||||||
|
/// id: 缺省0 ,1-精臣系。 2-B3系。 3-B11系。 4-T2系
|
||||||
|
/// @param printerFactoryId 厂商id
|
||||||
|
+ (void)setPrinterFactoryId:(NSInteger)printerFactoryId;
|
||||||
|
|
||||||
|
|
||||||
|
/// 设置第三方接入的对象类名
|
||||||
|
/// @param className 类名,必须遵守JC_MyPrinterProtocol协议
|
||||||
|
+ (void)setPrinterFactoryTool:(NSString *)className;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi获取搜索到的打印机列表。
|
||||||
|
wifi回调: @[@{@"ipAdd":@"ip地址", @"bleName":@"蓝牙名字"}]
|
||||||
|
|
||||||
|
@param isWifi YES:为搜索Wi-Fi,NO为搜索蓝牙
|
||||||
|
@param completion 打印机名字数组block(该名字为连接打印机时的printerName参数)
|
||||||
|
*/
|
||||||
|
+ (void)scanPrinterNames:(BOOL)isWifi completion:(void(^)(NSArray *scanedPrinterNames))completion;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙连接指定名称的打印机。
|
||||||
|
|
||||||
|
@param printerName 打印机名称。
|
||||||
|
@param completion 连接打印机是否成功。(连接状态改变通过该回调返回)
|
||||||
|
*/
|
||||||
|
+ (void)openPrinter:(NSString *)printerName
|
||||||
|
completion:(DidOpened_Printer_Block)completion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
打印机类型,连接成功后才能使用,其它厂家打印机返回@“”/@“0”,精臣系打印机返回
|
||||||
|
hBit = value/256
|
||||||
|
lBit = value%256
|
||||||
|
B3S: hBit/lBit = 1
|
||||||
|
D11: hBit/lBit = 2
|
||||||
|
B21: hBit = 3
|
||||||
|
{
|
||||||
|
L2B: lBit = 1
|
||||||
|
L2W: lBit = 2
|
||||||
|
C2B: lBit = 3
|
||||||
|
C2W: lBit = 4
|
||||||
|
C3B: lBit = 5
|
||||||
|
C3W: lBit = 6
|
||||||
|
}
|
||||||
|
P1: hBit/lBit = 4
|
||||||
|
B16: hBit/lBit = 7
|
||||||
|
@return 返回打印机类型
|
||||||
|
*/
|
||||||
|
+(NSInteger )printerTypeInfo;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙关闭打开的打印机连接。
|
||||||
|
*/
|
||||||
|
+ (void)closePrinter;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi获取当前连接的打印机名称(Wi-Fi为ip地址)。
|
||||||
|
|
||||||
|
@return 当前连接的打印机名称。
|
||||||
|
*/
|
||||||
|
+ (NSString *)connectingPrinterName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi连接状态
|
||||||
|
|
||||||
|
@return 2表示连接Wi-Fi,1表示连接蓝牙,0表示无连接
|
||||||
|
*/
|
||||||
|
+ (int)isConnectingState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi设置打印机。
|
||||||
|
|
||||||
|
@param state 参数为20-30 @param type 对应参数如下
|
||||||
|
21-设置打印浓度 1—淡,2—正常, 3—浓, 4-较浓 5-最浓;(打价器仍只有三挡:1,2,3)
|
||||||
|
22-设置打印速度 1—慢, 2—稍慢, 3—正常, 4—稍快, 5—快;(打价器速度三挡)
|
||||||
|
23-设置纸张类型 1—间隙纸, 2—黑标纸, 3—连续纸,4-定孔纸,5-透明纸(4,目前还没有)
|
||||||
|
24-设置马达驱动(预留) 1
|
||||||
|
25-设置自动出纸(预留) 1、2、3
|
||||||
|
26-设置打印机语言; 1-中文,2-英文
|
||||||
|
27-设置自动关机时间 N分钟 1-4(
|
||||||
|
1:15min;
|
||||||
|
2:30min;
|
||||||
|
3:60min(D11为45分钟);
|
||||||
|
4:从不(D11为60分钟)
|
||||||
|
)
|
||||||
|
28-恢复出厂设置 1
|
||||||
|
29-纸张类型标定 1
|
||||||
|
20-打印模式,限T2支持 1-热敏模式。 2-热感应模式(碳带模式)
|
||||||
|
30-音量设置(0-5档)
|
||||||
|
31-设置机器防伪
|
||||||
|
@param completion 是否设置成功。
|
||||||
|
*/
|
||||||
|
+ (void)setPrintState:(NSInteger)state type:(NSInteger)type sucess:(PRINT_DIC_INFO)completion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi获取打印机信息。b11系列只有9&12
|
||||||
|
|
||||||
|
@param type 1-打印浓度
|
||||||
|
2-打印速度
|
||||||
|
3-纸张类型
|
||||||
|
4-马达驱动(预留)
|
||||||
|
5-自动出纸(预留)
|
||||||
|
6-打印机语言
|
||||||
|
7-自动关机时间
|
||||||
|
8-机器型号
|
||||||
|
9-软件版本(固件版本)
|
||||||
|
10-当前电量
|
||||||
|
11-机器序列号
|
||||||
|
12-硬件版本
|
||||||
|
13-硬件参数信息(如:电池电压等)----(后面去掉该类型支持)
|
||||||
|
14-历史打印信息。
|
||||||
|
15-获取打印机读取成功次数信息(仅支持b21打印机,V2.11支持d11系列3.28以上版本)
|
||||||
|
16-查询打印机配网状态(仅支持b21打印机)
|
||||||
|
19-获取mac地址
|
||||||
|
20-打印模式(1、热敏 2、热感应)
|
||||||
|
21-获取打印机内置地区码
|
||||||
|
|
||||||
|
@param completion 返回对应的信息。@"UNRESOPN_ERROR"表示获取信息超时
|
||||||
|
*/
|
||||||
|
+ (void)getPrintInfo:(NSInteger)type sucess:(PRINT_DIC_INFO)completion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
根据传入参数获取所有的信息
|
||||||
|
|
||||||
|
@param completion 获取后的回调
|
||||||
|
@param arg 参数列表,最大支持10个,必须是+ (void)getPrintInfo:(NSInteger)type sucess:(PRINT_DIC_INFO)completion所支持的type类型,返回结果和传入arg对应的健值对
|
||||||
|
*/
|
||||||
|
+ (void)getInfosWithComplete:(PRINT_DIC_INFO)completion fromArgs:(NSInteger)arg, ...NS_REQUIRES_NIL_TERMINATION;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi是否支持盒盖状态检测
|
||||||
|
|
||||||
|
@return YES:支持、NO:不支持
|
||||||
|
*/
|
||||||
|
+ (BOOL)isSupportPrintCoverStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi盒盖状态改变返回(在连接成功后调用)
|
||||||
|
|
||||||
|
@param completion 盒盖状态:0打开、1关闭
|
||||||
|
@param checkPaperBlock 当前打印机是否有耗材:0没有、1有
|
||||||
|
@return 是否支持盒盖状态检测:YES:支持、NO:不支持
|
||||||
|
*/
|
||||||
|
+ (BOOL)getPrintCoverStatusChange:(PRINT_INFO)completion withCheckPrinterHavePaperBlock:(PRINT_INFO)checkPaperBlock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
监听打印机状态变化
|
||||||
|
|
||||||
|
@param completion
|
||||||
|
@{
|
||||||
|
@"1": 盒盖状态-0打开/1关闭
|
||||||
|
@"2": 电量等级变化-1/2/3/4
|
||||||
|
@"3": 是否装有纸张-0没有/1有
|
||||||
|
@"5": 碳带状态-0无碳带/1有碳带
|
||||||
|
}
|
||||||
|
@return 是否支持监听打印机状态变化:YES:支持、NO:不支持
|
||||||
|
*/
|
||||||
|
+ (BOOL)getPrintStatusChange:(PRINT_DIC_INFO)completion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi是否支持缺纸检测等功能(目前app没有用到具体功能接口,替换为该接口)
|
||||||
|
|
||||||
|
@return 是否支持:YES:支持、NO:不支持
|
||||||
|
*/
|
||||||
|
+ (BOOL)isSupportNOPaper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
p1打印机打印前传入总打印份数,startDraw:height:orientation:之前调用/startJob之前调用
|
||||||
|
|
||||||
|
@param totalQuantityOfPrints 总份数
|
||||||
|
*/
|
||||||
|
+ (void)setTotalQuantityOfPrints:(NSInteger)totalQuantityOfPrints;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi生成带延长线条码最小宽度,单位像素。
|
||||||
|
|
||||||
|
@param text 条码内容。
|
||||||
|
@param barcodeMode 条码类型。
|
||||||
|
@param isExtension 是否带延长线:YES为带,NO未不带。
|
||||||
|
@return 条码最小宽度。
|
||||||
|
*/
|
||||||
|
+ (NSInteger)getBarCodeWidth:(NSString *)text codeFormat:(JCBarcodeMode)barcodeMode isExtension:(BOOL)isExtension;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi生成二维码最小宽度,单位像素。
|
||||||
|
|
||||||
|
@param text 二维码内容。
|
||||||
|
@return 二维码最小宽/高。
|
||||||
|
*/
|
||||||
|
+ (NSInteger)getQRCodeWidth:(NSString *)text;
|
||||||
|
|
||||||
|
|
||||||
|
/// 0-正常,1-不支持的类型,2-数据异常,3-长度不符,4-字符不符,5-校验码不符
|
||||||
|
/// @param barcodeType 条码类型(20-28)
|
||||||
|
/// @param content 传入的条码数据
|
||||||
|
+ (int)barcodeFormatCheck:(int)barcodeType content:(NSString*)content ;
|
||||||
|
|
||||||
|
|
||||||
|
/// 0-正常,1-不支持的类型,2-数据异常,3-长度不符,4-字符不符
|
||||||
|
/// @param qrcodeType 条码类型(31-34)
|
||||||
|
/// @param content 传入的二维码数据
|
||||||
|
+ (int)qrcodeFormatCheck:(int)qrcodeType content:(NSString*)content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi返回处理后的条码内容。
|
||||||
|
|
||||||
|
@param text 条码内容。
|
||||||
|
@param barcodeMode 条码类型。
|
||||||
|
@return 处理后的条码内容(也可用于检查条码内容是否规范,@"":表示出错)
|
||||||
|
*/
|
||||||
|
+ (NSString *)dealBarCodeText:(NSString *)text withBarcodeMode:(JCBarcodeMode)barcodeMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi获取第几页预览图(在print:之前获取)。
|
||||||
|
|
||||||
|
@param index 第几页(从0开始)
|
||||||
|
@return 预览图
|
||||||
|
*/
|
||||||
|
+ (UIImage *)previewImage:(NSInteger)index;
|
||||||
|
|
||||||
|
|
||||||
|
/// 打印时获取预览图
|
||||||
|
+ (UIImage *)getPrintPreviewImage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi图片直接生成预览图图片。
|
||||||
|
|
||||||
|
@param image 图像对象。
|
||||||
|
@param width 打印对象的尺寸,单位毫米。
|
||||||
|
@param height 打印对象的尺寸,单位毫米。
|
||||||
|
@param orientation 旋转角度:0:不旋转;90:顺时针旋转90度;180:旋转180度;270:逆时针旋转90度。
|
||||||
|
@return 预览图
|
||||||
|
*/
|
||||||
|
+ (UIImage *)drawpreviewImagFromImage:(UIImage *)image
|
||||||
|
width:(CGFloat)width
|
||||||
|
height:(CGFloat)height
|
||||||
|
orientation:(NSInteger)orientation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// 图像二期打印json数据
|
||||||
|
/// @param printData json数据
|
||||||
|
/// @param printerJson 打印机边距信息
|
||||||
|
/// @param onePageNumvers 单页要打印的份数
|
||||||
|
/// @param completion 回调
|
||||||
|
+ (void)print:(NSString *)printData printAddJson:(NSDictionary *)printerJson withOnePageNumbers:(int)onePageNumvers withComplete:(DidPrinted_Block)completion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi取消打印(打印未完成调用)。
|
||||||
|
|
||||||
|
@param completion 打印结束回调(在发生异常后不会返回)
|
||||||
|
*/
|
||||||
|
+ (void)cancelJob:(DidPrinted_Block)completion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi打印完成(打印完成后调用)。
|
||||||
|
|
||||||
|
@param completion 打印结束回调(在发生异常后不会返回)
|
||||||
|
*/
|
||||||
|
+ (void)endPrint:(DidPrinted_Block)completion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi打价器打印完成的份数(只对打价器有效,可能部分丢失,app做超时重置状态)。
|
||||||
|
|
||||||
|
@param count 打印完成的份数(在发生异常后不会返回)
|
||||||
|
@{
|
||||||
|
@"totalCount":@"总打印的张数计数" //返回必带的key
|
||||||
|
@"pageCount":@"当前打印第PageNo页的第几份" //非必带
|
||||||
|
@"pageNO":@"当前打印第几页"。 //非必带
|
||||||
|
@"tid":@"写入rfid返回的tid码" //非必带
|
||||||
|
@"carbonUsed":@"碳带使用量,单位毫米" //非必带
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
+ (void)getPrintingCountInfo:(PRINT_DIC_INFO)count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi异常接收(连接成功后调用)。
|
||||||
|
|
||||||
|
@param error 打印异常:1:盒盖打开,
|
||||||
|
2:缺纸,
|
||||||
|
3:电量不足,
|
||||||
|
4:电池异常,
|
||||||
|
5:手动停止,
|
||||||
|
6:数据错误,
|
||||||
|
(提交打印数据失败-B3/图像生成失败/发送数据错误,打印机校验不通过打印机返回)
|
||||||
|
7:温度过高,
|
||||||
|
8:出纸异常,
|
||||||
|
9-打印忙碌(当前正在转动马达(正在打印中或者走纸)/打印机正在升级固件)
|
||||||
|
10-没有检测到打印头
|
||||||
|
11-环境温度过低
|
||||||
|
12.打印头未锁紧
|
||||||
|
13-未检测到碳带
|
||||||
|
14-不匹配的碳带
|
||||||
|
15-用完的碳带
|
||||||
|
16-不支持的纸张类型
|
||||||
|
17-设置纸张失败
|
||||||
|
18-设置打印模式失败
|
||||||
|
19-设置打印浓度失败(允许打印,仅上报异常)
|
||||||
|
20-写入Rfid失败
|
||||||
|
21-边距设置错误
|
||||||
|
(边距必须大于0,上边距+下边距必须小于画板高度,左边距+右边距必须小于画板宽度)
|
||||||
|
22-通讯异常(超时,打印机指令一直拒绝)
|
||||||
|
23-打印机断开
|
||||||
|
24-画板参数设置错误
|
||||||
|
25-旋转角度参数错误
|
||||||
|
26-json参数错误(pc)
|
||||||
|
27-出纸异常(关闭上盖检测)
|
||||||
|
28-检查纸张类型
|
||||||
|
29-RFID标签进行非RFID模式打印时
|
||||||
|
30-浓度设置不支持
|
||||||
|
31-不支持的打印模式
|
||||||
|
32-标签材质设置失败(材质设置超时或者失败,不阻断正常打印)
|
||||||
|
33-不支持的标签材质设置(阻断正常打印)
|
||||||
|
34-打印机异常(阻断正常打印)
|
||||||
|
35-切刀异常(T2阻断正常打印)
|
||||||
|
36-缺纸(T2未放纸)
|
||||||
|
37-打印机异常(T2无法通过指令恢复,需要手动按打印机)
|
||||||
|
*/
|
||||||
|
+ (void)getPrintingErrorInfo:(PRINT_INFO)error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi像素转毫米(会对像素进行处理)。
|
||||||
|
|
||||||
|
@param pixel 像素
|
||||||
|
@return 绘制参数
|
||||||
|
*/
|
||||||
|
+ (CGFloat)pixelToMm:(CGFloat)pixel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi毫米转像素(会对毫米进行处理)。
|
||||||
|
|
||||||
|
@param mm 毫米
|
||||||
|
@return 绘制参数
|
||||||
|
*/
|
||||||
|
+ (CGFloat)mmToPixel:(CGFloat)mm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
蓝牙/Wi-Fi打印机分辨率
|
||||||
|
|
||||||
|
@return 返回对应的打印机分辨率(连接打印机后有效)
|
||||||
|
*/
|
||||||
|
+ (NSInteger)printerResolution;
|
||||||
|
+ (float)printerMulityDpiToMm;
|
||||||
|
|
||||||
|
/// 设置字体路径
|
||||||
|
/// @param fontFamilyPath 路径
|
||||||
|
+(void) initImageProcessing:(NSString *) fontFamilyPath error:(NSError **)error;
|
||||||
|
|
||||||
|
/// 准备打印
|
||||||
|
/// @param blackRules 设置浓度
|
||||||
|
/// @param paperStyle 设置纸张
|
||||||
|
/// @param completion 回调
|
||||||
|
+ (void)startJob:(int)blackRules
|
||||||
|
withPaperStyle:(int)paperStyle
|
||||||
|
withCompletion:(DidPrinted_Block)completion;
|
||||||
|
|
||||||
|
|
||||||
|
/// 图像二期毫米转像素
|
||||||
|
/// @param mm 毫米
|
||||||
|
/// @param scaler 倍率
|
||||||
|
+ (int) mmToPixel:(float)mm scaler:(float)scaler;
|
||||||
|
|
||||||
|
/// 图像二期像素转毫米
|
||||||
|
/// @param pixel 像素
|
||||||
|
/// @param scaler 倍率
|
||||||
|
+ (float) pixelToMm:(int)pixel scaler:(float)scaler;
|
||||||
|
|
||||||
|
/// 获取倍率
|
||||||
|
/// @param templatePhysical 屏幕物理尺寸
|
||||||
|
/// @param screenDisplaySize 屏幕分辨率
|
||||||
|
+ (float)getDisplayMultiple:(float)templatePhysical templateDisplayWidth:(int)screenDisplaySize;
|
||||||
|
|
||||||
|
|
||||||
|
/// 毫米转英寸
|
||||||
|
/// @param mm 毫米
|
||||||
|
+(float) mmToInch:(float) mm;
|
||||||
|
|
||||||
|
/// 英寸转毫米
|
||||||
|
/// @param inch 英寸
|
||||||
|
+(float) inchToMm:(float) inch;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
+(void)didReadSDKCacheStatus:(JCSDKCACHE_STATE)status;
|
||||||
|
|
||||||
|
+(void)setPrintWithCache:(BOOL)startCache;
|
||||||
|
|
||||||
|
|
||||||
|
/// 是否支持RFID写入功能
|
||||||
|
+(BOOL)isSupportWriteRFID;
|
||||||
|
|
||||||
|
|
||||||
|
/// 绘制画板
|
||||||
|
/// @param width 宽
|
||||||
|
/// @param height 高
|
||||||
|
/// @param horizontalShift 水平偏移
|
||||||
|
/// @param verticalShift 竖直偏移
|
||||||
|
/// @param rotate 旋转角度
|
||||||
|
/// @param font 使用字体路径,缺省输入nil
|
||||||
|
+(void)initDrawingBoard:(float)width
|
||||||
|
withHeight:(float)height
|
||||||
|
withHorizontalShift:(float)horizontalShift
|
||||||
|
withVerticalShift:(float)verticalShift
|
||||||
|
rotate:(int) rotate
|
||||||
|
font:(NSString*)font;
|
||||||
|
|
||||||
|
|
||||||
|
/// 绘制文本
|
||||||
|
/// @param x 水平起点
|
||||||
|
/// @param y 竖直起点
|
||||||
|
/// @param w 宽
|
||||||
|
/// @param h 高
|
||||||
|
/// @param text 内容
|
||||||
|
/// @param fontFamily 字体
|
||||||
|
/// @param fontSize 字体大小
|
||||||
|
/// @param rotate 旋转
|
||||||
|
/// @param textAlignHorizonral 文本水平对齐方式 0:左对齐 1:居中对齐 2:右对齐
|
||||||
|
/// @param textAlignVertical 文本竖直对齐方式 0:顶对齐 1:垂直居中 2:底对齐
|
||||||
|
/// @param lineMode 换行方式
|
||||||
|
/// @param letterSpacing 字体间隔
|
||||||
|
/// @param lineSpacing 行间隔
|
||||||
|
/// @param fontStyles [@1,@1,@1,@1] 斜体,加粗,下划线,删除下划线
|
||||||
|
+(BOOL)drawLableText:(float)x
|
||||||
|
withY:(float)y
|
||||||
|
withWidth:(float)w
|
||||||
|
withHeight:(float)h
|
||||||
|
withString:(NSString *)text
|
||||||
|
withFontFamily:(NSString *)fontFamily
|
||||||
|
withFontSize:(float)fontSize
|
||||||
|
withRotate:(int)rotate
|
||||||
|
withTextAlignHorizonral:(int)textAlignHorizonral
|
||||||
|
withTextAlignVertical:(int)textAlignVertical
|
||||||
|
withLineMode:(int)lineMode
|
||||||
|
withLetterSpacing:(float)letterSpacing
|
||||||
|
withLineSpacing:(float)lineSpacing
|
||||||
|
withFontStyle:(NSArray <NSNumber *>*)fontStyles;
|
||||||
|
|
||||||
|
|
||||||
|
/// 绘制条码
|
||||||
|
/// @param x 水平坐标
|
||||||
|
/// @param y 垂直坐标
|
||||||
|
/// @param w 标贴宽度,单位mm
|
||||||
|
/// @param h 标贴高度,单位mm
|
||||||
|
/// @param text 文本内容
|
||||||
|
/// @param fontSize 文本字号
|
||||||
|
/// @param rotate 旋转角度,仅支持0,90,180,270
|
||||||
|
/// @param codeType 一维码类型 20:CODE128 21:UPC-A 22:UPC-E 23:EAN8 24:EAN13 25:CODE93 26:CODE39 27:CODEBAR 28:ITF25
|
||||||
|
/// @param textHeight 文本高度
|
||||||
|
/// @param textPosition 文本位置,int 一维码文字识别码显示位置 0:下方显示 1:上方显示 2:不显示
|
||||||
|
+(BOOL)drawLableBarCode:(float)x
|
||||||
|
withY:(float)y
|
||||||
|
withWidth:(float)w
|
||||||
|
withHeight:(float)h
|
||||||
|
withString:(NSString *)text
|
||||||
|
withFontSize:(float)fontSize
|
||||||
|
withRotate:(int)rotate
|
||||||
|
withCodeType:(int)codeType
|
||||||
|
withTextHeight:(float)textHeight
|
||||||
|
withTextPosition:(int)textPosition;
|
||||||
|
|
||||||
|
|
||||||
|
/// 绘制二维码
|
||||||
|
/// @param x 水平坐标
|
||||||
|
/// @param y 垂直坐标
|
||||||
|
/// @param w 标贴宽度,单位mm
|
||||||
|
/// @param h 标贴高度,单位mm
|
||||||
|
/// @param text 文本内容
|
||||||
|
/// @param rotate 旋转角度,仅支持0,90,180,270
|
||||||
|
/// @param codeType 二维码类型 31:QR_CODE 32:PDF417 33:DATA_MATRIX 34:AZTEC
|
||||||
|
+(BOOL)drawLableQrCode:(float)x
|
||||||
|
withY:(float)y
|
||||||
|
withWidth:(float)w
|
||||||
|
withHeight:(float)h
|
||||||
|
withString:(NSString *)text
|
||||||
|
withRotate:(int)rotate
|
||||||
|
withCodeType:(int)codeType;
|
||||||
|
|
||||||
|
|
||||||
|
/// 绘制线条
|
||||||
|
/// @param x 水平坐标
|
||||||
|
/// @param y 垂直坐标
|
||||||
|
/// @param w 标贴宽度,单位mm
|
||||||
|
/// @param h 标贴高度,单位mm
|
||||||
|
/// @param rotate 旋转角度,仅支持0,90,180,270
|
||||||
|
/// @param lineType 线条类型 1:实线 2:虚线类型,虚实比例1:1
|
||||||
|
/// @param dashWidth 线条为虚线宽度,【实线段长度,空线段长度】
|
||||||
|
+(BOOL)DrawLableLine:(float)x
|
||||||
|
withY:(float)y
|
||||||
|
withWidth:(float)w
|
||||||
|
withHeight:(float)h
|
||||||
|
withRotate:(int)rotate
|
||||||
|
withLineType:(int)lineType
|
||||||
|
withDashWidth:(NSArray <NSNumber *>*)dashWidth;
|
||||||
|
|
||||||
|
|
||||||
|
/// 绘制形状
|
||||||
|
/// @param x 水平坐标
|
||||||
|
/// @param y 垂直坐标
|
||||||
|
/// @param w 标贴宽度,单位mm
|
||||||
|
/// @param h 标贴高度,单位mm
|
||||||
|
/// @param lineWidth 线条类型
|
||||||
|
/// @param cornerRadius 图像圆角
|
||||||
|
/// @param rotate 旋转角度,仅支持0,90,180,270
|
||||||
|
/// @param graphType 图形类型
|
||||||
|
/// @param lineType 线条类型 1:实线 2:虚线类型,虚实比例1:1
|
||||||
|
/// @param dashWidth 线条为虚线宽度,【实线段长度,空线段长度】
|
||||||
|
+(BOOL)DrawLableGraph:(float)x
|
||||||
|
withY:(float)y
|
||||||
|
withWidth:(float)w
|
||||||
|
withHeight:(float)h
|
||||||
|
withLineWidth:(float)lineWidth
|
||||||
|
withCornerRadius:(float)cornerRadius
|
||||||
|
withRotate:(int)rotate
|
||||||
|
withGraphType:(int)graphType
|
||||||
|
withLineType:(int)lineType
|
||||||
|
withDashWidth:(NSArray <NSNumber *>*)dashWidth;
|
||||||
|
|
||||||
|
|
||||||
|
/// 绘制图片
|
||||||
|
/// @param x 水平坐标
|
||||||
|
/// @param y 垂直坐标
|
||||||
|
/// @param w 标贴宽度,单位mm
|
||||||
|
/// @param h 标贴高度,单位mm
|
||||||
|
/// @param imageData 图像base64数据
|
||||||
|
/// @param rotate 旋转角度,仅支持0,90,180,270
|
||||||
|
/// @param imageProcessingType 处理算法
|
||||||
|
/// @param imageProcessingValue 阈值
|
||||||
|
+(BOOL)DrawLableImage:(float)x
|
||||||
|
withY:(float)y
|
||||||
|
withWidth:(float)w
|
||||||
|
withHeight:(float)h
|
||||||
|
withImageData:(NSString *)imageData
|
||||||
|
withRotate:(int)rotate
|
||||||
|
withImageProcessingType:(int)imageProcessingType
|
||||||
|
withImageProcessingValue:(float)imageProcessingValue;
|
||||||
|
|
||||||
|
+(NSString *)GenerateLableJson;
|
||||||
|
|
||||||
|
|
||||||
|
/// 获取预览图
|
||||||
|
/// @param displayScale 倍率
|
||||||
|
/// @param error 出错返回的错误码
|
||||||
|
+(UIImage *)generateImagePreviewImage:(float)displayScale error:(NSError **)error;
|
||||||
|
|
||||||
|
|
||||||
|
/// 开始打印
|
||||||
|
/// @param printData 打印数据
|
||||||
|
/// @param onePageNumvers 打印份数
|
||||||
|
/// @param completion 回调
|
||||||
|
+ (void)commit:(NSString *)printData
|
||||||
|
withOnePageNumbers:(int)onePageNumvers
|
||||||
|
withComplete:(DidPrinted_Block)completion;
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark ###################双色打印##################
|
||||||
|
|
||||||
|
/// 是否是双色打印机,需要连接成功之后调用
|
||||||
|
+(int) getPrinterColorType;
|
||||||
|
|
||||||
|
|
||||||
|
/// 准备打印
|
||||||
|
/// @param blackRules 设置浓度
|
||||||
|
/// @param paperStyle 设置纸张
|
||||||
|
/// @param completion 回调
|
||||||
|
+ (void)startJob:(int)blackRules
|
||||||
|
withPaperStyle:(int)paperStyle
|
||||||
|
withColorType:(int)colorType
|
||||||
|
withCompletion:(DidPrinted_Block)completion;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
20
JCPrinterSDK/JCPrinterSDK.h
Normal file
20
JCPrinterSDK/JCPrinterSDK.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
//
|
||||||
|
// JCPrinterSDK.h
|
||||||
|
// JCPrinterSDK
|
||||||
|
//
|
||||||
|
// Created by 歪脖子 on 2023/10/21.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
//! Project version number for JCPrinterSDK.
|
||||||
|
FOUNDATION_EXPORT double JCPrinterSDKVersionNumber;
|
||||||
|
|
||||||
|
//! Project version string for JCPrinterSDK.
|
||||||
|
FOUNDATION_EXPORT const unsigned char JCPrinterSDKVersionString[];
|
||||||
|
|
||||||
|
// In this header, you should import all the public headers of your framework using statements like #import <JCPrinterSDK/PublicHeader.h>
|
||||||
|
|
||||||
|
|
||||||
|
#import <JCPrinterSDK/JCAPI.h>
|
||||||
|
#import <JCPrinterSDK/FWnetworkWIFI.h>
|
571
JCPrinterSDK/Source/JCSDKPringterConfig.json
Normal file
571
JCPrinterSDK/Source/JCSDKPringterConfig.json
Normal file
@ -0,0 +1,571 @@
|
|||||||
|
{
|
||||||
|
0:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
1:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"name":"B3S",
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
2:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"name":"D11",
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
3:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"name":"B21",
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
4:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"name":"P1S",
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
5:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
6:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"name":"D11",
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
7:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"name":"B16",
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
8:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"name":"B32",
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
9:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"name":"D110",
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
},
|
||||||
|
10:{
|
||||||
|
0:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
1:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
2:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
3:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
4:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
5:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
6:"printerImageProcessingInfo": {
|
||||||
|
"margin": [0, 0, 0, 0],
|
||||||
|
"imageCrop": [0, 0, 0, 0],
|
||||||
|
"printMultiple":8,
|
||||||
|
"horizontalOffset": 0,
|
||||||
|
"verticalOffset": 0
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user