Android Question [SOLVED] Unexpected end of ZLIB input stream

rosippc64a

Active Member
Licensed User
Longtime User
Hello everyone!
I am sending data between two devices via Bluetooth using ConvertObjectToBytes. Everything worked fine until now. now suddenly the communication is hanging with the above error. It turns out that I am sending 1107 bytes but only 990 are received and this is causing the problem. Is there a size limit for this?
Send:
B4X:
    Dim mm As MyMessage
    mm.Initialize
    mm.Command = "QUERYRESP"
    mm.Timestamp = $"$DateTime{DateTime.Now}"$
    mm.xml = xml.asString2(props)
    'SendData (CallSub2(Main,"doser",Array As Object(mm)))
    Log($"QUERYRESP küldés"$)
    BT1.WriteBytes(ser.ConvertObjectToBytes(mm))
Receive:
B4X:
Private Sub AStream_NewData (Buffer() As Byte)
    If SubExists(CallBack, EventName & "_NewData") Then
        Log("ClassBt AStream_NewData: " & Buffer.Length)
        CallSub2(CallBack, EventName & "_NewData", Buffer)
    End If
End Sub
Thanks in advance
Stefan
 

DonManfred

Expert
Licensed User
Longtime User
be aware that you may get the data in multiple packets....
 
Upvote 0
Top