Bits from Byte Array?
Capdiamont
Posts: 218
OpenTrac decoder 21 Dec 2012 13_30.bs2
I am trying to figure out OpenTrac.org specification for radio. OpenTrac is supposed to be a simpler, more extensible version of APRS.
I have an array I need 6 MSB out of ten bytes for SSID. From what I can see I have it right, but it does not produce the expected result.
DEBUG BIN1 MyBytes.HIGHBIT(2) or DEBUG BIN1 MyBytes.BIT7(2) for testing does not work.
IndexTemp2.BIT0 = MyBytes.HIGHBIT(2) does not work.
The only thing I am using on the bs2 is the programming port for DEBUG and DEBUGIN communications. I am just doing a few element decoding routines in the BS2. The one I am working on is element 1, originating station. Uses Big E bit order.
Consists of nine bytes
1: length of message(09), bit 1 is only for if using extended element id. (09) is hex, meaning not extended and has 9 bytes after the first.
2: element id, this case (01)
3. This case, start of six byte callsign with SSID using MSB of each callsign byte. using (4E)
4. using (31)
5. using (56)
6. using (C7)
7. using (80)
8. using (80) callsign example N1VG and SSID 7
9. using (00) beginning of sequence word
10. using (00)
If I can get past bit problem I think I can get it from there.
I am trying to figure out OpenTrac.org specification for radio. OpenTrac is supposed to be a simpler, more extensible version of APRS.
I have an array I need 6 MSB out of ten bytes for SSID. From what I can see I have it right, but it does not produce the expected result.
DEBUG BIN1 MyBytes.HIGHBIT(2) or DEBUG BIN1 MyBytes.BIT7(2) for testing does not work.
IndexTemp2.BIT0 = MyBytes.HIGHBIT(2) does not work.
The only thing I am using on the bs2 is the programming port for DEBUG and DEBUGIN communications. I am just doing a few element decoding routines in the BS2. The one I am working on is element 1, originating station. Uses Big E bit order.
Consists of nine bytes
1: length of message(09), bit 1 is only for if using extended element id. (09) is hex, meaning not extended and has 9 bytes after the first.
2: element id, this case (01)
3. This case, start of six byte callsign with SSID using MSB of each callsign byte. using (4E)
4. using (31)
5. using (56)
6. using (C7)
7. using (80)
8. using (80) callsign example N1VG and SSID 7
9. using (00) beginning of sequence word
10. using (00)
If I can get past bit problem I think I can get it from there.
Comments