How does the "Buffer() As Byte" data in the
"..._NewData" event get cleared after each use? :sign0104:
I have the Asynchstreams bluetooth demo working with a serial bluetooth device, but I cannot get values in the array beyond Buffer(0) assigned to a variable, as the following:
:BangHead:
I'm using a PIC with HC-01 Bluetooth module and Samsung GalaxyII Skyrocket.
"..._NewData" event get cleared after each use? :sign0104:
I have the Asynchstreams bluetooth demo working with a serial bluetooth device, but I cannot get values in the array beyond Buffer(0) assigned to a variable, as the following:
B4X:
Sub AStreams_NewData (Buffer() As Byte)
Dim msg As String
Dim fred As Float
Dim wilma As Float
Dim barney As Float
fred = Buffer(0)
wilma = Buffer(1)
barney = Buffer(2)
[I]'wilma and barney code lines error in "out of bounds" fault on Buffer'[/I]
msg = BytesToString(Buffer, 0, Buffer.Length, "UTF8")
[I]'works great by showing all three characters recieved via bluetooth[/I]ToastMessageShow(msg, False)
Log(msg)
End Sub
I'm using a PIC with HC-01 Bluetooth module and Samsung GalaxyII Skyrocket.