react-native-esc-pos-printer-chunyinli 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/android/build.gradle +93 -0
- package/android/generated/java/com/escposprinter/NativeEscPosPrinterDiscoverySpec.java +125 -0
- package/android/generated/java/com/escposprinter/NativeEscPosPrinterSpec.java +364 -0
- package/android/generated/jni/CMakeLists.txt +28 -0
- package/android/generated/jni/RNEscPosPrinterSpec-generated.cpp +198 -0
- package/android/generated/jni/RNEscPosPrinterSpec.h +39 -0
- package/android/generated/jni/react/renderer/components/RNEscPosPrinterSpec/RNEscPosPrinterSpecJSI-generated.cpp +250 -0
- package/android/generated/jni/react/renderer/components/RNEscPosPrinterSpec/RNEscPosPrinterSpecJSI.h +366 -0
- package/android/gradle.properties +5 -0
- package/android/libs/ePOS2.jar +0 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/reactnativeescposprinter/EposStringHelper.java +429 -0
- package/android/src/main/java/com/reactnativeescposprinter/EscPosPrinterDiscoveryModule.java +260 -0
- package/android/src/main/java/com/reactnativeescposprinter/EscPosPrinterModule.java +430 -0
- package/android/src/main/java/com/reactnativeescposprinter/EscPosPrinterPackage.java +62 -0
- package/android/src/main/java/com/reactnativeescposprinter/ImageManager.java +48 -0
- package/android/src/main/java/com/reactnativeescposprinter/PrinterCallback.java +8 -0
- package/android/src/main/java/com/reactnativeescposprinter/PrinterDelegate.java +13 -0
- package/android/src/main/java/com/reactnativeescposprinter/ThePrinter.java +426 -0
- package/android/src/main/java/com/reactnativeescposprinter/ThePrinterManager.java +41 -0
- package/android/src/main/jniLibs/arm64-v8a/libepos2.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libepos2.so +0 -0
- package/android/src/main/jniLibs/x86/libepos2.so +0 -0
- package/android/src/main/jniLibs/x86_64/libepos2.so +0 -0
- package/android/src/oldarch/java/com/reactnativeescposprinter/NativeEscPosPrinterDiscoverySpec.java +124 -0
- package/android/src/oldarch/java/com/reactnativeescposprinter/NativeEscPosPrinterSpec.java +363 -0
- package/ios/EposStringHelper.h +13 -0
- package/ios/EposStringHelper.m +366 -0
- package/ios/EscPosPrinter.h +22 -0
- package/ios/EscPosPrinter.mm +545 -0
- package/ios/EscPosPrinter.xcodeproj/project.pbxproj +345 -0
- package/ios/EscPosPrinterDiscovery.h +17 -0
- package/ios/EscPosPrinterDiscovery.mm +134 -0
- package/ios/ImageManager.h +9 -0
- package/ios/ImageManager.m +52 -0
- package/ios/PrinterSDK/libepos2.xcframework/Headers/ePOS2.h +1808 -0
- package/ios/PrinterSDK/libepos2.xcframework/Info.plist +48 -0
- package/ios/PrinterSDK/libepos2.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/PrinterSDK/libepos2.xcframework/_CodeSignature/CodeRequirements +0 -0
- package/ios/PrinterSDK/libepos2.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/PrinterSDK/libepos2.xcframework/_CodeSignature/CodeResources +158 -0
- package/ios/PrinterSDK/libepos2.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/PrinterSDK/libepos2.xcframework/ios-arm64/libepos2.a +0 -0
- package/ios/PrinterSDK/libepos2.xcframework/ios-arm64_x86_64-simulator/libepos2.a +0 -0
- package/ios/ThePrinter.h +151 -0
- package/ios/ThePrinter.m +578 -0
- package/ios/ThePrinterManager.h +17 -0
- package/ios/ThePrinterManager.m +70 -0
- package/ios/generated/RNEscPosPrinterSpec/RNEscPosPrinterSpec-generated.mm +255 -0
- package/ios/generated/RNEscPosPrinterSpec/RNEscPosPrinterSpec.h +1000 -0
- package/ios/generated/RNEscPosPrinterSpecJSI-generated.cpp +250 -0
- package/ios/generated/RNEscPosPrinterSpecJSI.h +366 -0
- package/lib/module/core/errors/PrinterDiscoveryError.js +15 -0
- package/lib/module/core/errors/PrinterDiscoveryError.js.map +1 -0
- package/lib/module/core/errors/PrinterError.js +15 -0
- package/lib/module/core/errors/PrinterError.js.map +1 -0
- package/lib/module/core/errors/index.js +5 -0
- package/lib/module/core/errors/index.js.map +1 -0
- package/lib/module/core/index.js +5 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/core/utils/constants.js +10 -0
- package/lib/module/core/utils/constants.js.map +1 -0
- package/lib/module/core/utils/index.js +5 -0
- package/lib/module/core/utils/index.js.map +1 -0
- package/lib/module/core/utils/permissions.js +62 -0
- package/lib/module/core/utils/permissions.js.map +1 -0
- package/lib/module/discovery/PrintersDiscovery.js +114 -0
- package/lib/module/discovery/PrintersDiscovery.js.map +1 -0
- package/lib/module/discovery/constants.js +86 -0
- package/lib/module/discovery/constants.js.map +1 -0
- package/lib/module/discovery/hooks/index.js +4 -0
- package/lib/module/discovery/hooks/index.js.map +1 -0
- package/lib/module/discovery/hooks/usePrintersDiscovery.js +56 -0
- package/lib/module/discovery/hooks/usePrintersDiscovery.js.map +1 -0
- package/lib/module/discovery/index.js +7 -0
- package/lib/module/discovery/index.js.map +1 -0
- package/lib/module/discovery/types.js +4 -0
- package/lib/module/discovery/types.js.map +1 -0
- package/lib/module/discovery/utils/errors.js +20 -0
- package/lib/module/discovery/utils/errors.js.map +1 -0
- package/lib/module/discovery/utils/index.js +4 -0
- package/lib/module/discovery/utils/index.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/printer/Printer.js +106 -0
- package/lib/module/printer/Printer.js.map +1 -0
- package/lib/module/printer/PrinterWrapper.js +316 -0
- package/lib/module/printer/PrinterWrapper.js.map +1 -0
- package/lib/module/printer/constants/enums/barcode.js +32 -0
- package/lib/module/printer/constants/enums/barcode.js.map +1 -0
- package/lib/module/printer/constants/enums/common.js +93 -0
- package/lib/module/printer/constants/enums/common.js.map +1 -0
- package/lib/module/printer/constants/enums/image.js +23 -0
- package/lib/module/printer/constants/enums/image.js.map +1 -0
- package/lib/module/printer/constants/enums/index.js +43 -0
- package/lib/module/printer/constants/enums/index.js.map +1 -0
- package/lib/module/printer/constants/enums/pulse.js +18 -0
- package/lib/module/printer/constants/enums/pulse.js.map +1 -0
- package/lib/module/printer/constants/enums/settings.js +56 -0
- package/lib/module/printer/constants/enums/settings.js.map +1 -0
- package/lib/module/printer/constants/enums/status.js +63 -0
- package/lib/module/printer/constants/enums/status.js.map +1 -0
- package/lib/module/printer/constants/enums/symbol.js +43 -0
- package/lib/module/printer/constants/enums/symbol.js.map +1 -0
- package/lib/module/printer/constants/enums/textStyle.js +19 -0
- package/lib/module/printer/constants/enums/textStyle.js.map +1 -0
- package/lib/module/printer/constants/index.js +7 -0
- package/lib/module/printer/constants/index.js.map +1 -0
- package/lib/module/printer/constants/layout.js +5 -0
- package/lib/module/printer/constants/layout.js.map +1 -0
- package/lib/module/printer/constants/valuesToKeysMappers.js +96 -0
- package/lib/module/printer/constants/valuesToKeysMappers.js.map +1 -0
- package/lib/module/printer/constants/valuesToMessagesMappers.js +200 -0
- package/lib/module/printer/constants/valuesToMessagesMappers.js.map +1 -0
- package/lib/module/printer/index.js +6 -0
- package/lib/module/printer/index.js.map +1 -0
- package/lib/module/printer/printHelpers/addTextLine.js +14 -0
- package/lib/module/printer/printHelpers/addTextLine.js.map +1 -0
- package/lib/module/printer/printHelpers/addViewShot.js +35 -0
- package/lib/module/printer/printHelpers/addViewShot.js.map +1 -0
- package/lib/module/printer/printHelpers/index.js +7 -0
- package/lib/module/printer/printHelpers/index.js.map +1 -0
- package/lib/module/printer/printHelpers/monitorPrinter.js +30 -0
- package/lib/module/printer/printHelpers/monitorPrinter.js.map +1 -0
- package/lib/module/printer/printHelpers/tryToConnectUntil.js +15 -0
- package/lib/module/printer/printHelpers/tryToConnectUntil.js.map +1 -0
- package/lib/module/printer/types.js +4 -0
- package/lib/module/printer/types.js.map +1 -0
- package/lib/module/printer/utils/BufferHelper.js +44 -0
- package/lib/module/printer/utils/BufferHelper.js.map +1 -0
- package/lib/module/printer/utils/errors.js +37 -0
- package/lib/module/printer/utils/errors.js.map +1 -0
- package/lib/module/printer/utils/index.js +7 -0
- package/lib/module/printer/utils/index.js.map +1 -0
- package/lib/module/printer/utils/layout/getFontACharsPerLine.js +97 -0
- package/lib/module/printer/utils/layout/getFontACharsPerLine.js.map +1 -0
- package/lib/module/printer/utils/layout/index.js +5 -0
- package/lib/module/printer/utils/layout/index.js.map +1 -0
- package/lib/module/printer/utils/layout/spaceBetween.js +63 -0
- package/lib/module/printer/utils/layout/spaceBetween.js.map +1 -0
- package/lib/module/printer/utils/parsers/index.js +5 -0
- package/lib/module/printer/utils/parsers/index.js.map +1 -0
- package/lib/module/printer/utils/parsers/parsePrinterSettings.js +17 -0
- package/lib/module/printer/utils/parsers/parsePrinterSettings.js.map +1 -0
- package/lib/module/printer/utils/parsers/parsePrinterStatus.js +17 -0
- package/lib/module/printer/utils/parsers/parsePrinterStatus.js.map +1 -0
- package/lib/module/specs/NativeEscPosPrinter.js +5 -0
- package/lib/module/specs/NativeEscPosPrinter.js.map +1 -0
- package/lib/module/specs/NativeEscPosPrinterDiscovery.js +5 -0
- package/lib/module/specs/NativeEscPosPrinterDiscovery.js.map +1 -0
- package/lib/module/specs/index.js +33 -0
- package/lib/module/specs/index.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/core/errors/PrinterDiscoveryError.d.ts +13 -0
- package/lib/typescript/src/core/errors/PrinterDiscoveryError.d.ts.map +1 -0
- package/lib/typescript/src/core/errors/PrinterError.d.ts +13 -0
- package/lib/typescript/src/core/errors/PrinterError.d.ts.map +1 -0
- package/lib/typescript/src/core/errors/index.d.ts +3 -0
- package/lib/typescript/src/core/errors/index.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +3 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -0
- package/lib/typescript/src/core/utils/constants.d.ts +2 -0
- package/lib/typescript/src/core/utils/constants.d.ts.map +1 -0
- package/lib/typescript/src/core/utils/index.d.ts +3 -0
- package/lib/typescript/src/core/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/core/utils/permissions.d.ts +3 -0
- package/lib/typescript/src/core/utils/permissions.d.ts.map +1 -0
- package/lib/typescript/src/discovery/PrintersDiscovery.d.ts +22 -0
- package/lib/typescript/src/discovery/PrintersDiscovery.d.ts.map +1 -0
- package/lib/typescript/src/discovery/constants.d.ts +90 -0
- package/lib/typescript/src/discovery/constants.d.ts.map +1 -0
- package/lib/typescript/src/discovery/hooks/index.d.ts +2 -0
- package/lib/typescript/src/discovery/hooks/index.d.ts.map +1 -0
- package/lib/typescript/src/discovery/hooks/usePrintersDiscovery.d.ts +11 -0
- package/lib/typescript/src/discovery/hooks/usePrintersDiscovery.d.ts.map +1 -0
- package/lib/typescript/src/discovery/index.d.ts +5 -0
- package/lib/typescript/src/discovery/index.d.ts.map +1 -0
- package/lib/typescript/src/discovery/types.d.ts +69 -0
- package/lib/typescript/src/discovery/types.d.ts.map +1 -0
- package/lib/typescript/src/discovery/utils/errors.d.ts +9 -0
- package/lib/typescript/src/discovery/utils/errors.d.ts.map +1 -0
- package/lib/typescript/src/discovery/utils/index.d.ts +2 -0
- package/lib/typescript/src/discovery/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/Printer.d.ts +40 -0
- package/lib/typescript/src/printer/Printer.d.ts.map +1 -0
- package/lib/typescript/src/printer/PrinterWrapper.d.ts +36 -0
- package/lib/typescript/src/printer/PrinterWrapper.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/barcode.d.ts +26 -0
- package/lib/typescript/src/printer/constants/enums/barcode.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/common.d.ts +82 -0
- package/lib/typescript/src/printer/constants/enums/common.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/image.d.ts +16 -0
- package/lib/typescript/src/printer/constants/enums/image.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/index.d.ts +190 -0
- package/lib/typescript/src/printer/constants/enums/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/pulse.d.ts +12 -0
- package/lib/typescript/src/printer/constants/enums/pulse.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/settings.d.ts +48 -0
- package/lib/typescript/src/printer/constants/enums/settings.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/status.d.ts +50 -0
- package/lib/typescript/src/printer/constants/enums/status.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/symbol.d.ts +37 -0
- package/lib/typescript/src/printer/constants/enums/symbol.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/enums/textStyle.d.ts +13 -0
- package/lib/typescript/src/printer/constants/enums/textStyle.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/index.d.ts +5 -0
- package/lib/typescript/src/printer/constants/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/layout.d.ts +3 -0
- package/lib/typescript/src/printer/constants/layout.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/valuesToKeysMappers.d.ts +6 -0
- package/lib/typescript/src/printer/constants/valuesToKeysMappers.d.ts.map +1 -0
- package/lib/typescript/src/printer/constants/valuesToMessagesMappers.d.ts +112 -0
- package/lib/typescript/src/printer/constants/valuesToMessagesMappers.d.ts.map +1 -0
- package/lib/typescript/src/printer/index.d.ts +4 -0
- package/lib/typescript/src/printer/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/printHelpers/addTextLine.d.ts +4 -0
- package/lib/typescript/src/printer/printHelpers/addTextLine.d.ts.map +1 -0
- package/lib/typescript/src/printer/printHelpers/addViewShot.d.ts +4 -0
- package/lib/typescript/src/printer/printHelpers/addViewShot.d.ts.map +1 -0
- package/lib/typescript/src/printer/printHelpers/index.d.ts +5 -0
- package/lib/typescript/src/printer/printHelpers/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/printHelpers/monitorPrinter.d.ts +4 -0
- package/lib/typescript/src/printer/printHelpers/monitorPrinter.d.ts.map +1 -0
- package/lib/typescript/src/printer/printHelpers/tryToConnectUntil.d.ts +4 -0
- package/lib/typescript/src/printer/printHelpers/tryToConnectUntil.d.ts.map +1 -0
- package/lib/typescript/src/printer/types.d.ts +97 -0
- package/lib/typescript/src/printer/types.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/BufferHelper.d.ts +14 -0
- package/lib/typescript/src/printer/utils/BufferHelper.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/errors.d.ts +10 -0
- package/lib/typescript/src/printer/utils/errors.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/index.d.ts +5 -0
- package/lib/typescript/src/printer/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/layout/getFontACharsPerLine.d.ts +14 -0
- package/lib/typescript/src/printer/utils/layout/getFontACharsPerLine.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/layout/index.d.ts +3 -0
- package/lib/typescript/src/printer/utils/layout/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/layout/spaceBetween.d.ts +3 -0
- package/lib/typescript/src/printer/utils/layout/spaceBetween.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/parsers/index.d.ts +3 -0
- package/lib/typescript/src/printer/utils/parsers/index.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/parsers/parsePrinterSettings.d.ts +3 -0
- package/lib/typescript/src/printer/utils/parsers/parsePrinterSettings.d.ts.map +1 -0
- package/lib/typescript/src/printer/utils/parsers/parsePrinterStatus.d.ts +3 -0
- package/lib/typescript/src/printer/utils/parsers/parsePrinterStatus.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeEscPosPrinter.d.ts +243 -0
- package/lib/typescript/src/specs/NativeEscPosPrinter.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeEscPosPrinterDiscovery.d.ts +46 -0
- package/lib/typescript/src/specs/NativeEscPosPrinterDiscovery.d.ts.map +1 -0
- package/lib/typescript/src/specs/index.d.ts +6 -0
- package/lib/typescript/src/specs/index.d.ts.map +1 -0
- package/package.json +181 -0
- package/react-native-esc-pos-printer.podspec +24 -0
- package/react-native.config.js +12 -0
- package/scripts/movelib.js +66 -0
- package/src/core/errors/PrinterDiscoveryError.ts +14 -0
- package/src/core/errors/PrinterError.ts +14 -0
- package/src/core/errors/index.ts +2 -0
- package/src/core/index.ts +2 -0
- package/src/core/utils/constants.ts +12 -0
- package/src/core/utils/index.ts +2 -0
- package/src/core/utils/permissions.ts +92 -0
- package/src/discovery/PrintersDiscovery.tsx +166 -0
- package/src/discovery/constants.ts +101 -0
- package/src/discovery/hooks/index.ts +1 -0
- package/src/discovery/hooks/usePrintersDiscovery.ts +69 -0
- package/src/discovery/index.ts +4 -0
- package/src/discovery/types.ts +79 -0
- package/src/discovery/utils/errors.ts +37 -0
- package/src/discovery/utils/index.ts +1 -0
- package/src/index.tsx +2 -0
- package/src/printer/Printer.ts +158 -0
- package/src/printer/PrinterWrapper.ts +422 -0
- package/src/printer/constants/enums/barcode.ts +30 -0
- package/src/printer/constants/enums/common.ts +90 -0
- package/src/printer/constants/enums/image.ts +21 -0
- package/src/printer/constants/enums/index.ts +104 -0
- package/src/printer/constants/enums/pulse.ts +16 -0
- package/src/printer/constants/enums/settings.ts +54 -0
- package/src/printer/constants/enums/status.ts +61 -0
- package/src/printer/constants/enums/symbol.ts +41 -0
- package/src/printer/constants/enums/textStyle.ts +17 -0
- package/src/printer/constants/index.ts +4 -0
- package/src/printer/constants/layout.ts +3 -0
- package/src/printer/constants/valuesToKeysMappers.ts +179 -0
- package/src/printer/constants/valuesToMessagesMappers.ts +277 -0
- package/src/printer/index.ts +3 -0
- package/src/printer/printHelpers/addTextLine.ts +26 -0
- package/src/printer/printHelpers/addViewShot.ts +42 -0
- package/src/printer/printHelpers/index.ts +4 -0
- package/src/printer/printHelpers/monitorPrinter.ts +41 -0
- package/src/printer/printHelpers/tryToConnectUntil.ts +20 -0
- package/src/printer/types.ts +152 -0
- package/src/printer/utils/BufferHelper.ts +52 -0
- package/src/printer/utils/errors.ts +48 -0
- package/src/printer/utils/index.ts +4 -0
- package/src/printer/utils/layout/getFontACharsPerLine.ts +119 -0
- package/src/printer/utils/layout/index.ts +2 -0
- package/src/printer/utils/layout/spaceBetween.ts +96 -0
- package/src/printer/utils/parsers/index.ts +2 -0
- package/src/printer/utils/parsers/parsePrinterSettings.ts +30 -0
- package/src/printer/utils/parsers/parsePrinterStatus.ts +20 -0
- package/src/specs/NativeEscPosPrinter.ts +284 -0
- package/src/specs/NativeEscPosPrinterDiscovery.ts +48 -0
- package/src/specs/index.ts +48 -0
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
package com.escposprinter;
|
|
2
|
+
|
|
3
|
+
import com.epson.epos2.printer.Printer;
|
|
4
|
+
import com.epson.epos2.printer.PrinterStatusInfo;
|
|
5
|
+
import com.epson.epos2.Epos2CallbackCode;
|
|
6
|
+
import com.epson.epos2.Epos2Exception;
|
|
7
|
+
import com.epson.epos2.discovery.Discovery;
|
|
8
|
+
|
|
9
|
+
import org.json.JSONException;
|
|
10
|
+
import org.json.JSONObject;
|
|
11
|
+
|
|
12
|
+
import com.facebook.react.bridge.Arguments;
|
|
13
|
+
import com.facebook.react.bridge.WritableMap;
|
|
14
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
15
|
+
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
16
|
+
|
|
17
|
+
import java.util.HashMap;
|
|
18
|
+
import java.util.Map;
|
|
19
|
+
|
|
20
|
+
public class EposStringHelper {
|
|
21
|
+
private static int ERR_INIT = -1;
|
|
22
|
+
private static int CONSTANT_NOT_SUPPORTED_FOR_PLATFORM = -404;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
public static WritableMap convertStatusInfoToWritableMap(PrinterStatusInfo statusInfo) {
|
|
27
|
+
WritableMap statusMessage = Arguments.createMap();
|
|
28
|
+
|
|
29
|
+
statusMessage.putInt("connection",statusInfo.getConnection());
|
|
30
|
+
statusMessage.putInt("online",statusInfo.getOnline());
|
|
31
|
+
statusMessage.putInt("coverOpen",statusInfo.getCoverOpen());
|
|
32
|
+
statusMessage.putInt("paper",statusInfo.getPaper());
|
|
33
|
+
statusMessage.putInt("paperFeed",statusInfo.getPaperFeed());
|
|
34
|
+
statusMessage.putInt("panelSwitch",statusInfo.getPanelSwitch());
|
|
35
|
+
statusMessage.putInt("drawer",statusInfo.getDrawer());
|
|
36
|
+
statusMessage.putInt("errorStatus",statusInfo.getErrorStatus());
|
|
37
|
+
statusMessage.putInt("autoRecoverError",statusInfo.getAutoRecoverError());
|
|
38
|
+
statusMessage.putInt("buzzer",statusInfo.getBuzzer());
|
|
39
|
+
statusMessage.putInt("adapter",statusInfo.getAdapter());
|
|
40
|
+
statusMessage.putInt("batteryLevel", statusInfo.getBatteryLevel());
|
|
41
|
+
statusMessage.putInt("removalWaiting", statusInfo.getRemovalWaiting());
|
|
42
|
+
statusMessage.putInt("paperTakenSensor", statusInfo.getPaperTakenSensor());
|
|
43
|
+
statusMessage.putInt("unrecoverError", statusInfo.getUnrecoverError());
|
|
44
|
+
|
|
45
|
+
return statusMessage;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
public static Map<String, Object> getDiscoveryConstants() {
|
|
50
|
+
final Map<String, Object> constants = new HashMap<>();
|
|
51
|
+
// filter options
|
|
52
|
+
constants.put("PORTTYPE_ALL", Discovery.PORTTYPE_ALL);
|
|
53
|
+
constants.put("PORTTYPE_TCP", Discovery.PORTTYPE_TCP);
|
|
54
|
+
constants.put("PORTTYPE_BLUETOOTH", Discovery.PORTTYPE_BLUETOOTH);
|
|
55
|
+
constants.put("PORTTYPE_USB", Discovery.PORTTYPE_USB);
|
|
56
|
+
constants.put("MODEL_ALL", Discovery.MODEL_ALL);
|
|
57
|
+
constants.put("TYPE_ALL", Discovery.TYPE_ALL);
|
|
58
|
+
constants.put("TYPE_PRINTER", Discovery.TYPE_PRINTER);
|
|
59
|
+
constants.put("TYPE_HYBRID_PRINTER", Discovery.TYPE_HYBRID_PRINTER);
|
|
60
|
+
constants.put("TYPE_DISPLAY", Discovery.TYPE_DISPLAY);
|
|
61
|
+
constants.put("TYPE_KEYBOARD", Discovery.TYPE_KEYBOARD);
|
|
62
|
+
constants.put("TYPE_SCANNER", Discovery.TYPE_SCANNER);
|
|
63
|
+
constants.put("TYPE_SERIAL", Discovery.TYPE_SERIAL);
|
|
64
|
+
constants.put("TYPE_POS_KEYBOARD", Discovery.TYPE_POS_KEYBOARD);
|
|
65
|
+
constants.put("TYPE_MSR", Discovery.TYPE_MSR);
|
|
66
|
+
constants.put("TYPE_GFE", Discovery.TYPE_GFE);
|
|
67
|
+
constants.put("TYPE_OTHER_PERIPHERAL", Discovery.TYPE_OTHER_PERIPHERAL);
|
|
68
|
+
constants.put("FILTER_NAME", Discovery.FILTER_NAME);
|
|
69
|
+
constants.put("FILTER_NONE", Discovery.FILTER_NONE);
|
|
70
|
+
constants.put("PRINTER_TRUE", Discovery.TRUE);
|
|
71
|
+
constants.put("PRINTER_FALSE", Discovery.FALSE);
|
|
72
|
+
// stub constants for cross-platform compatibility (iOS only)
|
|
73
|
+
constants.put("PORTTYPE_BLUETOOTH_LE", CONSTANT_NOT_SUPPORTED_FOR_PLATFORM);
|
|
74
|
+
constants.put("BT_ERR_PARAM", CONSTANT_NOT_SUPPORTED_FOR_PLATFORM);
|
|
75
|
+
constants.put("BT_ERR_UNSUPPORTED", CONSTANT_NOT_SUPPORTED_FOR_PLATFORM);
|
|
76
|
+
constants.put("BT_ERR_CANCEL", CONSTANT_NOT_SUPPORTED_FOR_PLATFORM);
|
|
77
|
+
constants.put("BT_ERR_ILLEGAL_DEVICE", CONSTANT_NOT_SUPPORTED_FOR_PLATFORM);
|
|
78
|
+
// return values
|
|
79
|
+
constants.put("ERR_PARAM", Epos2Exception.ERR_PARAM);
|
|
80
|
+
constants.put("ERR_ILLEGAL", Epos2Exception.ERR_ILLEGAL);
|
|
81
|
+
constants.put("ERR_MEMORY", Epos2Exception.ERR_MEMORY);
|
|
82
|
+
constants.put("ERR_FAILURE", Epos2Exception.ERR_FAILURE);
|
|
83
|
+
constants.put("ERR_PROCESSING", Epos2Exception.ERR_PROCESSING);
|
|
84
|
+
|
|
85
|
+
return constants;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
public static Map<String, Object> getPrinterConstants() {
|
|
90
|
+
final Map<String, Object> constants = new HashMap<>();
|
|
91
|
+
|
|
92
|
+
// init models lang
|
|
93
|
+
constants.put("MODEL_ANK", Printer.MODEL_ANK);
|
|
94
|
+
constants.put("MODEL_CHINESE", Printer.MODEL_CHINESE);
|
|
95
|
+
constants.put("MODEL_TAIWAN", Printer.MODEL_TAIWAN);
|
|
96
|
+
constants.put("MODEL_KOREAN", Printer.MODEL_KOREAN);
|
|
97
|
+
constants.put("MODEL_THAI", Printer.MODEL_THAI);
|
|
98
|
+
constants.put("MODEL_SOUTHASIA", Printer.MODEL_SOUTHASIA);
|
|
99
|
+
|
|
100
|
+
// cut types
|
|
101
|
+
constants.put("CUT_FEED", Printer.CUT_FEED);
|
|
102
|
+
constants.put("CUT_NO_FEED", Printer.CUT_NO_FEED);
|
|
103
|
+
constants.put("CUT_RESERVE", Printer.CUT_RESERVE);
|
|
104
|
+
constants.put("FULL_CUT_FEED", Printer.FULL_CUT_FEED);
|
|
105
|
+
constants.put("FULL_CUT_NO_FEED", Printer.FULL_CUT_NO_FEED);
|
|
106
|
+
constants.put("FULL_CUT_RESERVE", Printer.FULL_CUT_RESERVE);
|
|
107
|
+
constants.put("PARAM_DEFAULT", Printer.PARAM_DEFAULT);
|
|
108
|
+
constants.put("PARAM_UNSPECIFIED", Printer.PARAM_UNSPECIFIED);
|
|
109
|
+
|
|
110
|
+
// errors
|
|
111
|
+
constants.put("ERR_PARAM", Epos2Exception.ERR_PARAM);
|
|
112
|
+
constants.put("ERR_MEMORY", Epos2Exception.ERR_MEMORY);
|
|
113
|
+
constants.put("ERR_UNSUPPORTED", Epos2Exception.ERR_UNSUPPORTED);
|
|
114
|
+
constants.put("ERR_FAILURE", Epos2Exception.ERR_FAILURE);
|
|
115
|
+
constants.put("ERR_PROCESSING", Epos2Exception.ERR_PROCESSING);
|
|
116
|
+
constants.put("ERR_CONNECT", Epos2Exception.ERR_CONNECT);
|
|
117
|
+
constants.put("ERR_TIMEOUT", Epos2Exception.ERR_TIMEOUT);
|
|
118
|
+
constants.put("ERR_ILLEGAL", Epos2Exception.ERR_ILLEGAL);
|
|
119
|
+
constants.put("ERR_NOT_FOUND", Epos2Exception.ERR_NOT_FOUND);
|
|
120
|
+
constants.put("ERR_IN_USE", Epos2Exception.ERR_IN_USE);
|
|
121
|
+
constants.put("ERR_TYPE_INVALID", Epos2Exception.ERR_TYPE_INVALID);
|
|
122
|
+
constants.put("ERR_RECOVERY_FAILURE", Epos2Exception.ERR_RECOVERY_FAILURE);
|
|
123
|
+
constants.put("ERR_DISCONNECT", Epos2Exception.ERR_DISCONNECT);
|
|
124
|
+
constants.put("ERR_INIT", ERR_INIT);
|
|
125
|
+
|
|
126
|
+
// code errors
|
|
127
|
+
|
|
128
|
+
constants.put("CODE_ERR_AUTORECOVER", Epos2CallbackCode.CODE_ERR_AUTORECOVER);
|
|
129
|
+
constants.put("CODE_ERR_COVER_OPEN", Epos2CallbackCode.CODE_ERR_COVER_OPEN);
|
|
130
|
+
constants.put("CODE_ERR_CUTTER", Epos2CallbackCode.CODE_ERR_CUTTER);
|
|
131
|
+
constants.put("CODE_ERR_MECHANICAL", Epos2CallbackCode.CODE_ERR_MECHANICAL);
|
|
132
|
+
constants.put("CODE_ERR_EMPTY", Epos2CallbackCode.CODE_ERR_EMPTY);
|
|
133
|
+
constants.put("CODE_ERR_UNRECOVERABLE", Epos2CallbackCode.CODE_ERR_UNRECOVERABLE);
|
|
134
|
+
constants.put("CODE_ERR_FAILURE", Epos2CallbackCode.CODE_ERR_FAILURE);
|
|
135
|
+
constants.put("CODE_ERR_NOT_FOUND", Epos2CallbackCode.CODE_ERR_NOT_FOUND);
|
|
136
|
+
constants.put("CODE_ERR_SYSTEM", Epos2CallbackCode.CODE_ERR_SYSTEM);
|
|
137
|
+
constants.put("CODE_ERR_PORT", Epos2CallbackCode.CODE_ERR_PORT);
|
|
138
|
+
constants.put("CODE_ERR_TIMEOUT", Epos2CallbackCode.CODE_ERR_TIMEOUT);
|
|
139
|
+
constants.put("CODE_ERR_JOB_NOT_FOUND", Epos2CallbackCode.CODE_ERR_JOB_NOT_FOUND);
|
|
140
|
+
constants.put("CODE_ERR_SPOOLER", Epos2CallbackCode.CODE_ERR_SPOOLER);
|
|
141
|
+
constants.put("CODE_ERR_BATTERY_LOW", Epos2CallbackCode.CODE_ERR_BATTERY_LOW);
|
|
142
|
+
constants.put("CODE_ERR_TOO_MANY_REQUESTS", Epos2CallbackCode.CODE_ERR_TOO_MANY_REQUESTS);
|
|
143
|
+
constants.put("CODE_ERR_REQUEST_ENTITY_TOO_LARGE", Epos2CallbackCode.CODE_ERR_REQUEST_ENTITY_TOO_LARGE);
|
|
144
|
+
constants.put("CODE_ERR_WAIT_REMOVAL", Epos2CallbackCode.CODE_ERR_WAIT_REMOVAL);
|
|
145
|
+
constants.put("CODE_PRINTING", Epos2CallbackCode.CODE_PRINTING);
|
|
146
|
+
constants.put("CODE_ERR_MEMORY", Epos2CallbackCode.CODE_ERR_MEMORY);
|
|
147
|
+
constants.put("CODE_ERR_PROCESSING", Epos2CallbackCode.CODE_ERR_PROCESSING);
|
|
148
|
+
constants.put("CODE_ERR_ILLEGAL", Epos2CallbackCode.CODE_ERR_ILLEGAL);
|
|
149
|
+
constants.put("CODE_ERR_DEVICE_BUSY", Epos2CallbackCode.CODE_ERR_DEVICE_BUSY);
|
|
150
|
+
constants.put("CODE_ERR_PARAM", Epos2CallbackCode.CODE_ERR_PARAM);
|
|
151
|
+
|
|
152
|
+
// get printer settings
|
|
153
|
+
|
|
154
|
+
constants.put("PRINTER_SETTING_PAPERWIDTH", Printer.SETTING_PAPERWIDTH);
|
|
155
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY", Printer.SETTING_PRINTDENSITY);
|
|
156
|
+
constants.put("PRINTER_SETTING_PRINTSPEED", Printer.SETTING_PRINTSPEED);
|
|
157
|
+
|
|
158
|
+
constants.put("PRINTER_SETTING_PAPERWIDTH58_0", Printer.SETTING_PAPERWIDTH_58_0);
|
|
159
|
+
constants.put("PRINTER_SETTING_PAPERWIDTH60_0", Printer.SETTING_PAPERWIDTH_60_0);
|
|
160
|
+
constants.put("PRINTER_SETTING_PAPERWIDTH70_0", Printer.SETTING_PAPERWIDTH_70_0);
|
|
161
|
+
constants.put("PRINTER_SETTING_PAPERWIDTH76_0", Printer.SETTING_PAPERWIDTH_76_0);
|
|
162
|
+
constants.put("PRINTER_SETTING_PAPERWIDTH80_0", Printer.SETTING_PAPERWIDTH_80_0);
|
|
163
|
+
constants.put("PRINTER_SETTING_PRINTDENSITYDIP", Printer.SETTING_PRINTDENSITY_DIP);
|
|
164
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY70", Printer.SETTING_PRINTDENSITY_70);
|
|
165
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY75", Printer.SETTING_PRINTDENSITY_75);
|
|
166
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY80", Printer.SETTING_PRINTDENSITY_80);
|
|
167
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY85", Printer.SETTING_PRINTDENSITY_85);
|
|
168
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY90", Printer.SETTING_PRINTDENSITY_90);
|
|
169
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY95", Printer.SETTING_PRINTDENSITY_95);
|
|
170
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY100", Printer.SETTING_PRINTDENSITY_100);
|
|
171
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY105", Printer.SETTING_PRINTDENSITY_105);
|
|
172
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY110", Printer.SETTING_PRINTDENSITY_110);
|
|
173
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY115", Printer.SETTING_PRINTDENSITY_115);
|
|
174
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY120", Printer.SETTING_PRINTDENSITY_120);
|
|
175
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY125", Printer.SETTING_PRINTDENSITY_125);
|
|
176
|
+
constants.put("PRINTER_SETTING_PRINTDENSITY130", Printer.SETTING_PRINTDENSITY_130);
|
|
177
|
+
constants.put("PRINTER_SETTING_PRINTSPEED1", Printer.SETTING_PRINTSPEED_1);
|
|
178
|
+
constants.put("PRINTER_SETTING_PRINTSPEED2", Printer.SETTING_PRINTSPEED_2);
|
|
179
|
+
constants.put("PRINTER_SETTING_PRINTSPEED3", Printer.SETTING_PRINTSPEED_3);
|
|
180
|
+
constants.put("PRINTER_SETTING_PRINTSPEED4", Printer.SETTING_PRINTSPEED_4);
|
|
181
|
+
constants.put("PRINTER_SETTING_PRINTSPEED5", Printer.SETTING_PRINTSPEED_5);
|
|
182
|
+
constants.put("PRINTER_SETTING_PRINTSPEED6", Printer.SETTING_PRINTSPEED_6);
|
|
183
|
+
constants.put("PRINTER_SETTING_PRINTSPEED7", Printer.SETTING_PRINTSPEED_7);
|
|
184
|
+
constants.put("PRINTER_SETTING_PRINTSPEED8", Printer.SETTING_PRINTSPEED_8);
|
|
185
|
+
constants.put("PRINTER_SETTING_PRINTSPEED9", Printer.SETTING_PRINTSPEED_9);
|
|
186
|
+
constants.put("PRINTER_SETTING_PRINTSPEED10", Printer.SETTING_PRINTSPEED_10);
|
|
187
|
+
constants.put("PRINTER_SETTING_PRINTSPEED11", Printer.SETTING_PRINTSPEED_11);
|
|
188
|
+
constants.put("PRINTER_SETTING_PRINTSPEED12", Printer.SETTING_PRINTSPEED_12);
|
|
189
|
+
constants.put("PRINTER_SETTING_PRINTSPEED13", Printer.SETTING_PRINTSPEED_13);
|
|
190
|
+
constants.put("PRINTER_SETTING_PRINTSPEED14", Printer.SETTING_PRINTSPEED_14);
|
|
191
|
+
constants.put("PRINTER_SETTING_PRINTSPEED15", Printer.SETTING_PRINTSPEED_15);
|
|
192
|
+
constants.put("PRINTER_SETTING_PRINTSPEED16", Printer.SETTING_PRINTSPEED_16);
|
|
193
|
+
constants.put("PRINTER_SETTING_PRINTSPEED17", Printer.SETTING_PRINTSPEED_17);
|
|
194
|
+
|
|
195
|
+
// printer status
|
|
196
|
+
|
|
197
|
+
constants.put("PRINTER_TRUE", Printer.TRUE);
|
|
198
|
+
constants.put("PRINTER_FALSE", Printer.FALSE);
|
|
199
|
+
constants.put("UNKNOWN", Printer.UNKNOWN);
|
|
200
|
+
constants.put("PAPER_OK", Printer.PAPER_OK);
|
|
201
|
+
constants.put("PAPER_NEAR_END", Printer.PAPER_NEAR_END);
|
|
202
|
+
constants.put("PAPER_EMPTY", Printer.PAPER_EMPTY);
|
|
203
|
+
constants.put("SWITCH_ON", Printer.SWITCH_ON);
|
|
204
|
+
constants.put("SWITCH_OFF", Printer.SWITCH_OFF);
|
|
205
|
+
constants.put("DRAWER_HIGH", Printer.DRAWER_HIGH);
|
|
206
|
+
constants.put("DRAWER_LOW", Printer.DRAWER_LOW);
|
|
207
|
+
constants.put("NO_ERR", Printer.NO_ERR);
|
|
208
|
+
constants.put("MECHANICAL_ERR", Printer.MECHANICAL_ERR);
|
|
209
|
+
constants.put("AUTOCUTTER_ERR", Printer.AUTOCUTTER_ERR);
|
|
210
|
+
constants.put("UNRECOVER_ERR", Printer.UNRECOVER_ERR);
|
|
211
|
+
constants.put("AUTORECOVER_ERR", Printer.AUTORECOVER_ERR);
|
|
212
|
+
constants.put("HEAD_OVERHEAT", Printer.HEAD_OVERHEAT);
|
|
213
|
+
constants.put("MOTOR_OVERHEAT", Printer.MOTOR_OVERHEAT);
|
|
214
|
+
constants.put("BATTERY_OVERHEAT", Printer.BATTERY_OVERHEAT);
|
|
215
|
+
constants.put("WRONG_PAPER", Printer.WRONG_PAPER);
|
|
216
|
+
constants.put("COVER_OPEN", Printer.COVER_OPEN);
|
|
217
|
+
constants.put("EPOS2_BATTERY_LEVEL_6", Printer.BATTERY_LEVEL_6);
|
|
218
|
+
constants.put("EPOS2_BATTERY_LEVEL_5", Printer.BATTERY_LEVEL_5);
|
|
219
|
+
constants.put("EPOS2_BATTERY_LEVEL_4", Printer.BATTERY_LEVEL_4);
|
|
220
|
+
constants.put("EPOS2_BATTERY_LEVEL_3", Printer.BATTERY_LEVEL_3);
|
|
221
|
+
constants.put("EPOS2_BATTERY_LEVEL_2", Printer.BATTERY_LEVEL_2);
|
|
222
|
+
constants.put("EPOS2_BATTERY_LEVEL_1", Printer.BATTERY_LEVEL_1);
|
|
223
|
+
constants.put("EPOS2_BATTERY_LEVEL_0", Printer.BATTERY_LEVEL_0);
|
|
224
|
+
constants.put("REMOVAL_WAIT_PAPER", Printer.REMOVAL_WAIT_PAPER);
|
|
225
|
+
constants.put("REMOVAL_WAIT_NONE", Printer.REMOVAL_WAIT_NONE);
|
|
226
|
+
constants.put("REMOVAL_DETECT_PAPER", Printer.REMOVAL_DETECT_PAPER);
|
|
227
|
+
constants.put("REMOVAL_DETECT_PAPER_NONE", Printer.REMOVAL_DETECT_PAPER_NONE);
|
|
228
|
+
constants.put("REMOVAL_DETECT_UNKNOWN", Printer.REMOVAL_DETECT_UNKNOWN);
|
|
229
|
+
constants.put("HIGH_VOLTAGE_ERR", Printer.HIGH_VOLTAGE_ERR);
|
|
230
|
+
constants.put("LOW_VOLTAGE_ERR", Printer.LOW_VOLTAGE_ERR);
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
// image
|
|
234
|
+
constants.put("COLOR_NONE", Printer.COLOR_NONE);
|
|
235
|
+
constants.put("COLOR_1", Printer.COLOR_1);
|
|
236
|
+
constants.put("COLOR_2", Printer.COLOR_2);
|
|
237
|
+
constants.put("COLOR_3", Printer.COLOR_3);
|
|
238
|
+
constants.put("COLOR_4", Printer.COLOR_4);
|
|
239
|
+
constants.put("MODE_MONO", Printer.MODE_MONO);
|
|
240
|
+
constants.put("MODE_GRAY16", Printer.MODE_GRAY16);
|
|
241
|
+
constants.put("MODE_MONO_HIGH_DENSITY", Printer.MODE_MONO_HIGH_DENSITY);
|
|
242
|
+
constants.put("HALFTONE_DITHER", Printer.HALFTONE_DITHER);
|
|
243
|
+
constants.put("HALFTONE_ERROR_DIFFUSION", Printer.HALFTONE_ERROR_DIFFUSION);
|
|
244
|
+
constants.put("HALFTONE_THRESHOLD", Printer.HALFTONE_THRESHOLD);
|
|
245
|
+
constants.put("COMPRESS_DEFLATE", Printer.COMPRESS_DEFLATE);
|
|
246
|
+
constants.put("COMPRESS_NONE", Printer.COMPRESS_NONE);
|
|
247
|
+
constants.put("COMPRESS_AUTO", Printer.COMPRESS_AUTO);
|
|
248
|
+
|
|
249
|
+
// barcode
|
|
250
|
+
constants.put("BARCODE_UPC_A", Printer.BARCODE_UPC_A);
|
|
251
|
+
constants.put("BARCODE_UPC_E", Printer.BARCODE_UPC_E);
|
|
252
|
+
constants.put("BARCODE_EAN13", Printer.BARCODE_EAN13);
|
|
253
|
+
constants.put("BARCODE_JAN13", Printer.BARCODE_JAN13);
|
|
254
|
+
constants.put("BARCODE_EAN8", Printer.BARCODE_EAN8);
|
|
255
|
+
constants.put("BARCODE_JAN8", Printer.BARCODE_JAN8);
|
|
256
|
+
constants.put("BARCODE_CODE39", Printer.BARCODE_CODE39);
|
|
257
|
+
constants.put("BARCODE_ITF", Printer.BARCODE_ITF);
|
|
258
|
+
constants.put("BARCODE_CODABAR", Printer.BARCODE_CODABAR);
|
|
259
|
+
constants.put("BARCODE_CODE93", Printer.BARCODE_CODE93);
|
|
260
|
+
constants.put("BARCODE_CODE128", Printer.BARCODE_CODE128);
|
|
261
|
+
constants.put("BARCODE_CODE128_AUTO", Printer.BARCODE_CODE128_AUTO);
|
|
262
|
+
constants.put("BARCODE_GS1_128", Printer.BARCODE_GS1_128);
|
|
263
|
+
constants.put("BARCODE_GS1_DATABAR_OMNIDIRECTIONAL", Printer.BARCODE_GS1_DATABAR_OMNIDIRECTIONAL);
|
|
264
|
+
constants.put("BARCODE_GS1_DATABAR_TRUNCATED", Printer.BARCODE_GS1_DATABAR_TRUNCATED);
|
|
265
|
+
constants.put("BARCODE_GS1_DATABAR_LIMITED", Printer.BARCODE_GS1_DATABAR_LIMITED);
|
|
266
|
+
constants.put("BARCODE_GS1_DATABAR_EXPANDED", Printer.BARCODE_GS1_DATABAR_EXPANDED);
|
|
267
|
+
constants.put("HRI_NONE", Printer.HRI_NONE);
|
|
268
|
+
constants.put("HRI_ABOVE", Printer.HRI_ABOVE);
|
|
269
|
+
constants.put("HRI_BELOW", Printer.HRI_BELOW);
|
|
270
|
+
constants.put("HRI_BOTH", Printer.HRI_BOTH);
|
|
271
|
+
|
|
272
|
+
// font
|
|
273
|
+
|
|
274
|
+
constants.put("FONT_A", Printer.FONT_A);
|
|
275
|
+
constants.put("FONT_B", Printer.FONT_B);
|
|
276
|
+
constants.put("FONT_C", Printer.FONT_C);
|
|
277
|
+
constants.put("FONT_D", Printer.FONT_D);
|
|
278
|
+
constants.put("FONT_E", Printer.FONT_E);
|
|
279
|
+
|
|
280
|
+
// symbol
|
|
281
|
+
|
|
282
|
+
constants.put("SYMBOL_PDF417_STANDARD", Printer.SYMBOL_PDF417_STANDARD);
|
|
283
|
+
constants.put("SYMBOL_PDF417_TRUNCATED", Printer.SYMBOL_PDF417_TRUNCATED);
|
|
284
|
+
constants.put("SYMBOL_QRCODE_MODEL_1", Printer.SYMBOL_QRCODE_MODEL_1);
|
|
285
|
+
constants.put("SYMBOL_QRCODE_MODEL_2", Printer.SYMBOL_QRCODE_MODEL_2);
|
|
286
|
+
constants.put("SYMBOL_QRCODE_MICRO", Printer.SYMBOL_QRCODE_MICRO);
|
|
287
|
+
constants.put("SYMBOL_MAXICODE_MODE_2", Printer.SYMBOL_MAXICODE_MODE_2);
|
|
288
|
+
constants.put("SYMBOL_MAXICODE_MODE_3", Printer.SYMBOL_MAXICODE_MODE_3);
|
|
289
|
+
constants.put("SYMBOL_MAXICODE_MODE_4", Printer.SYMBOL_MAXICODE_MODE_4);
|
|
290
|
+
constants.put("SYMBOL_MAXICODE_MODE_5", Printer.SYMBOL_MAXICODE_MODE_5);
|
|
291
|
+
constants.put("SYMBOL_MAXICODE_MODE_6", Printer.SYMBOL_MAXICODE_MODE_6);
|
|
292
|
+
constants.put("SYMBOL_GS1_DATABAR_STACKED", Printer.SYMBOL_GS1_DATABAR_STACKED);
|
|
293
|
+
constants.put("SYMBOL_GS1_DATABAR_STACKED_OMNIDIRECTIONAL", Printer.SYMBOL_GS1_DATABAR_STACKED_OMNIDIRECTIONAL);
|
|
294
|
+
constants.put("SYMBOL_GS1_DATABAR_EXPANDED_STACKED", Printer.SYMBOL_GS1_DATABAR_EXPANDED_STACKED);
|
|
295
|
+
constants.put("SYMBOL_AZTECCODE_FULLRANGE", Printer.SYMBOL_AZTECCODE_FULLRANGE);
|
|
296
|
+
constants.put("SYMBOL_AZTECCODE_COMPACT", Printer.SYMBOL_AZTECCODE_COMPACT);
|
|
297
|
+
constants.put("SYMBOL_DATAMATRIX_SQUARE", Printer.SYMBOL_DATAMATRIX_SQUARE);
|
|
298
|
+
constants.put("SYMBOL_DATAMATRIX_RECTANGLE_8", Printer.SYMBOL_DATAMATRIX_RECTANGLE_8);
|
|
299
|
+
constants.put("SYMBOL_DATAMATRIX_RECTANGLE_12", Printer.SYMBOL_DATAMATRIX_RECTANGLE_12);
|
|
300
|
+
constants.put("SYMBOL_DATAMATRIX_RECTANGLE_16", Printer.SYMBOL_DATAMATRIX_RECTANGLE_16);
|
|
301
|
+
constants.put("LEVEL_0", Printer.LEVEL_0);
|
|
302
|
+
constants.put("LEVEL_1", Printer.LEVEL_1);
|
|
303
|
+
constants.put("LEVEL_2", Printer.LEVEL_2);
|
|
304
|
+
constants.put("LEVEL_3", Printer.LEVEL_3);
|
|
305
|
+
constants.put("LEVEL_4", Printer.LEVEL_4);
|
|
306
|
+
constants.put("LEVEL_5", Printer.LEVEL_5);
|
|
307
|
+
constants.put("LEVEL_6", Printer.LEVEL_6);
|
|
308
|
+
constants.put("LEVEL_7", Printer.LEVEL_7);
|
|
309
|
+
constants.put("LEVEL_8", Printer.LEVEL_8);
|
|
310
|
+
constants.put("LEVEL_L", Printer.LEVEL_L);
|
|
311
|
+
constants.put("LEVEL_M", Printer.LEVEL_M);
|
|
312
|
+
constants.put("LEVEL_Q", Printer.LEVEL_Q);
|
|
313
|
+
constants.put("LEVEL_H", Printer.LEVEL_H);
|
|
314
|
+
|
|
315
|
+
// add pulse
|
|
316
|
+
|
|
317
|
+
constants.put("DRAWER_2PIN", Printer.DRAWER_2PIN);
|
|
318
|
+
constants.put("DRAWER_5PIN", Printer.DRAWER_5PIN);
|
|
319
|
+
constants.put("PULSE_100", Printer.PULSE_100);
|
|
320
|
+
constants.put("PULSE_200", Printer.PULSE_200);
|
|
321
|
+
constants.put("PULSE_300", Printer.PULSE_300);
|
|
322
|
+
constants.put("PULSE_400", Printer.PULSE_400);
|
|
323
|
+
constants.put("PULSE_500", Printer.PULSE_500);
|
|
324
|
+
|
|
325
|
+
// text align
|
|
326
|
+
|
|
327
|
+
constants.put("ALIGN_LEFT", Printer.ALIGN_LEFT);
|
|
328
|
+
constants.put("ALIGN_CENTER", Printer.ALIGN_CENTER);
|
|
329
|
+
constants.put("ALIGN_RIGHT", Printer.ALIGN_RIGHT);
|
|
330
|
+
|
|
331
|
+
// lang
|
|
332
|
+
|
|
333
|
+
constants.put("LANG_EN", Printer.LANG_EN);
|
|
334
|
+
constants.put("LANG_JA", Printer.LANG_JA);
|
|
335
|
+
constants.put("LANG_ZH_CN", Printer.LANG_ZH_CN);
|
|
336
|
+
constants.put("LANG_ZH_TW", Printer.LANG_ZH_TW);
|
|
337
|
+
constants.put("LANG_KO", Printer.LANG_KO);
|
|
338
|
+
constants.put("LANG_TH", Printer.LANG_TH);
|
|
339
|
+
constants.put("LANG_VI", Printer.LANG_VI);
|
|
340
|
+
constants.put("LANG_MULTI", Printer.LANG_MULTI);
|
|
341
|
+
|
|
342
|
+
return constants;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
public static int getPrinterSeries(final String deviceName) {
|
|
346
|
+
|
|
347
|
+
if (deviceName == null || deviceName.isEmpty()) return Printer.TM_T88;
|
|
348
|
+
|
|
349
|
+
if (deviceName.startsWith("TM-m10")) return Printer.TM_M10;
|
|
350
|
+
if (deviceName.startsWith("TM-m30")) return Printer.TM_M30;
|
|
351
|
+
if (deviceName.startsWith("TM-m30III")) return Printer.TM_M30III;
|
|
352
|
+
if (deviceName.startsWith("TM-m30II")) return Printer.TM_M30II;
|
|
353
|
+
if (deviceName.startsWith("TM-m50II")) return Printer.TM_M50II;
|
|
354
|
+
if (deviceName.startsWith("TM-m50")) return Printer.TM_M50;
|
|
355
|
+
if (deviceName.startsWith("TM-P20II")) return Printer.TM_P20II;
|
|
356
|
+
if (deviceName.startsWith("TM-P20")) return Printer.TM_P20;
|
|
357
|
+
if (deviceName.startsWith("TM-P60II")) return Printer.TM_P60II;
|
|
358
|
+
if (deviceName.startsWith("TM-P60")) return Printer.TM_P60;
|
|
359
|
+
if (deviceName.startsWith("TM-P80II")) return Printer.TM_P80II;
|
|
360
|
+
if (deviceName.startsWith("TM-P80")) return Printer.TM_P80;
|
|
361
|
+
if (deviceName.startsWith("TM-T20")) return Printer.TM_T20;
|
|
362
|
+
if (deviceName.startsWith("TM-T60")) return Printer.TM_T60;
|
|
363
|
+
if (deviceName.startsWith("TM-T70")) return Printer.TM_T70;
|
|
364
|
+
if (deviceName.startsWith("TM-T81")) return Printer.TM_T81;
|
|
365
|
+
if (deviceName.startsWith("TM-T82")) return Printer.TM_T82;
|
|
366
|
+
if (deviceName.startsWith("TM-T83III")) return Printer.TM_T83III;
|
|
367
|
+
if (deviceName.startsWith("TM-T83")) return Printer.TM_T83;
|
|
368
|
+
if (deviceName.startsWith("TM-T88VII")) return Printer.TM_T88VII;
|
|
369
|
+
if (deviceName.startsWith("TM-T88")) return Printer.TM_T88;
|
|
370
|
+
if (deviceName.startsWith("TM-T90")) return Printer.TM_T90;
|
|
371
|
+
if (deviceName.startsWith("TM-T100")) return Printer.TM_T100;
|
|
372
|
+
if (deviceName.startsWith("TM-U220")) return Printer.TM_U220;
|
|
373
|
+
if (deviceName.startsWith("TM-U330")) return Printer.TM_U330;
|
|
374
|
+
if (deviceName.startsWith("TM-L90LFC")) return Printer.TM_L90LFC;
|
|
375
|
+
if (deviceName.startsWith("TM-L90")) return Printer.TM_L90;
|
|
376
|
+
if (deviceName.startsWith("TM-L100")) return Printer.TM_L100;
|
|
377
|
+
if (deviceName.startsWith("TM-H6000")) return Printer.TM_H6000;
|
|
378
|
+
|
|
379
|
+
return Printer.TM_T88;
|
|
380
|
+
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
public static String convertMapToString(ReadableMap readableMap) {
|
|
385
|
+
try{
|
|
386
|
+
JSONObject object = new JSONObject();
|
|
387
|
+
ReadableMapKeySetIterator iterator = readableMap.keySetIterator();
|
|
388
|
+
while (iterator.hasNextKey()) {
|
|
389
|
+
String key = iterator.nextKey();
|
|
390
|
+
switch (readableMap.getType(key)) {
|
|
391
|
+
case Null:
|
|
392
|
+
object.put(key, JSONObject.NULL);
|
|
393
|
+
break;
|
|
394
|
+
case Boolean:
|
|
395
|
+
object.put(key, readableMap.getBoolean(key));
|
|
396
|
+
break;
|
|
397
|
+
case Number:
|
|
398
|
+
object.put(key, readableMap.getDouble(key));
|
|
399
|
+
break;
|
|
400
|
+
case String:
|
|
401
|
+
object.put(key, readableMap.getString(key));
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return object.toString();
|
|
406
|
+
|
|
407
|
+
} catch(Exception e) {
|
|
408
|
+
return "";
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
public static String getErrorTextData(int data, String type) {
|
|
413
|
+
String stringData = String.valueOf(data);
|
|
414
|
+
if(!type.isEmpty()) {
|
|
415
|
+
WritableMap errorData = Arguments.createMap();
|
|
416
|
+
errorData.putString("data", stringData);
|
|
417
|
+
errorData.putString("type", type);
|
|
418
|
+
|
|
419
|
+
return convertMapToString(errorData);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
return stringData;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
public static int getInitErrorResultCode() {
|
|
427
|
+
return ERR_INIT;
|
|
428
|
+
}
|
|
429
|
+
}
|