I have a byte that represents two values. First bit represents represents the sequence number. The rest of the bits represent the actual content.
In C, I could easily parse this out by the following:
typedef struct
{
byte seqNumber : 1;
byte content : 7;
}
MyPacket;
Then I can easily case the input to MyPacket:
char* inputByte = "U"; // binary 01010101
MyPacket * myPacket = (MyPacket*)inputByte;
Then myPacket->seqNumber = 1 myPacket->content = 42
How can I do the same thing in C#?
Thank you kab