quiet/org.quietmodem.Quiet

Complete string is not received at once

Sumit-Chakole opened this issue · 2 comments

I am sending 40 characters long string from webapp (queitjs) to android app (quiet android sdk). However I am receiving this string in parts of 32 and 8 characters. I have used code as stated in samples as below-

transmit.transmit(Quiet.str2ab(cryptogram));

final byte[] buf = new byte[BUFFER_SIZE];
private static final int TIEMOUT = 30;
private static final int BUFFER_SIZE = 1024;

while (keepListening) {
                    long recvLen = 0;
                    try {
                        recvLen = frameReceiver.receive(buf);
                        byte[] immutableBuf = java.util.Arrays.copyOf(buf, (int) recvLen);
                        String receivedText = new String(immutableBuf, Charset.forName("UTF-8"));
                        Log.d("quiet", "run: receivedText: " + receivedText);

Hi @Sumit-Chakole,

Try disabling clamp frame (clampFrame: false) when instantiating the transmitter in JS. If that doesn't help, increase the frame length for the profile you are using.

edit: example of how to pass that param https://github.com/quiet/quiet-js/blob/gh-pages/javascripts/sendtext.js#L30

Thanks @brian-armstrong , that solves my issue :)