aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluckyhacky <github@mail.my-cp.de>2013-12-30 23:58:58 +0100
committerHarald Welte <laforge@gnumonks.org>2015-08-21 01:49:02 +0200
commit6f78d76052034e655b6c5672fe7ed0ab27e24c39 (patch)
tree3835519908a82b887fb96da7a9de67468d0dd621
parent83140af8d0cf66b8ebf7c414f4ed8ef561f4fec2 (diff)
removed hard coded values - exchanged it with enum for better readability
-rw-r--r--src/tetra_mac_pdu.c8
-rw-r--r--src/tetra_mac_pdu.h7
2 files changed, 11 insertions, 4 deletions
diff --git a/src/tetra_mac_pdu.c b/src/tetra_mac_pdu.c
index f1fed10..b395b7c 100644
--- a/src/tetra_mac_pdu.c
+++ b/src/tetra_mac_pdu.c
@@ -65,14 +65,14 @@ void macpdu_decode_sysinfo(struct tetra_si_decoded *sid, const uint8_t *si_bits)
sid->option_field = bits_to_uint(cur, 2); cur += 2;
switch(sid->option_field)
{
- case 0x00: // Even multiframe definition for TS mode
- case 0x01: // Odd multiframe definition for TS mode
+ case TETRA_MAC_OPT_FIELD_EVEN_MULTIFRAME: // Even multiframe definition for TS mode
+ case TETRA_MAC_OPT_FIELD_ODD_MULTIFRAME: // Odd multiframe definition for TS mode
sid->frame_bitmap = bits_to_uint(cur, 20); cur += 20;
break;
- case 0x02: // Default definition for access code A
+ case TETRA_MAC_OPT_FIELD_ACCESS_CODE: // Default definition for access code A
sid->access_code = bits_to_uint(cur, 20); cur += 20;
break;
- case 0x04: // Extended services broadcast
+ case TETRA_MAC_OPT_FIELD_EXT_SERVICES: // Extended services broadcast
sid->ext_service = bits_to_uint(cur, 20); cur += 20;
break;
}
diff --git a/src/tetra_mac_pdu.h b/src/tetra_mac_pdu.h
index b0244ff..051e47a 100644
--- a/src/tetra_mac_pdu.h
+++ b/src/tetra_mac_pdu.h
@@ -36,6 +36,13 @@ enum tetra_bs_serv_details {
BS_SERVDET_ADV_LINK = (1 << 0),
};
+enum tetra_mac_optional_field_flags {
+ TETRA_MAC_OPT_FIELD_EVEN_MULTIFRAME = 0,
+ TETRA_MAC_OPT_FIELD_ODD_MULTIFRAME = 1,
+ TETRA_MAC_OPT_FIELD_ACCESS_CODE = 2,
+ TETRA_MAC_OPT_FIELD_EXT_SERVICES = 3
+};
+
const char *tetra_get_bs_serv_det_name(uint32_t pdu_type);
struct tetra_mle_si_decoded {