cli: print 'Pco' property in Modem3gpp interface

This commit is contained in:
Ben Chan
2018-08-14 18:12:36 -07:00
parent 930a5879d4
commit b8ab473662

View File

@@ -461,9 +461,11 @@ print_modem_info (void)
/* If available, 3GPP related stuff */
if (ctx->modem_3gpp) {
gchar *facility_locks;
GList *pco_list, *l;
facility_locks = (mm_modem_3gpp_facility_build_string_from_mask (
mm_modem_3gpp_get_enabled_facility_locks (ctx->modem_3gpp)));
pco_list = mm_modem_3gpp_get_pco (ctx->modem_3gpp);
g_print (" -------------------------\n"
" 3GPP | imei: '%s'\n"
" | enabled locks: '%s'\n"
@@ -471,7 +473,8 @@ print_modem_info (void)
" | operator name: '%s'\n"
" | subscription: '%s'\n"
" | registration: '%s'\n"
" | EPS UE mode: '%s'\n",
" | EPS UE mode: '%s'\n"
" | PCO:\n",
VALIDATE_UNKNOWN (mm_modem_3gpp_get_imei (ctx->modem_3gpp)),
facility_locks,
VALIDATE_UNKNOWN (mm_modem_3gpp_get_operator_code (ctx->modem_3gpp)),
@@ -483,7 +486,25 @@ print_modem_info (void)
mm_modem_3gpp_eps_ue_mode_operation_get_string (
mm_modem_3gpp_get_eps_ue_mode_operation (ctx->modem_3gpp)));
for (l = pco_list; l; l = g_list_next (l)) {
MMPco *pco = MM_PCO (l->data);
gchar *pco_data_hex = NULL;
const guint8 *pco_data;
gsize pco_data_size;
pco_data = mm_pco_get_data (pco, &pco_data_size);
if (pco_data)
pco_data_hex = mm_utils_bin2hexstr (pco_data, pco_data_size);
g_print (" | %u: (%s) '%s'\n",
mm_pco_get_session_id (pco),
mm_pco_is_complete (pco) ? "complete" : "partial",
pco_data_hex ? pco_data_hex : "");
g_free (pco_data_hex);
}
g_free (facility_locks);
mm_pco_list_free (pco_list);
}
/* If available, CDMA related stuff */