react native - zpl - zebra ZT411 - rfid - multiple print


Hi all!
I have a react native app and I have to print multiple tags.
I also need to get all the TagIds provided by this zpl command:
<code>^XA^RFR,H,0,12,2^FN1^FS^HV1,,^FS^XZ</code> (the label is empty, it's just as example to show how I get the tag id)
I used a public <a href="">re… lib</a> to address it
but when I try to print multiple labels with an async loop, it seems that 1 label works , but the next one fails. And it repeat this behaviour.
It seems it loose bluetooth connection.
So, I'm trying your <a href=""… app</a>
I can patch the android code in order to get the tag id value back in the javascript code:
+ byte[] configLabel = getConfigLabel(zebraPrinter, label);
+ byte[] tid = connection.sendAndWaitForResponse(configLabel, 2000, 2000, null);
+ success = true;
+ loading = false;
+ String sTid = new String(tid);
+ Log.d("sTid", sTid);
+ promise.resolve(sTid);
but I can't manage an async loop to print multiple tags.
Is there any ZPL command that could help me to print multiple tags with only one command, and get back all the tag ids?
I found a <a href="">discussion</a&gt; that could be interesting, but I'm doubtful if there can be a better and faster option. Do you have any suggestions?
thanks a lot

Submitted by giorgio@fresco… on May 02, 2022 Permalink

Just to keep notes for the future, I resolved it in this way:
WritableArray resultList = Arguments.createArray();
for (int i=0; i &lt; counter; i++) {
byte[] tid = printerConnection.sendAndWaitForResponse(testLabel, 2000, 2000, null);
String sTid = new String(tid);
Log.d("sTid", sTid);
Counter is a params from js that indicates how many labels I want to print