Hi there... I have a piece of code that transmits a string via MQTT:
And I have a piece of code that responds to this:
Problem is, I don't get "Test message" back - I get a load of characters. How do I use the B4XSerializator to send a string and then how do I decode it?
Thank you.
JMB
B4X:
Dim m As String = "Test Message"
mqtt.Publish("TextComment", Serializator.ConvertObjectToBytes(m))
And I have a piece of code that responds to this:
B4X:
Private Sub mqtt_MessageArrived (Topic As String, Payload() As Byte)
Log("Message arrived: " & Topic)
Log(BytesToString(Payload, 0, Payload.Length, "utf8"))
End Sub
Problem is, I don't get "Test message" back - I get a load of characters. How do I use the B4XSerializator to send a string and then how do I decode it?
Thank you.
JMB