diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-06 13:38:36 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-12 20:16:00 +0000 |
commit | 0a5176ff814881b91c1ec66e528231ad237289b2 (patch) | |
tree | 18cbb09a3b0c41119d0f8350c86f019786969369 | |
parent | c3c72773646c84e2eca831edda7cb5621ee04f70 (diff) |
libmbim-glib: implement 'Base Stations Info v3'
-rw-r--r-- | data/mbim-service-ms-basic-connect-extensions-v3.json | 101 | ||||
-rwxr-xr-x | docs/reference/libmbim-glib/libmbim-glib-common.sections | 10 | ||||
-rw-r--r-- | src/libmbim-glib/mbim-enums.h | 68 | ||||
-rw-r--r-- | src/mbimcli/mbimcli-ms-basic-connect-extensions.c | 190 |
4 files changed, 327 insertions, 42 deletions
diff --git a/data/mbim-service-ms-basic-connect-extensions-v3.json b/data/mbim-service-ms-basic-connect-extensions-v3.json index 85b53d6..497ae70 100644 --- a/data/mbim-service-ms-basic-connect-extensions-v3.json +++ b/data/mbim-service-ms-basic-connect-extensions-v3.json @@ -51,5 +51,104 @@ "public-format" : "MbimCompression" }, { "name" : "AuthProtocol", "format" : "guint32", - "public-format" : "MbimAuthProtocol" } ] } + "public-format" : "MbimAuthProtocol" } ] }, + + // ********************************************************************************* + { "name" : "MbimCellInfoServingNr", + "type" : "Struct", + "since" : "1.28", + "contents" : [ { "name" : "ProviderId", + "format" : "string" }, + { "name" : "Nci", + "format" : "guint64" }, + { "name" : "PhysicalCellID", + "format" : "guint32" }, + { "name" : "Nrarfcn", + "format" : "guint32" }, + { "name" : "Tac", + "format" : "guint32" }, + { "name" : "Rsrp", + "format" : "guint32" }, + { "name" : "Rsrq", + "format" : "guint32" }, + { "name" : "Sinr", + "format" : "guint32" }, + { "name" : "TimingAdvance", + "format" : "guint64" } ] }, + + { "name" : "MbimCellInfoNeighboringNr", + "type" : "Struct", + "since" : "1.28", + "contents" : [ { "name" : "SystemSubType", + "format" : "guint32", + "public-format" : "MbimDataSubclass" }, + { "name" : "ProviderId", + "format" : "string" }, + { "name" : "CellId", + "format" : "string" }, + { "name" : "PhysicalCellID", + "format" : "guint32" }, + { "name" : "Tac", + "format" : "guint32" }, + { "name" : "Rsrp", + "format" : "guint32" }, + { "name" : "Rsrq", + "format" : "guint32" }, + { "name" : "Sinr", + "format" : "guint32" } ] }, + + { "name" : "Base Stations Info", + "type" : "Command", + "since" : "1.28", + "query" : [ { "name" : "MaxGsmCount", + "format" : "guint32" }, + { "name" : "MaxUmtsCount", + "format" : "guint32" }, + { "name" : "MaxTdscdmaCount", + "format" : "guint32" }, + { "name" : "MaxLteCount", + "format" : "guint32" }, + { "name" : "MaxCdmaCount", + "format" : "guint32" }, + { "name" : "MaxNrCount", + "format" : "guint32" } ], + "response" : [ { "name" : "SystemType", + "format" : "guint32", + "public-format" : "MbimDataClassV2" }, + { "name" : "SystemSubType", + "format" : "guint32", + "public-format" : "MbimDataSubclass" }, + { "name" : "GsmServingCell", + "format" : "ms-struct", + "struct-type" : "MbimCellInfoServingGsm" }, + { "name" : "UmtsServingCell", + "format" : "ms-struct", + "struct-type" : "MbimCellInfoServingUmts" }, + { "name" : "TdscdmaServingCell", + "format" : "ms-struct", + "struct-type" : "MbimCellInfoServingTdscdma" }, + { "name" : "LteServingCell", + "format" : "ms-struct", + "struct-type" : "MbimCellInfoServingLte" }, + { "name" : "GsmNeighboringCells", + "format" : "ms-struct-array", + "struct-type" : "MbimCellInfoNeighboringGsm" }, + { "name" : "UmtsNeighboringCells", + "format" : "ms-struct-array", + "struct-type" : "MbimCellInfoNeighboringUmts" }, + { "name" : "TdscdmaNeighboringCells", + "format" : "ms-struct-array", + "struct-type" : "MbimCellInfoNeighboringTdscdma" }, + { "name" : "LteNeighboringCells", + "format" : "ms-struct-array", + "struct-type" : "MbimCellInfoNeighboringLte" }, + { "name" : "CdmaCells", + "format" : "ms-struct-array", + "struct-type" : "MbimCellInfoCdma" }, + { "name" : "NrServingCells", + "format" : "ms-struct-array", + "struct-type" : "MbimCellInfoServingNr" }, + { "name" : "NrNeighborCells", + "format" : "ms-struct-array", + "struct-type" : "MbimCellInfoNeighboringNr" } ] } ] diff --git a/docs/reference/libmbim-glib/libmbim-glib-common.sections b/docs/reference/libmbim-glib/libmbim-glib-common.sections index d457e45..ddc3b1a 100755 --- a/docs/reference/libmbim-glib/libmbim-glib-common.sections +++ b/docs/reference/libmbim-glib/libmbim-glib-common.sections @@ -378,6 +378,8 @@ MbimDefaultPduActivationHint MbimLadnInfo MbimDrxCycle MbimSubscriberReadyStatusFlag +MbimDataClassV2 +MbimDataSublass <SUBSECTION Methods> mbim_device_type_get_string mbim_cellular_class_build_string_from_mask @@ -459,6 +461,8 @@ mbim_default_pdu_activation_hint_get_string mbim_ladn_info_get_string mbim_drx_cycle_get_string mbim_subscriber_ready_status_flag_build_string_from_mask +mbim_data_class_v2_build_string_from_mask +mbim_data_subclass_build_string_from_mask <SUBSECTION Private> mbim_device_type_build_string_from_mask mbim_cellular_class_get_string @@ -542,6 +546,8 @@ mbim_default_pdu_activation_hint_build_string_from_mask mbim_ladn_info_build_string_from_mask mbim_drx_cycle_build_string_from_mask mbim_subscriber_ready_status_flag_get_string +mbim_data_class_v2_get_string +mbim_data_subclass_get_string <SUBSECTION Standard> MBIM_TYPE_ACTIVATION_COMMAND MBIM_TYPE_ACTIVATION_STATE @@ -628,6 +634,8 @@ MBIM_TYPE_DEFAULT_PDU_ACTIVATION_HINT MBIM_TYPE_LADN_INFO MBIM_TYPE_DRX_CYCLE MBIM_TYPE_SUBSCRIBER_READY_STATUS_FLAG +MBIM_TYPE_DATA_CLASS_V2 +MBIM_TYPE_DATA_SUBCLASS mbim_activation_command_get_type mbim_activation_state_get_type mbim_auth_protocol_get_type @@ -713,6 +721,8 @@ mbim_default_pdu_activation_hint_get_type mbim_ladn_info_get_type mbim_drx_cycle_get_type mbim_subscriber_ready_status_flag_get_type +mbim_data_class_v2_get_type +mbim_data_subclass_get_type </SECTION> <SECTION> diff --git a/src/libmbim-glib/mbim-enums.h b/src/libmbim-glib/mbim-enums.h index d8476a4..3dce065 100644 --- a/src/libmbim-glib/mbim-enums.h +++ b/src/libmbim-glib/mbim-enums.h @@ -1638,6 +1638,74 @@ typedef enum { /*< since=1.28 >*/ MBIM_SUBSCRIBER_READY_STATUS_FLAG_SIM_REMOVABLE = 1 << 2, } MbimSubscriberReadyStatusFlag; +/*****************************************************************************/ +/* 'Base Stations Info v3' enums */ + +/** + * MbimDataClassV2: + * @MBIM_DATA_CLASS_V2_GPRS: GPRS. + * @MBIM_DATA_CLASS_V2_EDGE: EDGE. + * @MBIM_DATA_CLASS_V2_UMTS: UMTS. + * @MBIM_DATA_CLASS_V2_HSDPA: HSDPA. + * @MBIM_DATA_CLASS_V2_HSUPA: HSUPA. + * @MBIM_DATA_CLASS_V2_LTE: LTE. + * @MBIM_DATA_CLASS_V2_5G: 5G. + * @MBIM_DATA_CLASS_V2_1XRTT: 1xRTT. + * @MBIM_DATA_CLASS_V2_1XEVDO: 1xEV-DO. + * @MBIM_DATA_CLASS_V2_1XEVDO_REVA: 1xEV-DO RevA + * @MBIM_DATA_CLASS_V2_1XEVDV: 1xEV-DV. + * @MBIM_DATA_CLASS_V2_3XRTT: 3xRTT. + * @MBIM_DATA_CLASS_V2_1XEVDO_REVB: 1xEV-DO RevB. + * @MBIM_DATA_CLASS_V2_UMB: UMB. + * @MBIM_DATA_CLASS_V2_CUSTOM: Custom. + * + * Data class update in MBIMEx v3.0. + * + * There is now a single flag for 5G, and the new #MbimDataSubclass helps to + * identify the specific 5G setup. + * + * Since: 1.28 + */ +typedef enum { /*< since=1.28 >*/ + MBIM_DATA_CLASS_V2_GPRS = 1 << 0, + MBIM_DATA_CLASS_V2_EDGE = 1 << 1, + MBIM_DATA_CLASS_V2_UMTS = 1 << 2, + MBIM_DATA_CLASS_V2_HSDPA = 1 << 3, + MBIM_DATA_CLASS_V2_HSUPA = 1 << 4, + MBIM_DATA_CLASS_V2_LTE = 1 << 5, + MBIM_DATA_CLASS_V2_5G = 1 << 6, + /* Bit 7 unused, bits 8 to 15 reserved for future 3GPP classes */ + MBIM_DATA_CLASS_V2_1XRTT = 1 << 16, + MBIM_DATA_CLASS_V2_1XEVDO = 1 << 17, + MBIM_DATA_CLASS_V2_1XEVDO_REVA = 1 << 18, + MBIM_DATA_CLASS_V2_1XEVDV = 1 << 19, + MBIM_DATA_CLASS_V2_3XRTT = 1 << 20, + MBIM_DATA_CLASS_V2_1XEVDO_REVB = 1 << 21, + MBIM_DATA_CLASS_V2_UMB = 1 << 22, + /* Bits 23 to 30 reserved for future 3GPP2 classes */ + MBIM_DATA_CLASS_V2_CUSTOM = 1 << 31 +} MbimDataClassV2; + +/** + * MbimDataSubclass: + * @MBIM_DATA_SUBCLASS_NONE: No data subclass. + * @MBIM_DATA_SUBCLASS_5G_ENDC: EUTRAN and NR dual connectivity as in 5G option 3. + * @MBIM_DATA_SUBCLASS_5G_NR: Standalone NR as in 5G option 2. + * @MBIM_DATA_SUBCLASS_5G_NEDC: NR and EUTRAN dual connectivity as in 5G option 4. + * @MBIM_DATA_SUBCLASS_5G_ELTE: eLTE as in 5G option 5. + * @MBIM_DATA_SUBCLASS_5G_NGENDC: Next-gen eLTE and NR dual connectivity as in 5G option 7. + * + * Flags specifying the data subclass. + */ +typedef enum { /*< since=1.28 >*/ + MBIM_DATA_SUBCLASS_NONE = 0, + MBIM_DATA_SUBCLASS_5G_ENDC = 1 << 0, + MBIM_DATA_SUBCLASS_5G_NR = 1 << 1, + MBIM_DATA_SUBCLASS_5G_NEDC = 1 << 2, + MBIM_DATA_SUBCLASS_5G_ELTE = 1 << 3, + MBIM_DATA_SUBCLASS_5G_NGENDC = 1 << 4, +} MbimDataSubclass; + G_END_DECLS #endif /* _LIBMBIM_GLIB_MBIM_ENUMS_H_ */ diff --git a/src/mbimcli/mbimcli-ms-basic-connect-extensions.c b/src/mbimcli/mbimcli-ms-basic-connect-extensions.c index 515d71c..b6face8 100644 --- a/src/mbimcli/mbimcli-ms-basic-connect-extensions.c +++ b/src/mbimcli/mbimcli-ms-basic-connect-extensions.c @@ -1074,7 +1074,8 @@ query_base_stations_ready (MbimDevice *device, g_autoptr(MbimMessage) response = NULL; g_autoptr(GError) error = NULL; MbimDataClass system_type; - g_autofree gchar *system_type_str = NULL; + MbimDataClassV2 system_type_v2; + MbimDataSubclass system_subtype; g_autoptr(MbimCellInfoServingGsm) gsm_serving_cell = NULL; g_autoptr(MbimCellInfoServingUmts) umts_serving_cell = NULL; g_autoptr(MbimCellInfoServingTdscdma) tdscdma_serving_cell = NULL; @@ -1089,6 +1090,10 @@ query_base_stations_ready (MbimDevice *device, g_autoptr(MbimCellInfoNeighboringLteArray) lte_neighboring_cells = NULL; guint32 cdma_cells_count; g_autoptr(MbimCellInfoCdmaArray) cdma_cells = NULL; + guint32 nr_serving_cells_count; + g_autoptr(MbimCellInfoServingNrArray) nr_serving_cells = NULL; + guint32 nr_neighboring_cells_count; + g_autoptr(MbimCellInfoNeighboringNrArray) nr_neighboring_cells = NULL; response = mbim_device_command_finish (device, res, &error); if (!response || !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) { @@ -1097,27 +1102,62 @@ query_base_stations_ready (MbimDevice *device, return; } - if (!mbim_message_ms_basic_connect_extensions_base_stations_info_response_parse ( - response, - &system_type, - &gsm_serving_cell, - &umts_serving_cell, - &tdscdma_serving_cell, - <e_serving_cell, - &gsm_neighboring_cells_count, - &gsm_neighboring_cells, - &umts_neighboring_cells_count, - &umts_neighboring_cells, - &tdscdma_neighboring_cells_count, - &tdscdma_neighboring_cells, - <e_neighboring_cells_count, - <e_neighboring_cells, - &cdma_cells_count, - &cdma_cells, - &error)) { - g_printerr ("error: couldn't parse response message: %s\n", error->message); - shutdown (FALSE); - return; + /* MBIMEx 3.0 support */ + if (mbim_device_check_ms_mbimex_version (device, 3, 0)) { + if (!mbim_message_ms_basic_connect_extensions_v3_base_stations_info_response_parse ( + response, + &system_type_v2, + &system_subtype, + &gsm_serving_cell, + &umts_serving_cell, + &tdscdma_serving_cell, + <e_serving_cell, + &gsm_neighboring_cells_count, + &gsm_neighboring_cells, + &umts_neighboring_cells_count, + &umts_neighboring_cells, + &tdscdma_neighboring_cells_count, + &tdscdma_neighboring_cells, + <e_neighboring_cells_count, + <e_neighboring_cells, + &cdma_cells_count, + &cdma_cells, + &nr_serving_cells_count, + &nr_serving_cells, + &nr_neighboring_cells_count, + &nr_neighboring_cells, + &error)) { + g_printerr ("error: couldn't parse response message: %s\n", error->message); + shutdown (FALSE); + return; + } + g_debug ("Successfully parsed response as MBIMEx 3.0 Base Stations Info"); + } + /* MBIMEx 1.0 support */ + else { + if (!mbim_message_ms_basic_connect_extensions_base_stations_info_response_parse ( + response, + &system_type, + &gsm_serving_cell, + &umts_serving_cell, + &tdscdma_serving_cell, + <e_serving_cell, + &gsm_neighboring_cells_count, + &gsm_neighboring_cells, + &umts_neighboring_cells_count, + &umts_neighboring_cells, + &tdscdma_neighboring_cells_count, + &tdscdma_neighboring_cells, + <e_neighboring_cells_count, + <e_neighboring_cells, + &cdma_cells_count, + &cdma_cells, + &error)) { + g_printerr ("error: couldn't parse response message: %s\n", error->message); + shutdown (FALSE); + return; + } + g_debug ("Successfully parsed response as MBIMEx 1.0 Base Stations Info"); } #define PRINT_VALIDATED_UINT(number, invalid, format, units) do { \ @@ -1127,6 +1167,13 @@ query_base_stations_ready (MbimDevice *device, g_print ("%s: %u%s\n", format, number, units ? units : ""); \ } while (0) +#define PRINT_VALIDATED_UINT64(number, invalid, format, units) do { \ + if (number == invalid) \ + g_print ("%s: unknown\n", format); \ + else \ + g_print ("%s: %" G_GUINT64_FORMAT "%s\n", format, number, units ? units : ""); \ + } while (0) + #define PRINT_VALIDATED_INT(number, invalid, format, units) do { \ if (number == (gint32)invalid) \ g_print ("%s: unknown\n", format); \ @@ -1134,26 +1181,40 @@ query_base_stations_ready (MbimDevice *device, g_print ("%s: %d%s\n", format, number, units ? units : ""); \ } while (0) -#define PRINT_VALIDATED_RX_LEVEL(number, format) do { \ - if (number == 0xFFFFFFFF) \ - g_print ("%s: unknown\n", format); \ - else \ - g_print ("%s: %d dBm\n", format, (gint32)number - 110); \ +#define PRINT_VALIDATED_SCALED_UINT(number, invalid, scale, format, units) do { \ + if (number == 0xFFFFFFFF) \ + g_print ("%s: unknown\n", format); \ + else \ + g_print ("%s: %d%s\n", format, ((gint32)number) + scale, units ? units : ""); \ } while (0) - system_type_str = mbim_data_class_build_string_from_mask (system_type); - g_print ("System type: %s\n", system_type_str); + + + if (mbim_device_check_ms_mbimex_version (device, 3, 0)) { + g_autofree gchar *system_type_str = NULL; + g_autofree gchar *system_subtype_str = NULL; + + system_type_str = mbim_data_class_v2_build_string_from_mask (system_type_v2); + g_print ("System type: %s\n", system_type_str); + system_subtype_str = mbim_data_subclass_build_string_from_mask (system_subtype); + g_print ("System subtype: %s\n", VALIDATE_UNKNOWN (system_subtype_str)); + } else { + g_autofree gchar *system_type_str = NULL; + + system_type_str = mbim_data_class_build_string_from_mask (system_type); + g_print ("System type: %s\n", system_type_str); + } if (gsm_serving_cell) { g_print ("GSM serving cell:\n" "\t Provider id: %s\n", VALIDATE_UNKNOWN (gsm_serving_cell->provider_id)); - PRINT_VALIDATED_UINT (gsm_serving_cell->location_area_code, 0xFFFFFFFF, "\t LAC", NULL); - PRINT_VALIDATED_UINT (gsm_serving_cell->cell_id, 0xFFFFFFFF, "\t Cell ID", NULL); - PRINT_VALIDATED_UINT (gsm_serving_cell->timing_advance, 0xFFFFFFFF, "\t Timing advance", " bit periods"); - PRINT_VALIDATED_UINT (gsm_serving_cell->arfcn, 0xFFFFFFFF, "\t ARFCN", NULL); - PRINT_VALIDATED_UINT (gsm_serving_cell->base_station_id, 0xFFFFFFFF, "\tBase station ID", NULL); - PRINT_VALIDATED_RX_LEVEL (gsm_serving_cell->rx_level, "\t Rx level"); + PRINT_VALIDATED_UINT (gsm_serving_cell->location_area_code, 0xFFFFFFFF, "\t LAC", NULL); + PRINT_VALIDATED_UINT (gsm_serving_cell->cell_id, 0xFFFFFFFF, "\t Cell ID", NULL); + PRINT_VALIDATED_UINT (gsm_serving_cell->timing_advance, 0xFFFFFFFF, "\t Timing advance", " bit periods"); + PRINT_VALIDATED_UINT (gsm_serving_cell->arfcn, 0xFFFFFFFF, "\t ARFCN", NULL); + PRINT_VALIDATED_UINT (gsm_serving_cell->base_station_id, 0xFFFFFFFF, "\tBase station ID", NULL); + PRINT_VALIDATED_SCALED_UINT (gsm_serving_cell->rx_level, 0xFFFFFFFF, -110, "\t Rx level", " dBm"); } else g_print ("GSM serving cell: n/a\n"); @@ -1166,11 +1227,11 @@ query_base_stations_ready (MbimDevice *device, "\t\t Provider id: %s\n", i + 1, VALIDATE_UNKNOWN (gsm_neighboring_cells[i]->provider_id)); - PRINT_VALIDATED_UINT (gsm_neighboring_cells[i]->location_area_code, 0xFFFFFFFF, "\t\t LAC", NULL); - PRINT_VALIDATED_UINT (gsm_neighboring_cells[i]->cell_id, 0xFFFFFFFF, "\t\t Cell ID", NULL); - PRINT_VALIDATED_UINT (gsm_neighboring_cells[i]->arfcn, 0xFFFFFFFF, "\t\t ARFCN", NULL); - PRINT_VALIDATED_UINT (gsm_neighboring_cells[i]->base_station_id, 0xFFFFFFFF, "\t\tBase station ID", NULL); - PRINT_VALIDATED_RX_LEVEL (gsm_neighboring_cells[i]->rx_level, "\t\t Rx level"); + PRINT_VALIDATED_UINT (gsm_neighboring_cells[i]->location_area_code, 0xFFFFFFFF, "\t\t LAC", NULL); + PRINT_VALIDATED_UINT (gsm_neighboring_cells[i]->cell_id, 0xFFFFFFFF, "\t\t Cell ID", NULL); + PRINT_VALIDATED_UINT (gsm_neighboring_cells[i]->arfcn, 0xFFFFFFFF, "\t\t ARFCN", NULL); + PRINT_VALIDATED_UINT (gsm_neighboring_cells[i]->base_station_id, 0xFFFFFFFF, "\t\tBase station ID", NULL); + PRINT_VALIDATED_SCALED_UINT (gsm_neighboring_cells[i]->rx_level, 0xFFFFFFFF, -110, "\t\t Rx level", " dBm"); } } else g_print ("Neighboring GSM cells: n/a\n"); @@ -1307,7 +1368,54 @@ query_base_stations_ready (MbimDevice *device, } else g_print ("CDMA cells: n/a\n"); -#undef PRINT_VALIDATED_RX_LEVEL + if (nr_serving_cells_count && nr_serving_cells) { + guint i; + + g_print ("Serving NR cells: %d\n", nr_serving_cells_count); + for (i = 0; i < nr_serving_cells_count; i++) { + g_print ("\tServing cell [%u]:\n" + "\t\t Provider id: %s\n", + i + 1, + VALIDATE_UNKNOWN (nr_serving_cells[i]->provider_id)); + PRINT_VALIDATED_UINT64 (nr_serving_cells[i]->nci, 0xFFFFFFFFFFFFFFFF, "\t\t NCI", NULL); + PRINT_VALIDATED_UINT (nr_serving_cells[i]->physical_cell_id, 0xFFFFFFFF, "\t\tPhysical cell id", NULL); + PRINT_VALIDATED_UINT (nr_serving_cells[i]->nrarfcn, 0xFFFFFFFF, "\t\t NRARFCN", NULL); + PRINT_VALIDATED_UINT (nr_serving_cells[i]->tac, 0xFFFFFFFF, "\t\t TAC", NULL); + PRINT_VALIDATED_SCALED_UINT (nr_serving_cells[i]->rsrp, 0xFFFFFFFF, -156, "\t\t RSRP", " dBm"); + PRINT_VALIDATED_SCALED_UINT (nr_serving_cells[i]->rsrq, 0xFFFFFFFF, -43, "\t\t RSRQ", " dB"); + PRINT_VALIDATED_SCALED_UINT (nr_serving_cells[i]->sinr, 0xFFFFFFFF, -23, "\t\t SINR", " dB"); + PRINT_VALIDATED_UINT64 (nr_serving_cells[i]->timing_advance, 0xFFFFFFFFFFFFFFFF, "\t\t Timing advance", " us"); + } + } else + g_print ("Serving NR cells: n/a\n"); + + if (nr_neighboring_cells_count && nr_neighboring_cells) { + guint i; + + g_print ("Neighboring NR cells: %d\n", nr_neighboring_cells_count); + for (i = 0; i < nr_neighboring_cells_count; i++) { + g_autofree gchar *system_subtype_str = NULL; + + system_subtype_str = mbim_data_subclass_build_string_from_mask (nr_neighboring_cells[i]->system_sub_type); + g_print ("\tNeighboring cell [%u]:\n" + "\t\t System subtype: %s\n" + "\t\t Provider id: %s\n" + "\t\t Cell id: %s\n", + i + 1, + VALIDATE_UNKNOWN (system_subtype_str), + VALIDATE_UNKNOWN (nr_neighboring_cells[i]->provider_id), + VALIDATE_UNKNOWN (nr_neighboring_cells[i]->cell_id)); + PRINT_VALIDATED_UINT (nr_neighboring_cells[i]->physical_cell_id, 0xFFFFFFFF, "\t\tPhysical cell id", NULL); + PRINT_VALIDATED_UINT (nr_neighboring_cells[i]->tac, 0xFFFFFFFF, "\t\t TAC", NULL); + PRINT_VALIDATED_SCALED_UINT (nr_neighboring_cells[i]->rsrp, 0xFFFFFFFF, -156, "\t\t RSRP", " dBm"); + PRINT_VALIDATED_SCALED_UINT (nr_neighboring_cells[i]->rsrq, 0xFFFFFFFF, -43, "\t\t RSRQ", " dB"); + PRINT_VALIDATED_SCALED_UINT (nr_neighboring_cells[i]->sinr, 0xFFFFFFFF, -23, "\t\t SINR", " dB"); + } + } else + g_print ("Neighboring NR cells: n/a\n"); + +#undef PRINT_VALIDATED_SCALED_UINT +#undef PRINT_VALIDATED_UINT64 #undef PRINT_VALIDATED_UINT #undef PRINT_VALIDATED_INT |