Skip to content

Commit

Permalink
NR RRC: fix dissection of MeasTriggerQuantityOffset element
Browse files Browse the repository at this point in the history
  • Loading branch information
pquantin committed Jul 4, 2021
1 parent f54efc5 commit aa5df68
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
6 changes: 3 additions & 3 deletions epan/dissectors/asn1/nr-rrc/nr-rrc.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -1495,13 +1495,13 @@ SINR-RangeEUTRA DISPLAY=BASE_CUSTOM STRINGS=CF_FUNC(nr_rrc_SINR_RangeEUTRA_fmt)
MsgA-PUSCH-Config-r16/msgA-DeltaPreamble-r16 DISPLAY=BASE_DEC|BASE_UNIT_STRING STRINGS=&units_decibels

#.TYPE_ATTR
MeasTriggerQuantityOffset/rsrp DISPLAY=BASE_DEC|BASE_UNIT_STRING STRINGS=&units_dbm
MeasTriggerQuantityOffset/rsrp DISPLAY=BASE_CUSTOM STRINGS=CF_FUNC(nr_rrc_MeasTriggerQuantityOffset_fmt)

#.TYPE_ATTR
MeasTriggerQuantityOffset/rsrq DISPLAY=BASE_DEC|BASE_UNIT_STRING STRINGS=&units_decibels
MeasTriggerQuantityOffset/rsrq DISPLAY=BASE_CUSTOM STRINGS=CF_FUNC(nr_rrc_MeasTriggerQuantityOffset_fmt)

#.TYPE_ATTR
MeasTriggerQuantityOffset/sinr DISPLAY=BASE_DEC|BASE_UNIT_STRING STRINGS=&units_decibels
MeasTriggerQuantityOffset/sinr DISPLAY=BASE_CUSTOM STRINGS=CF_FUNC(nr_rrc_MeasTriggerQuantityOffset_fmt)

#.TYPE_ATTR
ReselectionThreshold DISPLAY=BASE_CUSTOM STRINGS=CF_FUNC(nr_rrc_ReselectionThreshold_fmt)
Expand Down
8 changes: 8 additions & 0 deletions epan/dissectors/asn1/nr-rrc/packet-nr-rrc-template.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,14 @@ nr_rrc_SRS_RSRP_r16_fmt(gchar *s, guint32 v)
}
}

static void
nr_rrc_MeasTriggerQuantityOffset_fmt(gchar *s, guint32 v)
{
gint32 d = (gint32)v;

g_snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB (%d)", (float)d/2, d);
}

#include "packet-nr-rrc-fn.c"

int
Expand Down
22 changes: 15 additions & 7 deletions epan/dissectors/packet-nr-rrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9337,6 +9337,14 @@ nr_rrc_SRS_RSRP_r16_fmt(gchar *s, guint32 v)
}
}

static void
nr_rrc_MeasTriggerQuantityOffset_fmt(gchar *s, guint32 v)
{
gint32 d = (gint32)v;

g_snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB (%d)", (float)d/2, d);
}


/*--- Included file: packet-nr-rrc-fn.c ---*/
#line 1 "./asn1/nr-rrc/packet-nr-rrc-fn.c"
Expand Down Expand Up @@ -90318,7 +90326,7 @@ static int dissect_UE_NR_Capability_v15c0_PDU(tvbuff_t *tvb _U_, packet_info *pi


/*--- End of included file: packet-nr-rrc-fn.c ---*/
#line 524 "./asn1/nr-rrc/packet-nr-rrc-template.c"
#line 532 "./asn1/nr-rrc/packet-nr-rrc-template.c"

int
dissect_nr_rrc_nr_RLF_Report_r16_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
Expand Down Expand Up @@ -103755,15 +103763,15 @@ proto_register_nr_rrc(void) {
"SINR_Range", HFILL }},
{ &hf_nr_rrc_measTriggerQuantityOffset_rsrp,
{ "rsrp", "nr-rrc.measTriggerQuantityOffset.rsrp",
FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
FT_INT32, BASE_CUSTOM, CF_FUNC(nr_rrc_MeasTriggerQuantityOffset_fmt), 0,
"INTEGER_M30_30", HFILL }},
{ &hf_nr_rrc_measTriggerQuantityOffset_rsrq,
{ "rsrq", "nr-rrc.measTriggerQuantityOffset.rsrq",
FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_decibels, 0,
FT_INT32, BASE_CUSTOM, CF_FUNC(nr_rrc_MeasTriggerQuantityOffset_fmt), 0,
"INTEGER_M30_30", HFILL }},
{ &hf_nr_rrc_measTriggerQuantityOffset_sinr,
{ "sinr", "nr-rrc.measTriggerQuantityOffset.sinr",
FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_decibels, 0,
FT_INT32, BASE_CUSTOM, CF_FUNC(nr_rrc_MeasTriggerQuantityOffset_fmt), 0,
"INTEGER_M30_30", HFILL }},
{ &hf_nr_rrc_measReportQuantity_rsrp,
{ "rsrp", "nr-rrc.measReportQuantity.rsrp",
Expand Down Expand Up @@ -114687,7 +114695,7 @@ proto_register_nr_rrc(void) {
"T_sl_Rx_256QAM_r16_01", HFILL }},

/*--- End of included file: packet-nr-rrc-hfarr.c ---*/
#line 556 "./asn1/nr-rrc/packet-nr-rrc-template.c"
#line 564 "./asn1/nr-rrc/packet-nr-rrc-template.c"

{ &hf_nr_rrc_serialNumber_gs,
{ "Geographical Scope", "nr-rrc.serialNumber.gs",
Expand Down Expand Up @@ -117248,7 +117256,7 @@ proto_register_nr_rrc(void) {
&ett_nr_rrc_T_csi_ReportSidelink_r16,

/*--- End of included file: packet-nr-rrc-ettarr.c ---*/
#line 694 "./asn1/nr-rrc/packet-nr-rrc-template.c"
#line 702 "./asn1/nr-rrc/packet-nr-rrc-template.c"
&ett_nr_rrc_DedicatedNAS_Message,
&ett_nr_rrc_targetRAT_MessageContainer,
&ett_nr_rrc_nas_Container,
Expand Down Expand Up @@ -117338,7 +117346,7 @@ proto_register_nr_rrc(void) {


/*--- End of included file: packet-nr-rrc-dis-reg.c ---*/
#line 763 "./asn1/nr-rrc/packet-nr-rrc-template.c"
#line 771 "./asn1/nr-rrc/packet-nr-rrc-template.c"

nr_rrc_etws_cmas_dcs_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(),
g_direct_hash, g_direct_equal);
Expand Down

0 comments on commit aa5df68

Please sign in to comment.