Yes, you misunderstood.
I am actually asking if the structure and union defenition is correct, will it work as it is?
Then there is 2 other problems.
Problem 1:
Say I do the following, fill the
CommsBuffer.Data with sequential numbers:
for (Loop = 0; Loop < COMMS_BUFFER_SIZE; Loop ++) {
CommsBuffer.Data[Loop] = Loop;
}
Then if I read the contents of the
CommsBuffer.Protocol structure
P1 = CommsBuffer.Protocol.StartByte;
P2 = CommsBuffer.Protocol.Route;
P3 = CommsBuffer.Protocol.Command;
P4 = CommsBuffer.Protocol.Length;
P5 = CommsBuffer.Protocol.HCS;
P6 = CommsBuffer.Protocol.Data[0];
P7 = CommsBuffer.Protocol.Data[1];
P8 = CommsBuffer.Protocol.Data[2];
P9 = CommsBuffer.Protocol.Data[3];
P10 = CommsBuffer.Protocol.Data[4];
P11 = CommsBuffer.Protocol.Data[5];
P12 = CommsBuffer.Protocol.Data[5];
...
Then the
protocol header section (5 bytes) is repeated in 1st 5 bytes of the
protocol data section and then only the actual protocol data. Like this:
P1 = 0
P2 = 1
P3 = 2
P4 = 3
P5 = 4
P6 = 0
P7 = 1
P8 = 2
P9 = 3
P10 = 4
P11 = 10
P12 = 11
Problem 2:
With normal type defined structures the editor will auto complete if I type
CommsBuffer
.and it will show the list where you can select the variables of CommsBuffer.
But with the current type defined union it doesn'y display the autocomplete list, making me think that there might be something wrong with the way I defined the union and structure.
Message Edited by fusion2344 on
2008-02-02 03:32 PMMessage Edited by fusion2344 on
2008-02-02 03:33 PM