diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml index c07f021..0b77cda 100644 --- a/.idea/libraries/Dart_SDK.xml +++ b/.idea/libraries/Dart_SDK.xml @@ -1,17 +1,27 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..febb024 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "githubPullRequests.ignoredPullRequestBranches": ["main"] +} diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml index c9e5c01..6cec569 100644 --- a/android/.idea/gradle.xml +++ b/android/.idea/gradle.xml @@ -1,5 +1,6 @@ + diff --git a/android/.idea/modules.xml b/android/.idea/modules.xml index 68dcaf5..dbc6ac7 100644 --- a/android/.idea/modules.xml +++ b/android/.idea/modules.xml @@ -3,6 +3,9 @@ + + + \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index e05184c..0fc500d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'com.tlt.epson_epos' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.7.10' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/libs/ePOS2.jar b/android/libs/ePOS2.jar index b2e906c..a373495 100644 Binary files a/android/libs/ePOS2.jar and b/android/libs/ePOS2.jar differ diff --git a/android/libs/ePOSEasySelect.jar b/android/libs/ePOSEasySelect.jar index f56bb2a..d9d7e0e 100644 Binary files a/android/libs/ePOSEasySelect.jar and b/android/libs/ePOSEasySelect.jar differ diff --git a/android/src/main/jniLibs/arm64-v8a/libepos2.so b/android/src/main/jniLibs/arm64-v8a/libepos2.so index 3ba4b12..60d0782 100644 Binary files a/android/src/main/jniLibs/arm64-v8a/libepos2.so and b/android/src/main/jniLibs/arm64-v8a/libepos2.so differ diff --git a/android/src/main/jniLibs/arm64-v8a/libeposeasyselect.so b/android/src/main/jniLibs/arm64-v8a/libeposeasyselect.so index d5aa39c..64128b9 100644 Binary files a/android/src/main/jniLibs/arm64-v8a/libeposeasyselect.so and b/android/src/main/jniLibs/arm64-v8a/libeposeasyselect.so differ diff --git a/android/src/main/jniLibs/armeabi-v7a/libepos2.so b/android/src/main/jniLibs/armeabi-v7a/libepos2.so index 0008cd3..c0ddfae 100644 Binary files a/android/src/main/jniLibs/armeabi-v7a/libepos2.so and b/android/src/main/jniLibs/armeabi-v7a/libepos2.so differ diff --git a/android/src/main/jniLibs/armeabi-v7a/libeposeasyselect.so b/android/src/main/jniLibs/armeabi-v7a/libeposeasyselect.so index 119e747..cb9785a 100644 Binary files a/android/src/main/jniLibs/armeabi-v7a/libeposeasyselect.so and b/android/src/main/jniLibs/armeabi-v7a/libeposeasyselect.so differ diff --git a/android/src/main/jniLibs/armeabi/libepos2.so b/android/src/main/jniLibs/armeabi/libepos2.so index adcae94..75e9354 100644 Binary files a/android/src/main/jniLibs/armeabi/libepos2.so and b/android/src/main/jniLibs/armeabi/libepos2.so differ diff --git a/android/src/main/jniLibs/armeabi/libeposeasyselect.so b/android/src/main/jniLibs/armeabi/libeposeasyselect.so index e0b6654..9702f72 100644 Binary files a/android/src/main/jniLibs/armeabi/libeposeasyselect.so and b/android/src/main/jniLibs/armeabi/libeposeasyselect.so differ diff --git a/android/src/main/jniLibs/x86/libepos2.so b/android/src/main/jniLibs/x86/libepos2.so new file mode 100644 index 0000000..aad25b4 Binary files /dev/null and b/android/src/main/jniLibs/x86/libepos2.so differ diff --git a/android/src/main/jniLibs/x86/libeposeasyselect.so b/android/src/main/jniLibs/x86/libeposeasyselect.so new file mode 100644 index 0000000..c60a8f2 Binary files /dev/null and b/android/src/main/jniLibs/x86/libeposeasyselect.so differ diff --git a/android/src/main/jniLibs/x86_64/libepos2.so b/android/src/main/jniLibs/x86_64/libepos2.so new file mode 100644 index 0000000..edf0e41 Binary files /dev/null and b/android/src/main/jniLibs/x86_64/libepos2.so differ diff --git a/android/src/main/jniLibs/x86_64/libeposeasyselect.so b/android/src/main/jniLibs/x86_64/libeposeasyselect.so new file mode 100644 index 0000000..33fc71b Binary files /dev/null and b/android/src/main/jniLibs/x86_64/libeposeasyselect.so differ diff --git a/android/src/main/kotlin/com/tlt/epson_epos/EpsonEposPlugin.kt b/android/src/main/kotlin/com/tlt/epson_epos/EpsonEposPlugin.kt index 18246a0..6a40909 100644 --- a/android/src/main/kotlin/com/tlt/epson_epos/EpsonEposPlugin.kt +++ b/android/src/main/kotlin/com/tlt/epson_epos/EpsonEposPlugin.kt @@ -371,6 +371,8 @@ class EpsonEposPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { "Printing $target $series Connection: ${statusInfo?.connection} online: ${statusInfo?.online} cover: ${statusInfo?.coverOpen} Paper: ${statusInfo?.paper} ErrorSt: ${statusInfo?.errorStatus} Battery Level: ${statusInfo?.batteryLevel}" ) mPrinter!!.sendData(Printer.PARAM_DEFAULT) + mPrinter!!.disconnect(); + mPrinter!!.clearCommandBuffer() Log.d(logTag, "Printed $target $series") resp.success = true @@ -395,15 +397,20 @@ class EpsonEposPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { private val mDiscoveryListener = DiscoveryListener { deviceInfo -> Log.d(logTag, "Found: ${deviceInfo?.deviceName}") - if (deviceInfo?.deviceName != null && deviceInfo?.deviceName != "") { - var printer = EpsonEposPrinterInfo(deviceInfo.ipAddress, deviceInfo.bdAddress , deviceInfo.macAddress, deviceInfo.deviceName , deviceInfo.deviceType.toString(), deviceInfo.deviceType.toString() , deviceInfo.target) - var printerIndex = printers.indexOfFirst { e -> e.ipAddress == deviceInfo.ipAddress } - if (printerIndex > -1) { - printers[printerIndex] = printer - } else { - printers.add(printer) - } - } + + //Increase connection support + var printer = EpsonEposPrinterInfo(deviceInfo.ipAddress, deviceInfo.bdAddress , deviceInfo.macAddress, deviceInfo.deviceName , deviceInfo.deviceType.toString(), deviceInfo.deviceType.toString() , deviceInfo.target) + printers.add(printer) + + // if (deviceInfo?.deviceName != null && deviceInfo?.deviceName != "") { + // var printer = EpsonEposPrinterInfo(deviceInfo.ipAddress, deviceInfo.bdAddress , deviceInfo.macAddress, deviceInfo.deviceName , deviceInfo.deviceType.toString(), deviceInfo.deviceType.toString() , deviceInfo.target) + // var printerIndex = printers.indexOfFirst { e -> e.ipAddress == deviceInfo.ipAddress } + // if (printerIndex > -1) { + // printers[printerIndex] = printer + // } else { + // printers.add(printer) + // } + // } } diff --git a/example/pubspec.lock b/example/pubspec.lock index 5597dbd..6442211 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,70 +5,72 @@ packages: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + sha256: "793964beb8e297995714326628881437d4211f10fc8843534bab54129cd896ee" + url: "https://pub.dev" source: hosted version: "3.3.1" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" source: hosted version: "3.0.2" csslib: dependency: transitive description: name: csslib - url: "https://pub.dartlang.org" + sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 + url: "https://pub.dev" source: hosted version: "0.17.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: "486b7bc707424572cdf7bd7e812a0c146de3fd47ecadf070254cc60383f21dd8" + url: "https://pub.dev" source: hosted version: "1.0.3" epson_epos: @@ -77,21 +79,23 @@ packages: path: ".." relative: true source: path - version: "0.0.2" + version: "0.0.3" esc_pos_utils: dependency: "direct main" description: name: esc_pos_utils - url: "https://pub.dartlang.org" + sha256: "8ec0013d7a7f1e790ced6b09b95ce3bf2c6f9468a3e2bc49ece000761d86c6f8" + url: "https://pub.dev" source: hosted version: "1.1.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -106,63 +110,72 @@ packages: dependency: transitive description: name: gbk_codec - url: "https://pub.dartlang.org" + sha256: "3af5311fc9393115e3650ae6023862adf998051a804a08fb804f042724999f61" + url: "https://pub.dev" source: hosted version: "0.4.0" hex: dependency: transitive description: name: hex - url: "https://pub.dartlang.org" + sha256: "4e7cd54e4b59ba026432a6be2dd9d96e4c5205725194997193bf871703b82c4a" + url: "https://pub.dev" source: hosted version: "0.2.0" html: dependency: transitive description: name: html - url: "https://pub.dartlang.org" + sha256: bfef906cbd4e78ef49ae511d9074aebd1d2251482ef601a280973e8b58b51bbf + url: "https://pub.dev" source: hosted version: "0.15.0" image: dependency: transitive description: name: image - url: "https://pub.dartlang.org" + sha256: "9d2c5f73435a70a936d317769ee8e7ef480e37674b9f2bce95ea98969a307855" + url: "https://pub.dev" source: hosted version: "3.2.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.8.3" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: "2ebb289dc4764ec397f5cd3ca9881c6d17196130a7d646ed022a0dd9c2e25a71" + url: "https://pub.dev" source: hosted version: "5.0.0" sky_engine: @@ -174,65 +187,82 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + url: "https://pub.dev" source: hosted - version: "0.4.9" + version: "0.6.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" source: hosted version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "0.1.4-beta" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: ac0e3f4bf00ba2708c33fbabbbe766300e509f8c82dbd4ab6525039813f7e2fb + url: "https://pub.dev" source: hosted version: "6.1.0" sdks: - dart: ">=2.17.5 <3.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=1.20.0" diff --git a/lib/const.dart b/lib/const.dart index 84d4664..cd7390a 100644 --- a/lib/const.dart +++ b/lib/const.dart @@ -50,7 +50,8 @@ final List epsonSeries = [ "TM-T88V-i", "TM-T88VI- iHUB", "TM-T88V-DT", - "TM-T88VI-DT2" + "TM-T88VI-DT2", + "TM-T88VII" ]), EPSONSeries(id: "TM_T90", models: ["TM-T90"]), EPSONSeries(id: "TM_T100", models: ["TM-T100"]), diff --git a/pubspec.lock b/pubspec.lock index c04547f..850d1d1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,51 +5,50 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -64,30 +63,34 @@ packages: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.8.3" sky_engine: dependency: transitive description: flutter @@ -97,51 +100,66 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + url: "https://pub.dev" source: hosted - version: "0.4.9" + version: "0.6.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "0.1.4-beta" sdks: - dart: ">=2.17.5 <3.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=1.20.0" diff --git a/pubspec.yaml b/pubspec.yaml index 9332b66..1d4585f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: epson_epos description: This plugin allows Flutter apps to discover printers and send data to EPSON ePOS. -version: 0.0.2 +version: 0.0.4 repository: https://github.com/ImTung/flutter_epson_epos homepage: https://github.com/ImTung/flutter_epson_epos