mirror of https://gerrit.osmocom.org/osmo-tetra
extended sysinfo as described in section 21.4.4.1
now every transmitted field in sysinfo is analyzed
This commit is contained in:
parent
732d06d531
commit
83140af8d0
|
@ -39,9 +39,12 @@ static void decode_d_mle_sysinfo(struct tetra_mle_si_decoded *msid, const uint8_
|
|||
msid->bs_service_details = bits_to_uint(cur, 12); cur += 12;
|
||||
}
|
||||
|
||||
/* see 21.4.4.1 */
|
||||
void macpdu_decode_sysinfo(struct tetra_si_decoded *sid, const uint8_t *si_bits)
|
||||
{
|
||||
const uint8_t *cur = si_bits + 4;
|
||||
const uint8_t *cur = si_bits;
|
||||
cur += 2; // skip Broadcast PDU header
|
||||
cur += 2; // skip Sysinfo PDU header
|
||||
|
||||
sid->main_carrier = bits_to_uint(cur, 12); cur += 12;
|
||||
sid->freq_band = bits_to_uint(cur, 4); cur += 4;
|
||||
|
@ -58,9 +61,23 @@ void macpdu_decode_sysinfo(struct tetra_si_decoded *sid, const uint8_t *si_bits)
|
|||
sid->cck_id = bits_to_uint(cur, 16);
|
||||
else
|
||||
sid->hyperframe_number = bits_to_uint(cur, 16);
|
||||
cur += 16;
|
||||
/* FIXME: more */
|
||||
decode_d_mle_sysinfo(&sid->mle_si, si_bits + 124-42);
|
||||
|
||||
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
|
||||
sid->frame_bitmap = bits_to_uint(cur, 20); cur += 20;
|
||||
break;
|
||||
case 0x02: // Default definition for access code A
|
||||
sid->access_code = bits_to_uint(cur, 20); cur += 20;
|
||||
break;
|
||||
case 0x04: // Extended services broadcast
|
||||
sid->ext_service = bits_to_uint(cur, 20); cur += 20;
|
||||
break;
|
||||
}
|
||||
|
||||
decode_d_mle_sysinfo(&sid->mle_si, si_bits + 124-42); // could be also cur due to previous fixes
|
||||
}
|
||||
|
||||
static const uint8_t addr_len_by_type[] = {
|
||||
|
|
|
@ -60,6 +60,12 @@ struct tetra_si_decoded {
|
|||
uint16_t cck_id;
|
||||
uint16_t hyperframe_number;
|
||||
};
|
||||
uint8_t option_field;
|
||||
union {
|
||||
uint32_t frame_bitmap;
|
||||
uint32_t access_code;
|
||||
uint32_t ext_service;
|
||||
};
|
||||
struct tetra_mle_si_decoded mle_si;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue