I have successfully read .dat files and sent them over Bluetooth serial to another device.
example data : 55 55 56 55 69 4a .................... 55 55 9a 6a 4d normally 17 to 23 bytes.
I am now using Astreams new data to receive this same type of data from the device. I wish to write it to a .dat file.
The log (msg) displays the correct hex data recieved as a string however the file "testload.dat" gets created but does not have the correct data. A lot of extraneous hex bytes.
I am a novice at this stuff what am I missing?
example data : 55 55 56 55 69 4a .................... 55 55 9a 6a 4d normally 17 to 23 bytes.
I am now using Astreams new data to receive this same type of data from the device. I wish to write it to a .dat file.
B4X:
Sub AStreams_NewData (Buffer() As Byte)
Dim msg As String
msg = (BConv.HexFromBytes(Buffer))
dirname = ("/engine "&selectedengine&"/testload.dat")
raf.initialize(File.DirRootExternal,dirname,False)
Log(msg)
raf.WriteObject(msg, True, raf.CurrentPosition)
raf.Close
End Sub
The log (msg) displays the correct hex data recieved as a string however the file "testload.dat" gets created but does not have the correct data. A lot of extraneous hex bytes.
I am a novice at this stuff what am I missing?