P25 -- Check MFID 90/A4 Opcode/Payload; Tweaks;

This commit is contained in:
lwvmobile
2023-09-26 08:44:57 -04:00
parent abbf153785
commit daecac1612
4 changed files with 82 additions and 2 deletions

View File

@@ -153,7 +153,7 @@ int p25_12(uint8_t * input, uint8_t treturn[12])
if (min != 15) //unique value returned
{
tdibits[i] = state = min;
irr_err--; //decrement 'corrected' point err
// irr_err--; //decrement 'corrected' point err
}
//use the predicted correct state/value at output instead -- last resort

View File

@@ -478,6 +478,28 @@ void processMPDU(dsd_opts * opts, dsd_state * state)
}
}
//look at Harris Opcodes and payload portion of TSBK
else if (MFID == 0xA4)
{
//TODO: Add Known Opcodes from Manual (all one of them)
fprintf (stderr, "%s",KCYN);
fprintf (stderr, "\n MFID A4 (Harris); Opcode: %02X; ", opcode);
for (i = 0; i < (12*(blks+1)%37); i++)
fprintf (stderr, "%02X", mpdu_byte[i]);
fprintf (stderr, " %s",KNRM);
}
//look at Motorola Opcodes and payload portion of TSBK
else if (MFID == 0x90)
{
//TODO: Add Known Opcodes from Manual
fprintf (stderr, "%s",KCYN);
fprintf (stderr, "\n MFID 90 (Moto); Opcode: %02X; ", mpdu_byte[0] & 0x3F);
for (i = 0; i < (12*(blks+1)%37); i++)
fprintf (stderr, "%02X", mpdu_byte[i]);
fprintf (stderr, " %s",KNRM);
}
else
{
//convert mpdu_byte to vPDU format and get indication of what the message was

View File

@@ -142,8 +142,41 @@ void processTSBK(dsd_opts * opts, dsd_state * state)
fprintf (stderr, "%s",KNRM);
}
//look at Harris Opcodes and payload portion of TSBK
else if (MFID == 0xA4 && protectbit == 0 && err == 0)
{
//TODO: Add Known Opcodes from Manual (all one of them)
fprintf (stderr, "%s",KCYN);
fprintf (stderr, "\n MFID A4 (Harris); Opcode: %02X; ", tsbk_byte[0] & 0x3F);
for (i = 2; i < 10; i++)
fprintf (stderr, "%02X", tsbk_byte[i]);
fprintf (stderr, " %s",KNRM);
//This seems to follow the same structure as the MFID 90 Group Regroup Add Command
//MFID A4 Opcode 1 on TSBK / Opcode 0x41 on vPDU
// P25 PDU Payload #1 [81][A4] [11][0D] [83][4E] [84][2A] [84][EE] -------[39][30]
// MFID A4 Protected: 0 Last Block: 1
//these values do seem to change, but not often, but seem to pair up into 16-bit values
// P25 PDU Payload #1 [81][A4] [11][0D] [84][2A] [84][EE] [FF][FF] -------[4D][2F]
// MFID A4 Protected: 0 Last Block: 1
}
//look at Motorola Opcodes and payload portion of TSBK
else if (MFID == 0x90 && protectbit == 0 && err == 0)
{
//TODO: Add Known Opcodes from Manual -- will probably want to add the voice grants
fprintf (stderr, "%s",KCYN);
fprintf (stderr, "\n MFID 90 (Moto); Opcode: %02X; ", tsbk_byte[0] & 0x3F);
for (i = 2; i < 10; i++)
fprintf (stderr, "%02X", tsbk_byte[i]);
fprintf (stderr, " %s",KNRM);
}
//set our WACN and SYSID here now that we have valid ec and crc/checksum
else if (protectbit == 0 && err == 0 && ec == 0 && (tsbk_byte[0] & 0x3F) == 0x3B)
else if (protectbit == 0 && err == 0 && (tsbk_byte[0] & 0x3F) == 0x3B)
{
long int wacn = (tsbk_byte[3] << 12) | (tsbk_byte[4] << 4) | (tsbk_byte[5] >> 4);
int sysid = ((tsbk_byte[5] & 0xF) << 8) | tsbk_byte[6];

View File

@@ -1167,6 +1167,31 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon
// fprintf (stderr, "\n Telephone Interconnect Voice Channel Grant Update ");
// }
//TODO: Restructure this function to group standard Opcodes away from MFID 90 and MFID A4, and Unknown MFID
//or just go to if-elseif-else layout (probably easier that way)
//Unknown Harris A4 Opcodes
if (MAC[1+len_a] != 0xB0 && MAC[2+len_a] == 0xA4)
{
// 6.2.36 Manufacturer Specific regarding octet 3 as len
int len = MAC[3+len_a] & 0x3F;
int res = MAC[3+len_a] >> 6;
if (len > 24)
len = 24; //should never exceed this len, but just in case it does
fprintf (stderr, "\n MFID A4 (Harris); Res: %d; Len: %d; Opcode: %02X; ", res, len, MAC[1+len_a]);
for (i = 1; i < len; i++)
fprintf (stderr, "%02X", MAC[i+len_a]); //might not be a good idea to run this, or it may overflow
}
/*
Maybe this is why some of these SYNC_BCST PDUs have zeroes in most fields
Information provided in the SYNC_BCST message may be used for purposes other
than providing synchronization to a TDMA voice channel. These purposes are beyond
the scope of this document. SUs not interested in synchronization with the TDMA voice
channel may ignore the status of the US bit.
*/
//Synchronization Broadcast (SYNC_BCST)
if (MAC[1+len_a] == 0x70)
{