|
@@ -13,17 +13,17 @@ import io.flutter.plugin.common.MethodChannel;
|
13
|
13
|
public class ZplPrintHandler {
|
14
|
14
|
|
15
|
15
|
public void handle(@NonNull MethodCall call, @NonNull MethodChannel.Result result) {
|
16
|
|
- printZplOverBluetooth(result);
|
|
16
|
+ printZplOverBluetooth(result, call.argument("zplData"));
|
17
|
17
|
}
|
18
|
18
|
|
19
|
19
|
|
20
|
|
- public void printZplOverBluetooth(@NonNull MethodChannel.Result result) {
|
|
20
|
+ public void printZplOverBluetooth(@NonNull MethodChannel.Result result, String zplData) {
|
21
|
21
|
new Thread(new Runnable() {
|
22
|
22
|
@Override
|
23
|
23
|
public void run() {
|
24
|
24
|
// Log.w("From Native (Android)", "isConnected from zplPrinterHandler " + BluetoothConnectionHolder.connection.isConnected() );
|
25
|
25
|
try {
|
26
|
|
- String zplData = "^XA^PW624^LL800^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^FO20,60^BQ , 60,10 , , , A ^FD 1234ABC.^FS^XZ";
|
|
26
|
+// String zplData = "^XA^PW624^LL800^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^FO20,60^BQ , 60,10 , , , A ^FD 1234ABC.^FS^XZ";
|
27
|
27
|
BluetoothConnectionHolder.connection.write(zplData.getBytes());
|
28
|
28
|
} catch (ConnectionException e) {
|
29
|
29
|
Log.w("From Native (Android)", "something went wrong when sending data to printer");
|