I have two bytes and I am setting different bits in order to get different combinations.
E.g, byte 1 bit 7 and byte 2 bit 1,bit 2 makes a combination device ready.
Now, I have created mask
#define C1_device_ready (0x80 | 0x100 | 0x200)
Then I read the data and try to compare.
for 1 byte I can do (data[0] & mask == mask).
But how can I compute it for C1_device_ready mask where there are two bytes, data[0]
and data[1].
Is it easily possible or should I do masking only in single byte.
::added::data is unsigned char data[2]
If
datais an array ofunsigned char, you could testor combine the two
data[i]and check