Seeking for a hint how to convert data between B4R client & B4J server
Example:
B4R Client
B4J Server
Example:
B4R Client
B4X:
..
Dim celsiustemp As Double = 100.0 * volts - 50
If ethClient.Connected Then
'IS THIS CORRECT? Probably not as need to convert Double to Array As Byte = BUT HOW?
Dim s As Byte = celsiustemp
astream.Write(Array As Byte(s))
...
B4J Server
B4X:
Sub Astream_NewData (Buffer() As Byte)
Dim newdata As String = BytesToString(Buffer, 0, Buffer.Length, "UTF8")
'THIS IS NOT WORKING = newdata is empty BUT the buffer has data
Log($"New Data received: ${newdata}"$)
aStream.Write("Thank you for this useful information.".GetBytes("UTF8"))
End Sub
Last edited: