I have a message
static int[] message = {
0x01, 0x10, 0x00,
0x01,
0x00, 0x01, 0x02,
0x06, 0x00,
0xA4, 0x21
};
I know the data is correct as I am writing it to a COM port with RXTX and I got the correct HW response
I know that it 0x01is a value 1and sent really like 01(these are two bits, a quarter byte)
When I need to configure a message, it generates values ββlike this?
message[index] = 1 & 0xff
I see the result of this fragment, and it looks right
for (int i = 0; i < 255; i++) {
System.out.println(i & 0xff);
}
Is there any sheet you would recommend me to read?
Saves these numbers to the intright, since we cannot use byte (-128, +127)for values ββup to <0x00, 0xFF>range
source
share