B4R Question Bytes to String

Declan

Well-Known Member
Licensed User
Longtime User
I have a very simple B4R app that reads data on the SoftwareSerial from a uBlox GPS.
My Code:
B4X:
#Region Project Attributes
    #AutoFlushLogs: True
    #CheckArrayBounds: True
    #StackBufferSize: 300
#End Region

Sub Process_Globals
    Public Serial1 As Serial
    Private astream As AsyncStreams
    Private GPSsoftserial As SoftwareSerial

End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    astream.Initialize(Serial1.Stream, "Astream_NewData", "Astream_Error")
    GPSsoftserial.Initialize(4800, 10, 11)
    astream.Initialize(GPSsoftserial.Stream, "astream_newdataGPS", Null)
End Sub

Sub Astream_NewData (Buffer() As Byte)
'    Log("Received: ", Buffer)
End Sub

Sub Astream_NewDataGPS (Buffer() As Byte)
    Log("Received: ", Buffer)
End Sub

Sub AStream_Error
    Log("error")
End Sub

How do I change the bytes received to a string?
Log:
B4X:
AppStart
������䅦���ą����c
Received: %#!������椥����䇆���ŧ�����c%#!��G���g���g�E�a!��ă�Ą����'�Ƅ������⦇���ä�GǦ�c%#C��������䅦���ą����c
Received: %#!������椥����䇆���ŧ�����c%#!��G���g���g�E�a!
 
Top