From e3c3d15dce0117468944788e85c968fe47a16769 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Sat, 23 Dec 2023 15:04:01 -0500 Subject: [PATCH] DMR - Move CSBK Acknowledgements to Non MFID10; --- src/dmr_csbk.c | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/dmr_csbk.c b/src/dmr_csbk.c index 0338a12..4dcef48 100644 --- a/src/dmr_csbk.c +++ b/src/dmr_csbk.c @@ -800,33 +800,37 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 fprintf (stderr, " C_ACKVIT (Ackvitation/Authorization) "); } - if (csbk_o == 32 || csbk_o == 33 || csbk_o == 34 || csbk_o == 35) + if (csbk_fid != 0x10) //if Not Motorola { - //initial line break - fprintf (stderr, "\n"); //(Acknowledgement) - if (csbk_o == 32) fprintf (stderr, " C_ACKD Outbound TSCC; "); - if (csbk_o == 33) fprintf (stderr, " C_ACKU Inbound TSCC; "); - if (csbk_o == 34) fprintf (stderr, " P_ACKD Outbound Payload; "); - if (csbk_o == 35) fprintf (stderr, " P_ACKU Inbound Payload; "); + //These opcodes to exist on CapMax as well, but don't function the same + if (csbk_o == 32 || csbk_o == 33 || csbk_o == 34 || csbk_o == 35) + { + //initial line break + fprintf (stderr, "\n"); //(Acknowledgement) + if (csbk_o == 32) fprintf (stderr, " C_ACKD Outbound TSCC; "); + if (csbk_o == 33) fprintf (stderr, " C_ACKU Inbound TSCC; "); + if (csbk_o == 34) fprintf (stderr, " P_ACKD Outbound Payload; "); + if (csbk_o == 35) fprintf (stderr, " P_ACKU Inbound Payload; "); - uint8_t response_info = (uint8_t)ConvertBitIntoBytes(&cs_pdu_bits[16], 7); - uint8_t reason_code = (uint8_t)ConvertBitIntoBytes(&cs_pdu_bits[23], 8); - uint8_t ack_res1 = cs_pdu_bits[31]; + uint8_t response_info = (uint8_t)ConvertBitIntoBytes(&cs_pdu_bits[16], 7); + uint8_t reason_code = (uint8_t)ConvertBitIntoBytes(&cs_pdu_bits[23], 8); + uint8_t ack_res1 = cs_pdu_bits[31]; - uint32_t ack_target = (uint32_t)ConvertBitIntoBytes(&cs_pdu_bits[32], 24); - uint32_t ack_source = (uint32_t)ConvertBitIntoBytes(&cs_pdu_bits[56], 24); + uint32_t ack_target = (uint32_t)ConvertBitIntoBytes(&cs_pdu_bits[32], 24); + uint32_t ack_source = (uint32_t)ConvertBitIntoBytes(&cs_pdu_bits[56], 24); - //response_info and reason_code start to get really convoluted on decoding them - //for each opcode, so I am just going to put the values out to the console, - //look at ETSI TS 102 361-4 V1.12.1 7.2.7 for more info + //response_info and reason_code start to get really convoluted on decoding them + //for each opcode, so I am just going to put the values out to the console, + //look at ETSI TS 102 361-4 V1.12.1 7.2.7 for more info - fprintf (stderr, "Response: %02X; Reason: %02X; ", response_info, reason_code); - if (ack_res1) fprintf (stderr, " Res: %d", ack_res1); - fprintf (stderr, "Target: %d; Source: %d; ", ack_target, ack_source); + fprintf (stderr, "Response: %02X; Reason: %02X; ", response_info, reason_code); + if (ack_res1) fprintf (stderr, " Res: %d", ack_res1); + fprintf (stderr, "Target: %d; Source: %d; ", ack_target, ack_source); - //check the source and/or target for special gateway identifiers - dmr_gateway_identifier (ack_source, ack_target); + //check the source and/or target for special gateway identifiers + dmr_gateway_identifier (ack_source, ack_target); + } } if (csbk_o == 31)