mirror of
https://github.com/brmlab/osmo-tetra.git
synced 2025-06-08 09:54:09 +02:00
libosmocore namespace changes ("osmo_")
This commit is contained in:
parent
005e26833e
commit
a22f5923d1
4 changed files with 48 additions and 48 deletions
|
@ -56,19 +56,19 @@ static void decode_schf(const uint8_t *bits)
|
|||
uint8_t type3[1024];
|
||||
uint8_t type2[1024];
|
||||
|
||||
printf("SCH/f type5: %s\n", ubit_dump(bits, 432));
|
||||
printf("SCH/f type5: %s\n", osmo_ubit_dump(bits, 432));
|
||||
memcpy(type4, bits, 432);
|
||||
tetra_scramb_bits(SCRAMB_INIT, type4, 432);
|
||||
printf("SCH/F type4: %s\n", ubit_dump(type4, 432));
|
||||
printf("SCH/F type4: %s\n", osmo_ubit_dump(type4, 432));
|
||||
/* Run (120,11) block deinterleaving: type-3 bits */
|
||||
block_deinterleave(432, 103, type4, type3);
|
||||
printf("SCH/F type3: %s\n", ubit_dump(type3, 432));
|
||||
printf("SCH/F type3: %s\n", osmo_ubit_dump(type3, 432));
|
||||
/* De-puncture */
|
||||
memset(type3dp, 0xff, sizeof(type3dp));
|
||||
tetra_rcpc_depunct(TETRA_RCPC_PUNCT_2_3, type3, 432, type3dp);
|
||||
printf("SCH/F type3dp: %s\n", ubit_dump(type3dp, 288*4));
|
||||
printf("SCH/F type3dp: %s\n", osmo_ubit_dump(type3dp, 288*4));
|
||||
viterbi_dec_sb1_wrapper(type3dp, type2, 288);
|
||||
printf("SCH/F type2: %s\n", ubit_dump(type2, 288));
|
||||
printf("SCH/F type2: %s\n", osmo_ubit_dump(type2, 288));
|
||||
|
||||
{
|
||||
uint16_t crc;
|
||||
|
@ -81,7 +81,7 @@ static void decode_schf(const uint8_t *bits)
|
|||
num_crc_err++;
|
||||
}
|
||||
}
|
||||
printf("SCH/F type1: %s\n", ubit_dump(type2, 268));
|
||||
printf("SCH/F type1: %s\n", osmo_ubit_dump(type2, 268));
|
||||
}
|
||||
|
||||
/* Build a full 'downlink continuous SYNC burst' from SYSINFO-PDU and SYNC-PDU */
|
||||
|
@ -112,7 +112,7 @@ int build_ndb_schf()
|
|||
/* Append 4 tail bits: type-2 bits */
|
||||
cur += 4;
|
||||
|
||||
printf("SCH/F type2: %s\n", ubit_dump(type2, 288));
|
||||
printf("SCH/F type2: %s\n", osmo_ubit_dump(type2, 288));
|
||||
|
||||
/* Run rate 2/3 RCPC code: type-3 bits*/
|
||||
{
|
||||
|
@ -122,22 +122,22 @@ int build_ndb_schf()
|
|||
get_punctured_rate(TETRA_RCPC_PUNCT_2_3, master, 432, type3);
|
||||
free(ces);
|
||||
}
|
||||
printf("SCH/F type3: %s\n", ubit_dump(type3, 432));
|
||||
printf("SCH/F type3: %s\n", osmo_ubit_dump(type3, 432));
|
||||
|
||||
/* Run (432,103) block interleaving: type-4 bits */
|
||||
block_interleave(432, 103, type3, type4);
|
||||
printf("SCH/F type4: %s\n", ubit_dump(type4, 432));
|
||||
printf("SCH/F type4: %s\n", osmo_ubit_dump(type4, 432));
|
||||
|
||||
/* Run scrambling (all-zero): type-5 bits */
|
||||
memcpy(type5, type4, 432);
|
||||
tetra_scramb_bits(SCRAMB_INIT, type5, 432);
|
||||
printf("SCH/F type5: %s\n", ubit_dump(type5, 432));
|
||||
printf("SCH/F type5: %s\n", osmo_ubit_dump(type5, 432));
|
||||
|
||||
decode_schf(type5);
|
||||
|
||||
/* Use pdu_acc_ass from testpdu.c */
|
||||
/* Run it through (30,14) RM code: type-2=3=4 bits */
|
||||
printf("AACH type-1: %s\n", ubit_dump(pdu_acc_ass, 2));
|
||||
printf("AACH type-1: %s\n", osmo_ubit_dump(pdu_acc_ass, 2));
|
||||
bb_rm3014 = tetra_rm3014_compute(*(uint16_t *)pdu_acc_ass);
|
||||
printf("AACH RM3014: 0x0%x\n", bb_rm3014);
|
||||
/* convert to big endian */
|
||||
|
@ -146,11 +146,11 @@ int build_ndb_schf()
|
|||
bb_rm3014_be <<= 2;
|
||||
osmo_pbit2ubit(bb_type5, (uint8_t *) &bb_rm3014_be, 30);
|
||||
/* Run scrambling (all-zero): type-5 bits */
|
||||
printf("AACH type-5: %s\n", ubit_dump(bb_type5, 30));
|
||||
printf("AACH type-5: %s\n", osmo_ubit_dump(bb_type5, 30));
|
||||
|
||||
/* Finally, hand it into the physical layer */
|
||||
build_norm_c_d_burst(burst, type5, bb_type5, type5+216, 0);
|
||||
printf("cont norm DL burst: %s\n", ubit_dump(burst, 255*2));
|
||||
printf("cont norm DL burst: %s\n", osmo_ubit_dump(burst, 255*2));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -163,19 +163,19 @@ static void decode_sb1(const uint8_t *bits)
|
|||
uint8_t type3[1024];
|
||||
uint8_t type2[1024];
|
||||
|
||||
printf("SB1 type5: %s\n", ubit_dump(bits, 120));
|
||||
printf("SB1 type5: %s\n", osmo_ubit_dump(bits, 120));
|
||||
memcpy(type4, bits, 120);
|
||||
tetra_scramb_bits(SCRAMB_INIT, type4, 120);
|
||||
printf("SB1 type4: %s\n", ubit_dump(type4, 120));
|
||||
printf("SB1 type4: %s\n", osmo_ubit_dump(type4, 120));
|
||||
/* Run (120,11) block deinterleaving: type-3 bits */
|
||||
block_deinterleave(120, 11, type4, type3);
|
||||
printf("SB1 type3: %s\n", ubit_dump(type3, 120));
|
||||
printf("SB1 type3: %s\n", osmo_ubit_dump(type3, 120));
|
||||
/* De-puncture */
|
||||
memset(type3dp, 0xff, sizeof(type3dp));
|
||||
tetra_rcpc_depunct(TETRA_RCPC_PUNCT_2_3, type3, 120, type3dp);
|
||||
printf("SB1 type3dp: %s\n", ubit_dump(type3dp, 80*4));
|
||||
printf("SB1 type3dp: %s\n", osmo_ubit_dump(type3dp, 80*4));
|
||||
viterbi_dec_sb1_wrapper(type3dp, type2, 80);
|
||||
printf("SB1 type2: %s\n", ubit_dump(type2, 80));
|
||||
printf("SB1 type2: %s\n", osmo_ubit_dump(type2, 80));
|
||||
|
||||
{
|
||||
uint16_t crc;
|
||||
|
@ -189,9 +189,9 @@ static void decode_sb1(const uint8_t *bits)
|
|||
}
|
||||
}
|
||||
|
||||
printf("TN %s ", ubit_dump(type2+10, 2));
|
||||
printf("MCC %s ", ubit_dump(type2+31, 10));
|
||||
printf("MNC %s\n", ubit_dump(type2+41, 14));
|
||||
printf("TN %s ", osmo_ubit_dump(type2+10, 2));
|
||||
printf("MCC %s ", osmo_ubit_dump(type2+31, 10));
|
||||
printf("MNC %s\n", osmo_ubit_dump(type2+41, 14));
|
||||
}
|
||||
|
||||
/* Build a full 'downlink continuous SYNC burst' from SYSINFO-PDU and SYNC-PDU */
|
||||
|
@ -228,7 +228,7 @@ int build_sb()
|
|||
/* Append 4 tail bits: type-2 bits */
|
||||
cur += 4;
|
||||
|
||||
printf("SYNC type2: %s\n", ubit_dump(sb_type2, 80));
|
||||
printf("SYNC type2: %s\n", osmo_ubit_dump(sb_type2, 80));
|
||||
|
||||
/* Run rate 2/3 RCPC code: type-3 bits*/
|
||||
{
|
||||
|
@ -238,16 +238,16 @@ int build_sb()
|
|||
get_punctured_rate(TETRA_RCPC_PUNCT_2_3, sb_master, 120, sb_type3);
|
||||
free(ces);
|
||||
}
|
||||
printf("SYNC type3: %s\n", ubit_dump(sb_type3, 120));
|
||||
printf("SYNC type3: %s\n", osmo_ubit_dump(sb_type3, 120));
|
||||
|
||||
/* Run (120,11) block interleaving: type-4 bits */
|
||||
block_interleave(120, 11, sb_type3, sb_type4);
|
||||
printf("SYNC type4: %s\n", ubit_dump(sb_type4, 120));
|
||||
printf("SYNC type4: %s\n", osmo_ubit_dump(sb_type4, 120));
|
||||
|
||||
/* Run scrambling (all-zero): type-5 bits */
|
||||
memcpy(sb_type5, sb_type4, 120);
|
||||
tetra_scramb_bits(SCRAMB_INIT, sb_type5, 120);
|
||||
printf("SYNC type5: %s\n", ubit_dump(sb_type5, 120));
|
||||
printf("SYNC type5: %s\n", osmo_ubit_dump(sb_type5, 120));
|
||||
|
||||
decode_sb1(sb_type5);
|
||||
|
||||
|
@ -264,7 +264,7 @@ int build_sb()
|
|||
/* Append 4 tail bits: type-2 bits */
|
||||
cur += 4;
|
||||
|
||||
printf("SI type2: %s\n", ubit_dump(si_type2, 140));
|
||||
printf("SI type2: %s\n", osmo_ubit_dump(si_type2, 140));
|
||||
|
||||
/* Run rate 2/3 RCPC code: type-3 bits */
|
||||
{
|
||||
|
@ -274,11 +274,11 @@ int build_sb()
|
|||
get_punctured_rate(TETRA_RCPC_PUNCT_2_3, si_master, 216, si_type3);
|
||||
free(ces);
|
||||
}
|
||||
printf("SI type3: %s\n", ubit_dump(si_type3, 216));
|
||||
printf("SI type3: %s\n", osmo_ubit_dump(si_type3, 216));
|
||||
|
||||
/* Run (216,101) block interleaving: type-4 bits */
|
||||
block_interleave(216, 101, si_type3, si_type4);
|
||||
printf("SI type4: %s\n", ubit_dump(si_type4, 216));
|
||||
printf("SI type4: %s\n", osmo_ubit_dump(si_type4, 216));
|
||||
|
||||
/* Run scrambling (all-zero): type-5 bits */
|
||||
memcpy(si_type5, si_type4, 216);
|
||||
|
@ -286,7 +286,7 @@ int build_sb()
|
|||
|
||||
/* Use pdu_acc_ass from testpdu.c */
|
||||
/* Run it through (30,14) RM code: type-2=3=4 bits */
|
||||
printf("AACH type-1: %s\n", ubit_dump(pdu_acc_ass, 2));
|
||||
printf("AACH type-1: %s\n", osmo_ubit_dump(pdu_acc_ass, 2));
|
||||
bb_rm3014 = tetra_rm3014_compute(*(uint16_t *)pdu_acc_ass);
|
||||
printf("AACH RM3014: 0x0%x\n", bb_rm3014);
|
||||
/* convert to big endian */
|
||||
|
@ -295,11 +295,11 @@ int build_sb()
|
|||
bb_rm3014_be <<= 2;
|
||||
osmo_pbit2ubit(bb_type5, (uint8_t *) &bb_rm3014_be, 30);
|
||||
/* Run scrambling (all-zero): type-5 bits */
|
||||
printf("AACH type-5: %s\n", ubit_dump(bb_type5, 30));
|
||||
printf("AACH type-5: %s\n", osmo_ubit_dump(bb_type5, 30));
|
||||
|
||||
/* Finally, hand it into the physical layer */
|
||||
build_sync_c_d_burst(burst, sb_type5, bb_type5, si_type5);
|
||||
printf("cont sync DL burst: %s\n", ubit_dump(burst, 255*2));
|
||||
printf("cont sync DL burst: %s\n", osmo_ubit_dump(burst, 255*2));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ void tp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned
|
|||
}
|
||||
|
||||
DEBUGP("%s %s type5: %s\n", tbp->name, tetra_tdma_time_dump(&tcd->time),
|
||||
ubit_dump(bits, tbp->type345_bits));
|
||||
osmo_ubit_dump(bits, tbp->type345_bits));
|
||||
|
||||
/* De-scramble, pay special attention to SB1 pre-defined scrambling */
|
||||
memcpy(type4, bits, tbp->type345_bits);
|
||||
|
@ -182,21 +182,21 @@ void tp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned
|
|||
}
|
||||
|
||||
DEBUGP("%s %s type4: %s\n", tbp->name, time_str,
|
||||
ubit_dump(type4, tbp->type345_bits));
|
||||
osmo_ubit_dump(type4, tbp->type345_bits));
|
||||
|
||||
if (tbp->interleave_a) {
|
||||
/* Run block deinterleaving: type-3 bits */
|
||||
block_deinterleave(tbp->type345_bits, tbp->interleave_a, type4, type3);
|
||||
DEBUGP("%s %s type3: %s\n", tbp->name, time_str,
|
||||
ubit_dump(type3, tbp->type345_bits));
|
||||
osmo_ubit_dump(type3, tbp->type345_bits));
|
||||
/* De-puncture */
|
||||
memset(type3dp, 0xff, sizeof(type3dp));
|
||||
tetra_rcpc_depunct(TETRA_RCPC_PUNCT_2_3, type3, tbp->type345_bits, type3dp);
|
||||
DEBUGP("%s %s type3dp: %s\n", tbp->name, time_str,
|
||||
ubit_dump(type3dp, tbp->type2_bits*4));
|
||||
osmo_ubit_dump(type3dp, tbp->type2_bits*4));
|
||||
viterbi_dec_sb1_wrapper(type3dp, type2, tbp->type2_bits);
|
||||
DEBUGP("%s %s type2: %s\n", tbp->name, time_str,
|
||||
ubit_dump(type2, tbp->type2_bits));
|
||||
osmo_ubit_dump(type2, tbp->type2_bits));
|
||||
}
|
||||
|
||||
if (tbp->have_crc16) {
|
||||
|
@ -206,7 +206,7 @@ void tp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned
|
|||
printf("OK\n");
|
||||
tup->crc_ok = 1;
|
||||
printf("%s %s type1: %s\n", tbp->name, time_str,
|
||||
ubit_dump(type2, tbp->type1_bits));
|
||||
osmo_ubit_dump(type2, tbp->type1_bits));
|
||||
} else
|
||||
printf("WRONG\n");
|
||||
} else if (type == TPSAP_T_BBK) {
|
||||
|
@ -214,7 +214,7 @@ void tp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned
|
|||
tup->crc_ok = 1;
|
||||
memcpy(type2, type4, tbp->type2_bits);
|
||||
DEBUGP("%s %s type1: %s\n", tbp->name, time_str,
|
||||
ubit_dump(type2, tbp->type1_bits));
|
||||
osmo_ubit_dump(type2, tbp->type1_bits));
|
||||
}
|
||||
|
||||
msg->l1h = msgb_put(msg, tbp->type1_bits);
|
||||
|
@ -222,12 +222,12 @@ void tp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned
|
|||
|
||||
switch (type) {
|
||||
case TPSAP_T_SB1:
|
||||
printf("TMB-SAP SYNC CC %s(0x%02x) ", ubit_dump(type2+4, 6), bits_to_uint(type2+4, 6));
|
||||
printf("TN %s(%u) ", ubit_dump(type2+10, 2), bits_to_uint(type2+10, 2));
|
||||
printf("FN %s(%2u) ", ubit_dump(type2+12, 5), bits_to_uint(type2+12, 5));
|
||||
printf("MN %s(%2u) ", ubit_dump(type2+17, 6), bits_to_uint(type2+17, 6));
|
||||
printf("MCC %s(%u) ", ubit_dump(type2+31, 10), bits_to_uint(type2+31, 10));
|
||||
printf("MNC %s(%u)\n", ubit_dump(type2+41, 14), bits_to_uint(type2+41, 14));
|
||||
printf("TMB-SAP SYNC CC %s(0x%02x) ", osmo_ubit_dump(type2+4, 6), bits_to_uint(type2+4, 6));
|
||||
printf("TN %s(%u) ", osmo_ubit_dump(type2+10, 2), bits_to_uint(type2+10, 2));
|
||||
printf("FN %s(%2u) ", osmo_ubit_dump(type2+12, 5), bits_to_uint(type2+12, 5));
|
||||
printf("MN %s(%2u) ", osmo_ubit_dump(type2+17, 6), bits_to_uint(type2+17, 6));
|
||||
printf("MCC %s(%u) ", osmo_ubit_dump(type2+31, 10), bits_to_uint(type2+31, 10));
|
||||
printf("MNC %s(%u)\n", osmo_ubit_dump(type2+41, 14), bits_to_uint(type2+41, 14));
|
||||
/* obtain information from SYNC PDU */
|
||||
tcd->colour_code = bits_to_uint(type2+4, 6);
|
||||
tcd->time.tn = bits_to_uint(type2+10, 2);
|
||||
|
|
|
@ -56,7 +56,7 @@ void testpdu_init()
|
|||
bitvec_set_uint(&bv, 0, 2); /* Neighbor cell boradcast: not supported */
|
||||
bitvec_set_uint(&bv, 0, 2); /* Cell service level: unknown */
|
||||
bitvec_set_bit(&bv, 0); /* Late entry information */
|
||||
printf("SYNC PDU: %s\n", hexdump(pdu_sync, sizeof(pdu_sync)));
|
||||
printf("SYNC PDU: %s\n", osmo_hexdump(pdu_sync, sizeof(pdu_sync)));
|
||||
|
||||
memset(&bv, 0, sizeof(bv));
|
||||
bv.data = pdu_sysinfo;
|
||||
|
@ -84,7 +84,7 @@ void testpdu_init()
|
|||
bitvec_set_uint(&bv, 0, 14); /* Location Area (18.5.9) */
|
||||
bitvec_set_uint(&bv, 0xFFFF, 16); /* Subscriber Class (18.5.22) */
|
||||
bitvec_set_uint(&bv, 0, 12); /* BS service details (18.5.2) */
|
||||
printf("SYSINFO PDU: %s\n", hexdump(pdu_sysinfo, sizeof(pdu_sysinfo)));
|
||||
printf("SYSINFO PDU: %s\n", osmo_hexdump(pdu_sysinfo, sizeof(pdu_sysinfo)));
|
||||
|
||||
memset(&bv, 0, sizeof(bv));
|
||||
bv.data = pdu_acc_ass;
|
||||
|
@ -95,5 +95,5 @@ void testpdu_init()
|
|||
bitvec_set_uint(&bv, 0, 2); /* DL/UL: common only */
|
||||
bitvec_set_uint(&bv, 0, 6);
|
||||
bitvec_set_uint(&bv, 0, 6);
|
||||
printf("ACCESS-ASSIGN PDU: %s\n", hexdump(pdu_acc_ass, sizeof(pdu_acc_ass)));
|
||||
printf("ACCESS-ASSIGN PDU: %s\n", osmo_hexdump(pdu_acc_ass, sizeof(pdu_acc_ass)));
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ static int rx_tl_sdu(uint8_t *bits, unsigned int len)
|
|||
uint8_t mle_pdisc = bits_to_uint(bits, 3);
|
||||
|
||||
printf("TL-SDU(%s): %s", tetra_get_mle_pdisc_name(mle_pdisc),
|
||||
ubit_dump(bits, len));
|
||||
osmo_ubit_dump(bits, len));
|
||||
switch (mle_pdisc) {
|
||||
case TMLE_PDISC_MM:
|
||||
printf(" %s", tetra_get_mm_pdut_name(bits_to_uint(bits+3, 4), 0));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue