Hi,
I have put this in b4j as it is what I am currently working in, but I'm sure it will be same for b4a.
I get some data through serial. I need to pluck out certain bytes and use them as part of a larger byte array stream later. So I do:
This works fine.
As I said I then need to build a larger stream to send back out by concatenating, but I cannot seem to get it to work.
I have tried a few things including
and
I have put this in b4j as it is what I am currently working in, but I'm sure it will be same for b4a.
I get some data through serial. I need to pluck out certain bytes and use them as part of a larger byte array stream later. So I do:
B4X:
Dim mask() As Byte = Array As Byte(serial(9), serial(10), serial(11), serial(12), serial(13), serial(14), serial(15), serial(16), serial(17), serial(18))
This works fine.
As I said I then need to build a larger stream to send back out by concatenating, but I cannot seem to get it to work.
I have tried a few things including
B4X:
astream.Write(Array As Byte(0x55, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0a, mask))
and
B4X:
astream.Write(Array As Byte(0x55, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0a) & mask)