api,modem: new Modem3gpp.ProfileManager interface

This new interface allows modems to expose the list of available
connection profiles stored in the device and edit or delete them; as
long as the underlying device/protocol allows it.
This commit is contained in:
Aleksander Morgado
2021-04-03 21:19:54 +02:00
parent 793370f2f8
commit 2d43ea48e1
21 changed files with 1736 additions and 272 deletions

View File

@@ -19,6 +19,7 @@ mmcli_SOURCES = \
mmcli-manager.c \
mmcli-modem.c \
mmcli-modem-3gpp.c \
mmcli-modem-3gpp-profile-manager.c \
mmcli-modem-3gpp-ussd.c \
mmcli-modem-cdma.c \
mmcli-modem-simple.c \

View File

@@ -0,0 +1,373 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* mmcli -- Control modem status & access information from the command line
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2021 Aleksander Morgado <aleksander@aleksander.es>
* Copyright (C) 2021 Google, Inc.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#define _LIBMM_INSIDE_MMCLI
#include <libmm-glib.h>
#include "mmcli.h"
#include "mmcli-common.h"
#include "mmcli-output.h"
/* Context */
typedef struct {
MMManager *manager;
GCancellable *cancellable;
MMObject *object;
MMModem3gppProfileManager *modem_3gpp_profile_manager;
} Context;
static Context *ctx;
/* Options */
static gboolean list_flag;
static gchar *set_str;
static gint delete_int = MM_3GPP_PROFILE_ID_UNKNOWN;
static GOptionEntry entries[] = {
{ "3gpp-profile-manager-list", 0, 0, G_OPTION_ARG_NONE, &list_flag,
"List available profiles",
NULL
},
{ "3gpp-profile-manager-set", 0, 0, G_OPTION_ARG_STRING, &set_str,
"Create or update a profile with the given settings.",
"[\"key=value,...\"]"
},
{ "3gpp-profile-manager-delete", 0, 0, G_OPTION_ARG_INT, &delete_int,
"Delete the profile with the given ID",
"[Profile ID]"
},
{ NULL }
};
GOptionGroup *
mmcli_modem_3gpp_profile_manager_get_option_group (void)
{
GOptionGroup *group;
group = g_option_group_new ("3gpp-profile-manager",
"3GPP profile management options:",
"Show 3GPP profile management related options",
NULL,
NULL);
g_option_group_add_entries (group, entries);
return group;
}
gboolean
mmcli_modem_3gpp_profile_manager_options_enabled (void)
{
static guint n_actions = 0;
static gboolean checked = FALSE;
if (checked)
return !!n_actions;
n_actions = (list_flag +
!!set_str +
(delete_int != MM_3GPP_PROFILE_ID_UNKNOWN));
if (n_actions > 1) {
g_printerr ("error: too many 3GPP profile management actions requested\n");
exit (EXIT_FAILURE);
}
checked = TRUE;
return !!n_actions;
}
static void
context_free (void)
{
if (!ctx)
return;
if (ctx->cancellable)
g_object_unref (ctx->cancellable);
if (ctx->modem_3gpp_profile_manager)
g_object_unref (ctx->modem_3gpp_profile_manager);
if (ctx->object)
g_object_unref (ctx->object);
if (ctx->manager)
g_object_unref (ctx->manager);
g_free (ctx);
}
static void
ensure_modem_3gpp_profile_manager (void)
{
if (mm_modem_get_state (mm_object_peek_modem (ctx->object)) < MM_MODEM_STATE_ENABLED) {
g_printerr ("error: modem not enabled yet\n");
exit (EXIT_FAILURE);
}
if (!ctx->modem_3gpp_profile_manager) {
g_printerr ("error: modem has no 3GPP profile management capabilities\n");
exit (EXIT_FAILURE);
}
/* Success */
}
void
mmcli_modem_3gpp_profile_manager_shutdown (void)
{
context_free ();
}
static void
delete_process_reply (gboolean result,
const GError *error)
{
if (error) {
g_printerr ("error: couldn't delete profile: '%s'\n", error->message);
exit (EXIT_FAILURE);
}
g_print ("successfully deleted the profile\n");
}
static void
delete_ready (MMModem3gppProfileManager *modem_3gpp_profile_manager,
GAsyncResult *result)
{
gboolean operation_result;
GError *error = NULL;
operation_result = mm_modem_3gpp_profile_manager_delete_finish (modem_3gpp_profile_manager, result, &error);
delete_process_reply (operation_result, error);
mmcli_async_operation_done ();
}
static void
set_process_reply (MM3gppProfile *stored,
const GError *error)
{
if (error) {
g_printerr ("error: couldn't set profile: '%s'\n", error->message);
exit (EXIT_FAILURE);
}
mmcli_output_profile_set (stored);
mmcli_output_dump ();
g_object_unref (stored);
}
static void
set_ready (MMModem3gppProfileManager *modem_3gpp_profile_manager,
GAsyncResult *result)
{
MM3gppProfile *stored;
GError *error = NULL;
stored = mm_modem_3gpp_profile_manager_set_finish (modem_3gpp_profile_manager, result, &error);
set_process_reply (stored, error);
mmcli_async_operation_done ();
}
static void
list_process_reply (GList *result,
const GError *error)
{
if (error) {
g_printerr ("error: couldn't list profiles: '%s'\n", error->message);
exit (EXIT_FAILURE);
}
mmcli_output_profile_list (result);
mmcli_output_dump ();
g_list_free_full (result, g_object_unref);
}
static void
list_ready (MMModem3gppProfileManager *modem_3gpp_profile_manager,
GAsyncResult *result)
{
GError *error = NULL;
GList *profiles = NULL;
mm_modem_3gpp_profile_manager_list_finish (modem_3gpp_profile_manager, result, &profiles, &error);
list_process_reply (profiles, error);
mmcli_async_operation_done ();
}
static void
get_modem_ready (GObject *source,
GAsyncResult *result,
gpointer none)
{
ctx->object = mmcli_get_modem_finish (result, &ctx->manager);
ctx->modem_3gpp_profile_manager = mm_object_get_modem_3gpp_profile_manager (ctx->object);
/* Setup operation timeout */
if (ctx->modem_3gpp_profile_manager)
mmcli_force_operation_timeout (G_DBUS_PROXY (ctx->modem_3gpp_profile_manager));
ensure_modem_3gpp_profile_manager ();
/* Request to list? */
if (list_flag) {
g_debug ("Asynchronously listing profiles...");
mm_modem_3gpp_profile_manager_list (ctx->modem_3gpp_profile_manager,
ctx->cancellable,
(GAsyncReadyCallback)list_ready,
NULL);
return;
}
/* Request to set? */
if (set_str) {
GError *error = NULL;
g_autoptr(MM3gppProfile) requested = NULL;
g_debug ("Asynchronously setting profiles...");
requested = mm_3gpp_profile_new_from_string (set_str, &error);
if (!requested) {
g_printerr ("Error parsing profile string: '%s'\n", error->message);
exit (EXIT_FAILURE);
}
mm_modem_3gpp_profile_manager_set (ctx->modem_3gpp_profile_manager,
requested,
ctx->cancellable,
(GAsyncReadyCallback)set_ready,
NULL);
return;
}
/* Request to delete? */
if (delete_int != MM_3GPP_PROFILE_ID_UNKNOWN) {
g_autoptr(MM3gppProfile) profile = NULL;
g_debug ("Asynchronously deleting profile...");
profile = mm_3gpp_profile_new ();
mm_3gpp_profile_set_profile_id (profile, delete_int);
mm_modem_3gpp_profile_manager_delete (ctx->modem_3gpp_profile_manager,
profile,
ctx->cancellable,
(GAsyncReadyCallback)delete_ready,
NULL);
return;
}
g_warn_if_reached ();
}
void
mmcli_modem_3gpp_profile_manager_run_asynchronous (GDBusConnection *connection,
GCancellable *cancellable)
{
/* Initialize context */
ctx = g_new0 (Context, 1);
if (cancellable)
ctx->cancellable = g_object_ref (cancellable);
/* Get proper modem */
mmcli_get_modem (connection,
mmcli_get_common_modem_string (),
cancellable,
(GAsyncReadyCallback)get_modem_ready,
NULL);
}
void
mmcli_modem_3gpp_profile_manager_run_synchronous (GDBusConnection *connection)
{
GError *error = NULL;
/* Initialize context */
ctx = g_new0 (Context, 1);
ctx->object = mmcli_get_modem_sync (connection,
mmcli_get_common_modem_string (),
&ctx->manager);
ctx->modem_3gpp_profile_manager = mm_object_get_modem_3gpp_profile_manager (ctx->object);
/* Setup operation timeout */
if (ctx->modem_3gpp_profile_manager)
mmcli_force_operation_timeout (G_DBUS_PROXY (ctx->modem_3gpp_profile_manager));
ensure_modem_3gpp_profile_manager ();
/* Request to list? */
if (list_flag) {
GList *profiles;
g_debug ("Synchronously listing profiles...");
mm_modem_3gpp_profile_manager_list_sync (ctx->modem_3gpp_profile_manager,
ctx->cancellable,
&profiles,
&error);
list_process_reply (profiles, error);
return;
}
/* Request to set? */
if (set_str) {
g_autoptr(MM3gppProfile) requested = NULL;
MM3gppProfile *stored;
g_debug ("Synchronously setting profile...");
requested = mm_3gpp_profile_new_from_string (set_str, &error);
if (!requested) {
g_printerr ("Error parsing profile string: '%s'\n", error->message);
exit (EXIT_FAILURE);
}
stored = mm_modem_3gpp_profile_manager_set_sync (ctx->modem_3gpp_profile_manager,
requested,
ctx->cancellable,
&error);
set_process_reply (stored, error);
return;
}
/* Request to delete? */
if (delete_int != MM_3GPP_PROFILE_ID_UNKNOWN) {
g_autoptr(MM3gppProfile) profile = NULL;
gboolean result;
g_debug ("Synchronously deleting profile...");
profile = mm_3gpp_profile_new ();
mm_3gpp_profile_set_profile_id (profile, delete_int);
result = mm_modem_3gpp_profile_manager_delete_sync (ctx->modem_3gpp_profile_manager,
profile,
ctx->cancellable,
&error);
delete_process_reply (result, error);
return;
}
g_warn_if_reached ();
}

View File

@@ -33,55 +33,56 @@ typedef struct {
} SectionInfo;
static SectionInfo section_infos[] = {
[MMC_S_MODEM_GENERAL] = { "General" },
[MMC_S_MODEM_HARDWARE] = { "Hardware" },
[MMC_S_MODEM_SYSTEM] = { "System" },
[MMC_S_MODEM_NUMBERS] = { "Numbers" },
[MMC_S_MODEM_STATUS] = { "Status" },
[MMC_S_MODEM_MODES] = { "Modes" },
[MMC_S_MODEM_BANDS] = { "Bands" },
[MMC_S_MODEM_IP] = { "IP" },
[MMC_S_MODEM_3GPP] = { "3GPP" },
[MMC_S_MODEM_3GPP_EPS] = { "3GPP EPS" },
[MMC_S_MODEM_3GPP_SCAN] = { "3GPP scan" },
[MMC_S_MODEM_3GPP_USSD] = { "3GPP USSD" },
[MMC_S_MODEM_CDMA] = { "CDMA" },
[MMC_S_MODEM_SIM] = { "SIM" },
[MMC_S_MODEM_BEARER] = { "Bearer" },
[MMC_S_MODEM_TIME] = { "Time" },
[MMC_S_MODEM_TIMEZONE] = { "Timezone" },
[MMC_S_MODEM_MESSAGING] = { "Messaging" },
[MMC_S_MODEM_SIGNAL] = { "Signal" },
[MMC_S_MODEM_SIGNAL_CDMA1X] = { "CDMA1x" },
[MMC_S_MODEM_SIGNAL_EVDO] = { "EV-DO" },
[MMC_S_MODEM_SIGNAL_GSM] = { "GSM" },
[MMC_S_MODEM_SIGNAL_UMTS] = { "UMTS" },
[MMC_S_MODEM_SIGNAL_LTE] = { "LTE" },
[MMC_S_MODEM_SIGNAL_5G] = { "5G" },
[MMC_S_MODEM_OMA] = { "OMA" },
[MMC_S_MODEM_OMA_CURRENT] = { "Current session" },
[MMC_S_MODEM_OMA_PENDING] = { "Pending sessions" },
[MMC_S_MODEM_LOCATION] = { "Location" },
[MMC_S_MODEM_LOCATION_3GPP] = { "3GPP" },
[MMC_S_MODEM_LOCATION_GPS] = { "GPS" },
[MMC_S_MODEM_LOCATION_CDMABS] = { "CDMA BS" },
[MMC_S_MODEM_FIRMWARE] = { "Firmware" },
[MMC_S_MODEM_FIRMWARE_FASTBOOT] = { "Fastboot settings" },
[MMC_S_MODEM_VOICE] = { "Voice" },
[MMC_S_BEARER_GENERAL] = { "General" },
[MMC_S_BEARER_STATUS] = { "Status" },
[MMC_S_BEARER_PROPERTIES] = { "Properties" },
[MMC_S_BEARER_IPV4_CONFIG] = { "IPv4 configuration" },
[MMC_S_BEARER_IPV6_CONFIG] = { "IPv6 configuration" },
[MMC_S_BEARER_STATS] = { "Statistics" },
[MMC_S_CALL_GENERAL] = { "General" },
[MMC_S_CALL_PROPERTIES] = { "Properties" },
[MMC_S_CALL_AUDIO_FORMAT] = { "Audio format" },
[MMC_S_SMS_GENERAL] = { "General" },
[MMC_S_SMS_CONTENT] = { "Content" },
[MMC_S_SMS_PROPERTIES] = { "Properties" },
[MMC_S_SIM_GENERAL] = { "General" },
[MMC_S_SIM_PROPERTIES] = { "Properties" },
[MMC_S_MODEM_GENERAL] = { "General" },
[MMC_S_MODEM_HARDWARE] = { "Hardware" },
[MMC_S_MODEM_SYSTEM] = { "System" },
[MMC_S_MODEM_NUMBERS] = { "Numbers" },
[MMC_S_MODEM_STATUS] = { "Status" },
[MMC_S_MODEM_MODES] = { "Modes" },
[MMC_S_MODEM_BANDS] = { "Bands" },
[MMC_S_MODEM_IP] = { "IP" },
[MMC_S_MODEM_3GPP] = { "3GPP" },
[MMC_S_MODEM_3GPP_EPS] = { "3GPP EPS" },
[MMC_S_MODEM_3GPP_SCAN] = { "3GPP scan" },
[MMC_S_MODEM_3GPP_USSD] = { "3GPP USSD" },
[MMC_S_MODEM_3GPP_PROFILE_MANAGER] = { "3GPP profile manager" },
[MMC_S_MODEM_CDMA] = { "CDMA" },
[MMC_S_MODEM_SIM] = { "SIM" },
[MMC_S_MODEM_BEARER] = { "Bearer" },
[MMC_S_MODEM_TIME] = { "Time" },
[MMC_S_MODEM_TIMEZONE] = { "Timezone" },
[MMC_S_MODEM_MESSAGING] = { "Messaging" },
[MMC_S_MODEM_SIGNAL] = { "Signal" },
[MMC_S_MODEM_SIGNAL_CDMA1X] = { "CDMA1x" },
[MMC_S_MODEM_SIGNAL_EVDO] = { "EV-DO" },
[MMC_S_MODEM_SIGNAL_GSM] = { "GSM" },
[MMC_S_MODEM_SIGNAL_UMTS] = { "UMTS" },
[MMC_S_MODEM_SIGNAL_LTE] = { "LTE" },
[MMC_S_MODEM_SIGNAL_5G] = { "5G" },
[MMC_S_MODEM_OMA] = { "OMA" },
[MMC_S_MODEM_OMA_CURRENT] = { "Current session" },
[MMC_S_MODEM_OMA_PENDING] = { "Pending sessions" },
[MMC_S_MODEM_LOCATION] = { "Location" },
[MMC_S_MODEM_LOCATION_3GPP] = { "3GPP" },
[MMC_S_MODEM_LOCATION_GPS] = { "GPS" },
[MMC_S_MODEM_LOCATION_CDMABS] = { "CDMA BS" },
[MMC_S_MODEM_FIRMWARE] = { "Firmware" },
[MMC_S_MODEM_FIRMWARE_FASTBOOT] = { "Fastboot settings" },
[MMC_S_MODEM_VOICE] = { "Voice" },
[MMC_S_BEARER_GENERAL] = { "General" },
[MMC_S_BEARER_STATUS] = { "Status" },
[MMC_S_BEARER_PROPERTIES] = { "Properties" },
[MMC_S_BEARER_IPV4_CONFIG] = { "IPv4 configuration" },
[MMC_S_BEARER_IPV6_CONFIG] = { "IPv6 configuration" },
[MMC_S_BEARER_STATS] = { "Statistics" },
[MMC_S_CALL_GENERAL] = { "General" },
[MMC_S_CALL_PROPERTIES] = { "Properties" },
[MMC_S_CALL_AUDIO_FORMAT] = { "Audio format" },
[MMC_S_SMS_GENERAL] = { "General" },
[MMC_S_SMS_CONTENT] = { "Content" },
[MMC_S_SMS_PROPERTIES] = { "Properties" },
[MMC_S_SIM_GENERAL] = { "General" },
[MMC_S_SIM_PROPERTIES] = { "Properties" },
};
/******************************************************************************/
@@ -94,192 +95,194 @@ typedef struct {
} FieldInfo;
static FieldInfo field_infos[] = {
[MMC_F_GENERAL_DBUS_PATH] = { "modem.dbus-path", "path", MMC_S_MODEM_GENERAL, },
[MMC_F_GENERAL_DEVICE_ID] = { "modem.generic.device-identifier", "device id", MMC_S_MODEM_GENERAL, },
[MMC_F_HARDWARE_MANUFACTURER] = { "modem.generic.manufacturer", "manufacturer", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_MODEL] = { "modem.generic.model", "model", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_REVISION] = { "modem.generic.revision", "firmware revision", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_CARRIER_CONF] = { "modem.generic.carrier-configuration", "carrier config", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_CARRIER_CONF_REV] = { "modem.generic.carrier-configuration-revision", "carrier config revision", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_HW_REVISION] = { "modem.generic.hardware-revision", "h/w revision", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_SUPPORTED_CAPABILITIES] = { "modem.generic.supported-capabilities", "supported", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_CURRENT_CAPABILITIES] = { "modem.generic.current-capabilities", "current", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_EQUIPMENT_ID] = { "modem.generic.equipment-identifier", "equipment id", MMC_S_MODEM_HARDWARE, },
[MMC_F_SYSTEM_DEVICE] = { "modem.generic.device", "device", MMC_S_MODEM_SYSTEM, },
[MMC_F_SYSTEM_DRIVERS] = { "modem.generic.drivers", "drivers", MMC_S_MODEM_SYSTEM, },
[MMC_F_SYSTEM_PLUGIN] = { "modem.generic.plugin", "plugin", MMC_S_MODEM_SYSTEM, },
[MMC_F_SYSTEM_PRIMARY_PORT] = { "modem.generic.primary-port", "primary port", MMC_S_MODEM_SYSTEM, },
[MMC_F_SYSTEM_PORTS] = { "modem.generic.ports", "ports", MMC_S_MODEM_SYSTEM, },
[MMC_F_NUMBERS_OWN] = { "modem.generic.own-numbers", "own", MMC_S_MODEM_NUMBERS, },
[MMC_F_STATUS_LOCK] = { "modem.generic.unlock-required", "lock", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_UNLOCK_RETRIES] = { "modem.generic.unlock-retries", "unlock retries", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_STATE] = { "modem.generic.state", "state", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_FAILED_REASON] = { "modem.generic.state-failed-reason", "failed reason", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_POWER_STATE] = { "modem.generic.power-state", "power state", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_ACCESS_TECH] = { "modem.generic.access-technologies", "access tech", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_SIGNAL_QUALITY_VALUE] = { "modem.generic.signal-quality.value", "signal quality", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_SIGNAL_QUALITY_RECENT] = { "modem.generic.signal-quality.recent", NULL, MMC_S_UNKNOWN, },
[MMC_F_MODES_SUPPORTED] = { "modem.generic.supported-modes", "supported", MMC_S_MODEM_MODES, },
[MMC_F_MODES_CURRENT] = { "modem.generic.current-modes", "current", MMC_S_MODEM_MODES, },
[MMC_F_BANDS_SUPPORTED] = { "modem.generic.supported-bands", "supported", MMC_S_MODEM_BANDS, },
[MMC_F_BANDS_CURRENT] = { "modem.generic.current-bands", "current", MMC_S_MODEM_BANDS, },
[MMC_F_IP_SUPPORTED] = { "modem.generic.supported-ip-families", "supported", MMC_S_MODEM_IP, },
[MMC_F_3GPP_IMEI] = { "modem.3gpp.imei", "imei", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_ENABLED_LOCKS] = { "modem.3gpp.enabled-locks", "enabled locks", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_OPERATOR_ID] = { "modem.3gpp.operator-code", "operator id", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_OPERATOR_NAME] = { "modem.3gpp.operator-name", "operator name", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_REGISTRATION] = { "modem.3gpp.registration-state", "registration", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_PCO] = { "modem.3gpp.pco", "pco", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_EPS_UE_MODE] = { "modem.3gpp.eps.ue-mode-operation", "ue mode of operation", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_EPS_INITIAL_BEARER_PATH] = { "modem.3gpp.eps.initial-bearer.dbus-path", "initial bearer path", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_EPS_BEARER_SETTINGS_APN] = { "modem.3gpp.eps.initial-bearer.settings.apn", "initial bearer apn", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_EPS_BEARER_SETTINGS_IP_TYPE] = { "modem.3gpp.eps.initial-bearer.settings.ip-type", "initial bearer ip type", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_EPS_BEARER_SETTINGS_USER] = { "modem.3gpp.eps.initial-bearer.settings.user", "initial bearer user", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_EPS_BEARER_SETTINGS_PASSWORD] = { "modem.3gpp.eps.initial-bearer.settings.password", "initial bearer password", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_SCAN_NETWORKS] = { "modem.3gpp.scan-networks", "networks", MMC_S_MODEM_3GPP_SCAN, },
[MMC_F_3GPP_USSD_STATUS] = { "modem.3gpp.ussd.status", "status", MMC_S_MODEM_3GPP_USSD, },
[MMC_F_3GPP_USSD_NETWORK_REQUEST] = { "modem.3gpp.ussd.network-request", "network request", MMC_S_MODEM_3GPP_USSD, },
[MMC_F_3GPP_USSD_NETWORK_NOTIFICATION] = { "modem.3gpp.ussd.network-notification", "network notification", MMC_S_MODEM_3GPP_USSD, },
[MMC_F_CDMA_MEID] = { "modem.cdma.meid", "meid", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_ESN] = { "modem.cdma.esn", "esn", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_SID] = { "modem.cdma.sid", "sid", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_NID] = { "modem.cdma.nid", "nid", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_REGISTRATION_CDMA1X] = { "modem.cdma.cdma1x-registration-state", "registration cdma1x", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_REGISTRATION_EVDO] = { "modem.cdma.evdo-registration-state", "registration evdo", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_ACTIVATION] = { "modem.cdma.activation-state", "activation", MMC_S_MODEM_CDMA, },
[MMC_F_SIM_PATH] = { "modem.generic.sim", "primary sim path", MMC_S_MODEM_SIM, },
[MMC_F_SIM_PRIMARY_SLOT] = { "modem.generic.primary-sim-slot", NULL, MMC_S_MODEM_SIM, },
[MMC_F_SIM_SLOT_PATHS] = { "modem.generic.sim-slots", "sim slot paths", MMC_S_MODEM_SIM, },
[MMC_F_BEARER_PATHS] = { "modem.generic.bearers", "paths", MMC_S_MODEM_BEARER, },
[MMC_F_TIME_CURRENT] = { "modem.time.current", "current", MMC_S_MODEM_TIME, },
[MMC_F_TIMEZONE_CURRENT] = { "modem.timezone.current", "current", MMC_S_MODEM_TIMEZONE, },
[MMC_F_TIMEZONE_DST_OFFSET] = { "modem.time.dst-offset", "dst offset", MMC_S_MODEM_TIMEZONE, },
[MMC_F_TIMEZONE_LEAP_SECONDS] = { "modem.time.leap-seconds", "leap seconds", MMC_S_MODEM_TIMEZONE, },
[MMC_F_MESSAGING_SUPPORTED_STORAGES] = { "modem.messaging.supported-storages", "supported storages", MMC_S_MODEM_MESSAGING, },
[MMC_F_MESSAGING_DEFAULT_STORAGES] = { "modem.messaging.default-storages", "default storages", MMC_S_MODEM_MESSAGING, },
[MMC_F_SIGNAL_REFRESH_RATE] = { "modem.signal.refresh.rate", "refresh rate", MMC_S_MODEM_SIGNAL, },
[MMC_F_SIGNAL_CDMA1X_RSSI] = { "modem.signal.cdma1x.rssi", "rssi", MMC_S_MODEM_SIGNAL_CDMA1X, },
[MMC_F_SIGNAL_CDMA1X_ECIO] = { "modem.signal.cdma1x.ecio", "ecio", MMC_S_MODEM_SIGNAL_CDMA1X, },
[MMC_F_SIGNAL_EVDO_RSSI] = { "modem.signal.evdo.rssi", "rssi", MMC_S_MODEM_SIGNAL_EVDO, },
[MMC_F_SIGNAL_EVDO_ECIO] = { "modem.signal.evdo.ecio", "ecio", MMC_S_MODEM_SIGNAL_EVDO, },
[MMC_F_SIGNAL_EVDO_SINR] = { "modem.signal.evdo.sinr", "sinr", MMC_S_MODEM_SIGNAL_EVDO, },
[MMC_F_SIGNAL_EVDO_IO] = { "modem.signal.evdo.io", "io", MMC_S_MODEM_SIGNAL_EVDO, },
[MMC_F_SIGNAL_GSM_RSSI] = { "modem.signal.gsm.rssi", "rssi", MMC_S_MODEM_SIGNAL_GSM, },
[MMC_F_SIGNAL_UMTS_RSSI] = { "modem.signal.umts.rssi", "rssi", MMC_S_MODEM_SIGNAL_UMTS, },
[MMC_F_SIGNAL_UMTS_RSCP] = { "modem.signal.umts.rscp", "rscp", MMC_S_MODEM_SIGNAL_UMTS, },
[MMC_F_SIGNAL_UMTS_ECIO] = { "modem.signal.umts.ecio", "ecio", MMC_S_MODEM_SIGNAL_UMTS, },
[MMC_F_SIGNAL_LTE_RSSI] = { "modem.signal.lte.rssi", "rssi", MMC_S_MODEM_SIGNAL_LTE, },
[MMC_F_SIGNAL_LTE_RSRQ] = { "modem.signal.lte.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_LTE, },
[MMC_F_SIGNAL_LTE_RSRP] = { "modem.signal.lte.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_LTE, },
[MMC_F_SIGNAL_LTE_SNR] = { "modem.signal.lte.snr", "s/n", MMC_S_MODEM_SIGNAL_LTE, },
[MMC_F_SIGNAL_5G_RSRQ] = { "modem.signal.5g.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_5G, },
[MMC_F_SIGNAL_5G_RSRP] = { "modem.signal.5g.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_5G, },
[MMC_F_SIGNAL_5G_SNR] = { "modem.signal.5g.snr", "s/n", MMC_S_MODEM_SIGNAL_5G, },
[MMC_F_OMA_FEATURES] = { "modem.oma.features", "features", MMC_S_MODEM_OMA, },
[MMC_F_OMA_CURRENT_TYPE] = { "modem.oma.current.type", "type", MMC_S_MODEM_OMA_CURRENT, },
[MMC_F_OMA_CURRENT_STATE] = { "modem.oma.current.state", "state", MMC_S_MODEM_OMA_CURRENT, },
[MMC_F_OMA_PENDING_SESSIONS] = { "modem.oma.pending-sessions", "sessions", MMC_S_MODEM_OMA_PENDING, },
[MMC_F_LOCATION_CAPABILITIES] = { "modem.location.capabilities", "capabilities", MMC_S_MODEM_LOCATION, },
[MMC_F_LOCATION_ENABLED] = { "modem.location.enabled", "enabled", MMC_S_MODEM_LOCATION, },
[MMC_F_LOCATION_SIGNALS] = { "modem.location.signals", "signals", MMC_S_MODEM_LOCATION, },
[MMC_F_LOCATION_GPS_REFRESH_RATE] = { "modem.location.gps.refresh-rate", "refresh rate", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_SUPL_SERVER] = { "modem.location.gps.supl-server", "a-gps supl server", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_ASSISTANCE] = { "modem.location.gps.assistance", "supported assistance", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_ASSISTANCE_SERVERS] = { "modem.location.gps.assistance-servers", "assistance servers", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_3GPP_MCC] = { "modem.location.3gpp.mcc", "operator code", MMC_S_MODEM_LOCATION_3GPP, },
[MMC_F_LOCATION_3GPP_MNC] = { "modem.location.3gpp.mnc", "operator name", MMC_S_MODEM_LOCATION_3GPP, },
[MMC_F_LOCATION_3GPP_LAC] = { "modem.location.3gpp.lac", "location area code", MMC_S_MODEM_LOCATION_3GPP, },
[MMC_F_LOCATION_3GPP_TAC] = { "modem.location.3gpp.tac", "tracking area code", MMC_S_MODEM_LOCATION_3GPP, },
[MMC_F_LOCATION_3GPP_CID] = { "modem.location.3gpp.cid", "cell id", MMC_S_MODEM_LOCATION_3GPP, },
[MMC_F_LOCATION_GPS_NMEA] = { "modem.location.gps.nmea", "nmea", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_UTC] = { "modem.location.gps.utc", "utc", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_LONG] = { "modem.location.gps.longitude", "longitude", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_LAT] = { "modem.location.gps.latitude", "latitude", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_ALT] = { "modem.location.gps.altitude", "altitude", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_CDMABS_LONG] = { "modem.location.cdma-bs.longitude", "longitude", MMC_S_MODEM_LOCATION_CDMABS, },
[MMC_F_LOCATION_CDMABS_LAT] = { "modem.location.cdma-bs.latitude", "latitude", MMC_S_MODEM_LOCATION_CDMABS, },
[MMC_F_FIRMWARE_LIST] = { "modem.firmware.list", "list", MMC_S_MODEM_FIRMWARE, },
[MMC_F_FIRMWARE_METHOD] = { "modem.firmware.method", "method", MMC_S_MODEM_FIRMWARE, },
[MMC_F_FIRMWARE_DEVICE_IDS] = { "modem.firmware.device-ids", "device ids", MMC_S_MODEM_FIRMWARE, },
[MMC_F_FIRMWARE_VERSION] = { "modem.firmware.version", "version", MMC_S_MODEM_FIRMWARE, },
[MMC_F_FIRMWARE_FASTBOOT_AT] = { "modem.firmware.fastboot.at", "at command", MMC_S_MODEM_FIRMWARE_FASTBOOT, },
[MMC_F_VOICE_EMERGENCY_ONLY] = { "modem.voice.emergency-only", "emergency only", MMC_S_MODEM_VOICE, },
[MMC_F_BEARER_GENERAL_DBUS_PATH] = { "bearer.dbus-path", "path", MMC_S_BEARER_GENERAL, },
[MMC_F_BEARER_GENERAL_TYPE] = { "bearer.type", "type", MMC_S_BEARER_GENERAL, },
[MMC_F_BEARER_STATUS_CONNECTED] = { "bearer.status.connected", "connected", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_STATUS_SUSPENDED] = { "bearer.status.suspended", "suspended", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_STATUS_MULTIPLEXED] = { "bearer.status.multiplexed", "multiplexed", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_STATUS_INTERFACE] = { "bearer.status.interface", "interface", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_STATUS_IP_TIMEOUT] = { "bearer.status.ip-timeout", "ip timeout", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_PROPERTIES_APN] = { "bearer.properties.apn", "apn", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_APN_TYPE] = { "bearer.properties.apn-type", "apn type", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_ROAMING] = { "bearer.properties.roaming", "roaming", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_IP_TYPE] = { "bearer.properties.ip-type", "ip type", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_ALLOWED_AUTH] = { "bearer.properties.allowed-auth", "allowed-auth", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_USER] = { "bearer.properties.user", "user", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_PASSWORD] = { "bearer.properties.password", "password", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_PROFILE_ID] = { "bearer.properties.profile-id", "profile id", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_NUMBER] = { "bearer.properties.number", "number", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_RM_PROTOCOL] = { "bearer.properties.rm-protocol", "rm protocol", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_IPV4_CONFIG_METHOD] = { "bearer.ipv4-config.method", "method", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_ADDRESS] = { "bearer.ipv4-config.address", "address", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_PREFIX] = { "bearer.ipv4-config.prefix", "prefix", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_GATEWAY] = { "bearer.ipv4-config.gateway", "gateway", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_DNS] = { "bearer.ipv4-config.dns", "dns", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_MTU] = { "bearer.ipv4-config.mtu", "mtu", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_METHOD] = { "bearer.ipv6-config.method", "method", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_ADDRESS] = { "bearer.ipv6-config.address", "address", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_PREFIX] = { "bearer.ipv6-config.prefix", "prefix", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_GATEWAY] = { "bearer.ipv6-config.gateway", "gateway", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_DNS] = { "bearer.ipv6-config.dns", "dns", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_MTU] = { "bearer.ipv6-config.mtu", "mtu", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_STATS_DURATION] = { "bearer.stats.duration", "duration", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_BYTES_RX] = { "bearer.stats.bytes-rx", "bytes rx", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_BYTES_TX] = { "bearer.stats.bytes-tx", "bytes tx", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_ATTEMPTS] = { "bearer.stats.attempts", "attempts", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_FAILED_ATTEMPTS] = { "bearer.stats.failed-attempts", "attempts", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_TOTAL_DURATION] = { "bearer.stats.total-duration", "total-duration", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_TOTAL_BYTES_RX] = { "bearer.stats.total-bytes-rx", "total-bytes rx", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_TOTAL_BYTES_TX] = { "bearer.stats.total-bytes-tx", "total-bytes tx", MMC_S_BEARER_STATS, },
[MMC_F_CALL_GENERAL_DBUS_PATH] = { "call.dbus-path", "path", MMC_S_CALL_GENERAL, },
[MMC_F_CALL_PROPERTIES_NUMBER] = { "call.properties.number", "number", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_PROPERTIES_DIRECTION] = { "call.properties.direction", "direction", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_PROPERTIES_MULTIPARTY] = { "call.properties.multiparty", "multiparty", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_PROPERTIES_STATE] = { "call.properties.state", "state", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_PROPERTIES_STATE_REASON] = { "call.properties.state-reason", "state reason", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_PROPERTIES_AUDIO_PORT] = { "call.properties.audio-port", "audio port", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_AUDIO_FORMAT_ENCODING] = { "call.audio-format.encoding", "encoding", MMC_S_CALL_AUDIO_FORMAT, },
[MMC_F_CALL_AUDIO_FORMAT_RESOLUTION] = { "call.audio-format.resolution", "resolution", MMC_S_CALL_AUDIO_FORMAT, },
[MMC_F_CALL_AUDIO_FORMAT_RATE] = { "call.audio-format.rate", "rate", MMC_S_CALL_AUDIO_FORMAT, },
[MMC_F_SMS_GENERAL_DBUS_PATH] = { "sms.dbus-path", "path", MMC_S_SMS_GENERAL, },
[MMC_F_SMS_CONTENT_NUMBER] = { "sms.content.number", "number", MMC_S_SMS_CONTENT, },
[MMC_F_SMS_CONTENT_TEXT] = { "sms.content.text", "text", MMC_S_SMS_CONTENT, },
[MMC_F_SMS_CONTENT_DATA] = { "sms.content.data", "data", MMC_S_SMS_CONTENT, },
[MMC_F_SMS_PROPERTIES_PDU_TYPE] = { "sms.properties.pdu-type", "pdu type", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_STATE] = { "sms.properties.state", "state", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_VALIDITY] = { "sms.properties.validity", "validity", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_STORAGE] = { "sms.properties.storage", "storage", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_SMSC] = { "sms.properties.smsc", "smsc", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_CLASS] = { "sms.properties.class", "class", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_TELESERVICE_ID] = { "sms.properties.teleservice-id", "teleservice id", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_SERVICE_CATEGORY] = { "sms.properties.service-category", "service category", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_DELIVERY_REPORT] = { "sms.properties.delivery-report", "delivery report", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_MSG_REFERENCE] = { "sms.properties.message-reference", "message reference", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_TIMESTAMP] = { "sms.properties.timestamp", "timestamp", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_DELIVERY_STATE] = { "sms.properties.delivery-state", "delivery state", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_DISCH_TIMESTAMP] = { "sms.properties.discharge-timestamp", "discharge timestamp", MMC_S_SMS_PROPERTIES, },
[MMC_F_SIM_GENERAL_DBUS_PATH] = { "sim.dbus-path", "path", MMC_S_SIM_GENERAL, },
[MMC_F_SIM_PROPERTIES_ACTIVE] = { "sim.properties.active", "active", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_IMSI] = { "sim.properties.imsi", "imsi", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_ICCID] = { "sim.properties.iccid", "iccid", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_EID] = { "sim.properties.eid", "eid", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_OPERATOR_ID] = { "sim.properties.operator-code", "operator id", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_OPERATOR_NAME] = { "sim.properties.operator-name", "operator name", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_EMERGENCY_NUMBERS] = { "sim.properties.emergency-numbers", "emergency numbers", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_PREFERRED_NETWORKS] = { "sim.properties.preferred-networks", "preferred networks", MMC_S_SIM_PROPERTIES, },
[MMC_F_MODEM_LIST_DBUS_PATH] = { "modem-list", "modems", MMC_S_UNKNOWN, },
[MMC_F_SMS_LIST_DBUS_PATH] = { "modem.messaging.sms", "sms messages", MMC_S_UNKNOWN, },
[MMC_F_CALL_LIST_DBUS_PATH] = { "modem.voice.call", "calls", MMC_S_UNKNOWN, },
[MMC_F_GENERAL_DBUS_PATH] = { "modem.dbus-path", "path", MMC_S_MODEM_GENERAL, },
[MMC_F_GENERAL_DEVICE_ID] = { "modem.generic.device-identifier", "device id", MMC_S_MODEM_GENERAL, },
[MMC_F_HARDWARE_MANUFACTURER] = { "modem.generic.manufacturer", "manufacturer", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_MODEL] = { "modem.generic.model", "model", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_REVISION] = { "modem.generic.revision", "firmware revision", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_CARRIER_CONF] = { "modem.generic.carrier-configuration", "carrier config", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_CARRIER_CONF_REV] = { "modem.generic.carrier-configuration-revision", "carrier config revision", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_HW_REVISION] = { "modem.generic.hardware-revision", "h/w revision", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_SUPPORTED_CAPABILITIES] = { "modem.generic.supported-capabilities", "supported", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_CURRENT_CAPABILITIES] = { "modem.generic.current-capabilities", "current", MMC_S_MODEM_HARDWARE, },
[MMC_F_HARDWARE_EQUIPMENT_ID] = { "modem.generic.equipment-identifier", "equipment id", MMC_S_MODEM_HARDWARE, },
[MMC_F_SYSTEM_DEVICE] = { "modem.generic.device", "device", MMC_S_MODEM_SYSTEM, },
[MMC_F_SYSTEM_DRIVERS] = { "modem.generic.drivers", "drivers", MMC_S_MODEM_SYSTEM, },
[MMC_F_SYSTEM_PLUGIN] = { "modem.generic.plugin", "plugin", MMC_S_MODEM_SYSTEM, },
[MMC_F_SYSTEM_PRIMARY_PORT] = { "modem.generic.primary-port", "primary port", MMC_S_MODEM_SYSTEM, },
[MMC_F_SYSTEM_PORTS] = { "modem.generic.ports", "ports", MMC_S_MODEM_SYSTEM, },
[MMC_F_NUMBERS_OWN] = { "modem.generic.own-numbers", "own", MMC_S_MODEM_NUMBERS, },
[MMC_F_STATUS_LOCK] = { "modem.generic.unlock-required", "lock", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_UNLOCK_RETRIES] = { "modem.generic.unlock-retries", "unlock retries", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_STATE] = { "modem.generic.state", "state", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_FAILED_REASON] = { "modem.generic.state-failed-reason", "failed reason", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_POWER_STATE] = { "modem.generic.power-state", "power state", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_ACCESS_TECH] = { "modem.generic.access-technologies", "access tech", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_SIGNAL_QUALITY_VALUE] = { "modem.generic.signal-quality.value", "signal quality", MMC_S_MODEM_STATUS, },
[MMC_F_STATUS_SIGNAL_QUALITY_RECENT] = { "modem.generic.signal-quality.recent", NULL, MMC_S_UNKNOWN, },
[MMC_F_MODES_SUPPORTED] = { "modem.generic.supported-modes", "supported", MMC_S_MODEM_MODES, },
[MMC_F_MODES_CURRENT] = { "modem.generic.current-modes", "current", MMC_S_MODEM_MODES, },
[MMC_F_BANDS_SUPPORTED] = { "modem.generic.supported-bands", "supported", MMC_S_MODEM_BANDS, },
[MMC_F_BANDS_CURRENT] = { "modem.generic.current-bands", "current", MMC_S_MODEM_BANDS, },
[MMC_F_IP_SUPPORTED] = { "modem.generic.supported-ip-families", "supported", MMC_S_MODEM_IP, },
[MMC_F_3GPP_IMEI] = { "modem.3gpp.imei", "imei", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_ENABLED_LOCKS] = { "modem.3gpp.enabled-locks", "enabled locks", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_OPERATOR_ID] = { "modem.3gpp.operator-code", "operator id", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_OPERATOR_NAME] = { "modem.3gpp.operator-name", "operator name", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_REGISTRATION] = { "modem.3gpp.registration-state", "registration", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_PCO] = { "modem.3gpp.pco", "pco", MMC_S_MODEM_3GPP, },
[MMC_F_3GPP_EPS_UE_MODE] = { "modem.3gpp.eps.ue-mode-operation", "ue mode of operation", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_EPS_INITIAL_BEARER_PATH] = { "modem.3gpp.eps.initial-bearer.dbus-path", "initial bearer path", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_EPS_BEARER_SETTINGS_APN] = { "modem.3gpp.eps.initial-bearer.settings.apn", "initial bearer apn", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_EPS_BEARER_SETTINGS_IP_TYPE] = { "modem.3gpp.eps.initial-bearer.settings.ip-type", "initial bearer ip type", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_EPS_BEARER_SETTINGS_USER] = { "modem.3gpp.eps.initial-bearer.settings.user", "initial bearer user", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_EPS_BEARER_SETTINGS_PASSWORD] = { "modem.3gpp.eps.initial-bearer.settings.password", "initial bearer password", MMC_S_MODEM_3GPP_EPS, },
[MMC_F_3GPP_SCAN_NETWORKS] = { "modem.3gpp.scan-networks", "networks", MMC_S_MODEM_3GPP_SCAN, },
[MMC_F_3GPP_USSD_STATUS] = { "modem.3gpp.ussd.status", "status", MMC_S_MODEM_3GPP_USSD, },
[MMC_F_3GPP_USSD_NETWORK_REQUEST] = { "modem.3gpp.ussd.network-request", "network request", MMC_S_MODEM_3GPP_USSD, },
[MMC_F_3GPP_USSD_NETWORK_NOTIFICATION] = { "modem.3gpp.ussd.network-notification", "network notification", MMC_S_MODEM_3GPP_USSD, },
[MMC_F_3GPP_PROFILE_MANAGER_LIST] = { "modem.3gpp.profile-manager.list", "list", MMC_S_MODEM_3GPP_PROFILE_MANAGER, },
[MMC_F_3GPP_PROFILE_MANAGER_SET] = { "modem.3gpp.profile-manager.set", "set", MMC_S_MODEM_3GPP_PROFILE_MANAGER, },
[MMC_F_CDMA_MEID] = { "modem.cdma.meid", "meid", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_ESN] = { "modem.cdma.esn", "esn", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_SID] = { "modem.cdma.sid", "sid", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_NID] = { "modem.cdma.nid", "nid", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_REGISTRATION_CDMA1X] = { "modem.cdma.cdma1x-registration-state", "registration cdma1x", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_REGISTRATION_EVDO] = { "modem.cdma.evdo-registration-state", "registration evdo", MMC_S_MODEM_CDMA, },
[MMC_F_CDMA_ACTIVATION] = { "modem.cdma.activation-state", "activation", MMC_S_MODEM_CDMA, },
[MMC_F_SIM_PATH] = { "modem.generic.sim", "primary sim path", MMC_S_MODEM_SIM, },
[MMC_F_SIM_PRIMARY_SLOT] = { "modem.generic.primary-sim-slot", NULL, MMC_S_MODEM_SIM, },
[MMC_F_SIM_SLOT_PATHS] = { "modem.generic.sim-slots", "sim slot paths", MMC_S_MODEM_SIM, },
[MMC_F_BEARER_PATHS] = { "modem.generic.bearers", "paths", MMC_S_MODEM_BEARER, },
[MMC_F_TIME_CURRENT] = { "modem.time.current", "current", MMC_S_MODEM_TIME, },
[MMC_F_TIMEZONE_CURRENT] = { "modem.timezone.current", "current", MMC_S_MODEM_TIMEZONE, },
[MMC_F_TIMEZONE_DST_OFFSET] = { "modem.time.dst-offset", "dst offset", MMC_S_MODEM_TIMEZONE, },
[MMC_F_TIMEZONE_LEAP_SECONDS] = { "modem.time.leap-seconds", "leap seconds", MMC_S_MODEM_TIMEZONE, },
[MMC_F_MESSAGING_SUPPORTED_STORAGES] = { "modem.messaging.supported-storages", "supported storages", MMC_S_MODEM_MESSAGING, },
[MMC_F_MESSAGING_DEFAULT_STORAGES] = { "modem.messaging.default-storages", "default storages", MMC_S_MODEM_MESSAGING, },
[MMC_F_SIGNAL_REFRESH_RATE] = { "modem.signal.refresh.rate", "refresh rate", MMC_S_MODEM_SIGNAL, },
[MMC_F_SIGNAL_CDMA1X_RSSI] = { "modem.signal.cdma1x.rssi", "rssi", MMC_S_MODEM_SIGNAL_CDMA1X, },
[MMC_F_SIGNAL_CDMA1X_ECIO] = { "modem.signal.cdma1x.ecio", "ecio", MMC_S_MODEM_SIGNAL_CDMA1X, },
[MMC_F_SIGNAL_EVDO_RSSI] = { "modem.signal.evdo.rssi", "rssi", MMC_S_MODEM_SIGNAL_EVDO, },
[MMC_F_SIGNAL_EVDO_ECIO] = { "modem.signal.evdo.ecio", "ecio", MMC_S_MODEM_SIGNAL_EVDO, },
[MMC_F_SIGNAL_EVDO_SINR] = { "modem.signal.evdo.sinr", "sinr", MMC_S_MODEM_SIGNAL_EVDO, },
[MMC_F_SIGNAL_EVDO_IO] = { "modem.signal.evdo.io", "io", MMC_S_MODEM_SIGNAL_EVDO, },
[MMC_F_SIGNAL_GSM_RSSI] = { "modem.signal.gsm.rssi", "rssi", MMC_S_MODEM_SIGNAL_GSM, },
[MMC_F_SIGNAL_UMTS_RSSI] = { "modem.signal.umts.rssi", "rssi", MMC_S_MODEM_SIGNAL_UMTS, },
[MMC_F_SIGNAL_UMTS_RSCP] = { "modem.signal.umts.rscp", "rscp", MMC_S_MODEM_SIGNAL_UMTS, },
[MMC_F_SIGNAL_UMTS_ECIO] = { "modem.signal.umts.ecio", "ecio", MMC_S_MODEM_SIGNAL_UMTS, },
[MMC_F_SIGNAL_LTE_RSSI] = { "modem.signal.lte.rssi", "rssi", MMC_S_MODEM_SIGNAL_LTE, },
[MMC_F_SIGNAL_LTE_RSRQ] = { "modem.signal.lte.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_LTE, },
[MMC_F_SIGNAL_LTE_RSRP] = { "modem.signal.lte.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_LTE, },
[MMC_F_SIGNAL_LTE_SNR] = { "modem.signal.lte.snr", "s/n", MMC_S_MODEM_SIGNAL_LTE, },
[MMC_F_SIGNAL_5G_RSRQ] = { "modem.signal.5g.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_5G, },
[MMC_F_SIGNAL_5G_RSRP] = { "modem.signal.5g.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_5G, },
[MMC_F_SIGNAL_5G_SNR] = { "modem.signal.5g.snr", "s/n", MMC_S_MODEM_SIGNAL_5G, },
[MMC_F_OMA_FEATURES] = { "modem.oma.features", "features", MMC_S_MODEM_OMA, },
[MMC_F_OMA_CURRENT_TYPE] = { "modem.oma.current.type", "type", MMC_S_MODEM_OMA_CURRENT, },
[MMC_F_OMA_CURRENT_STATE] = { "modem.oma.current.state", "state", MMC_S_MODEM_OMA_CURRENT, },
[MMC_F_OMA_PENDING_SESSIONS] = { "modem.oma.pending-sessions", "sessions", MMC_S_MODEM_OMA_PENDING, },
[MMC_F_LOCATION_CAPABILITIES] = { "modem.location.capabilities", "capabilities", MMC_S_MODEM_LOCATION, },
[MMC_F_LOCATION_ENABLED] = { "modem.location.enabled", "enabled", MMC_S_MODEM_LOCATION, },
[MMC_F_LOCATION_SIGNALS] = { "modem.location.signals", "signals", MMC_S_MODEM_LOCATION, },
[MMC_F_LOCATION_GPS_REFRESH_RATE] = { "modem.location.gps.refresh-rate", "refresh rate", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_SUPL_SERVER] = { "modem.location.gps.supl-server", "a-gps supl server", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_ASSISTANCE] = { "modem.location.gps.assistance", "supported assistance", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_ASSISTANCE_SERVERS] = { "modem.location.gps.assistance-servers", "assistance servers", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_3GPP_MCC] = { "modem.location.3gpp.mcc", "operator code", MMC_S_MODEM_LOCATION_3GPP, },
[MMC_F_LOCATION_3GPP_MNC] = { "modem.location.3gpp.mnc", "operator name", MMC_S_MODEM_LOCATION_3GPP, },
[MMC_F_LOCATION_3GPP_LAC] = { "modem.location.3gpp.lac", "location area code", MMC_S_MODEM_LOCATION_3GPP, },
[MMC_F_LOCATION_3GPP_TAC] = { "modem.location.3gpp.tac", "tracking area code", MMC_S_MODEM_LOCATION_3GPP, },
[MMC_F_LOCATION_3GPP_CID] = { "modem.location.3gpp.cid", "cell id", MMC_S_MODEM_LOCATION_3GPP, },
[MMC_F_LOCATION_GPS_NMEA] = { "modem.location.gps.nmea", "nmea", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_UTC] = { "modem.location.gps.utc", "utc", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_LONG] = { "modem.location.gps.longitude", "longitude", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_LAT] = { "modem.location.gps.latitude", "latitude", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_GPS_ALT] = { "modem.location.gps.altitude", "altitude", MMC_S_MODEM_LOCATION_GPS, },
[MMC_F_LOCATION_CDMABS_LONG] = { "modem.location.cdma-bs.longitude", "longitude", MMC_S_MODEM_LOCATION_CDMABS, },
[MMC_F_LOCATION_CDMABS_LAT] = { "modem.location.cdma-bs.latitude", "latitude", MMC_S_MODEM_LOCATION_CDMABS, },
[MMC_F_FIRMWARE_LIST] = { "modem.firmware.list", "list", MMC_S_MODEM_FIRMWARE, },
[MMC_F_FIRMWARE_METHOD] = { "modem.firmware.method", "method", MMC_S_MODEM_FIRMWARE, },
[MMC_F_FIRMWARE_DEVICE_IDS] = { "modem.firmware.device-ids", "device ids", MMC_S_MODEM_FIRMWARE, },
[MMC_F_FIRMWARE_VERSION] = { "modem.firmware.version", "version", MMC_S_MODEM_FIRMWARE, },
[MMC_F_FIRMWARE_FASTBOOT_AT] = { "modem.firmware.fastboot.at", "at command", MMC_S_MODEM_FIRMWARE_FASTBOOT, },
[MMC_F_VOICE_EMERGENCY_ONLY] = { "modem.voice.emergency-only", "emergency only", MMC_S_MODEM_VOICE, },
[MMC_F_BEARER_GENERAL_DBUS_PATH] = { "bearer.dbus-path", "path", MMC_S_BEARER_GENERAL, },
[MMC_F_BEARER_GENERAL_TYPE] = { "bearer.type", "type", MMC_S_BEARER_GENERAL, },
[MMC_F_BEARER_STATUS_CONNECTED] = { "bearer.status.connected", "connected", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_STATUS_SUSPENDED] = { "bearer.status.suspended", "suspended", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_STATUS_MULTIPLEXED] = { "bearer.status.multiplexed", "multiplexed", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_STATUS_INTERFACE] = { "bearer.status.interface", "interface", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_STATUS_IP_TIMEOUT] = { "bearer.status.ip-timeout", "ip timeout", MMC_S_BEARER_STATUS, },
[MMC_F_BEARER_PROPERTIES_APN] = { "bearer.properties.apn", "apn", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_APN_TYPE] = { "bearer.properties.apn-type", "apn type", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_ROAMING] = { "bearer.properties.roaming", "roaming", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_IP_TYPE] = { "bearer.properties.ip-type", "ip type", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_ALLOWED_AUTH] = { "bearer.properties.allowed-auth", "allowed-auth", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_USER] = { "bearer.properties.user", "user", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_PASSWORD] = { "bearer.properties.password", "password", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_PROFILE_ID] = { "bearer.properties.profile-id", "profile id", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_NUMBER] = { "bearer.properties.number", "number", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_PROPERTIES_RM_PROTOCOL] = { "bearer.properties.rm-protocol", "rm protocol", MMC_S_BEARER_PROPERTIES, },
[MMC_F_BEARER_IPV4_CONFIG_METHOD] = { "bearer.ipv4-config.method", "method", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_ADDRESS] = { "bearer.ipv4-config.address", "address", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_PREFIX] = { "bearer.ipv4-config.prefix", "prefix", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_GATEWAY] = { "bearer.ipv4-config.gateway", "gateway", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_DNS] = { "bearer.ipv4-config.dns", "dns", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV4_CONFIG_MTU] = { "bearer.ipv4-config.mtu", "mtu", MMC_S_BEARER_IPV4_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_METHOD] = { "bearer.ipv6-config.method", "method", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_ADDRESS] = { "bearer.ipv6-config.address", "address", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_PREFIX] = { "bearer.ipv6-config.prefix", "prefix", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_GATEWAY] = { "bearer.ipv6-config.gateway", "gateway", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_DNS] = { "bearer.ipv6-config.dns", "dns", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_IPV6_CONFIG_MTU] = { "bearer.ipv6-config.mtu", "mtu", MMC_S_BEARER_IPV6_CONFIG, },
[MMC_F_BEARER_STATS_DURATION] = { "bearer.stats.duration", "duration", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_BYTES_RX] = { "bearer.stats.bytes-rx", "bytes rx", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_BYTES_TX] = { "bearer.stats.bytes-tx", "bytes tx", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_ATTEMPTS] = { "bearer.stats.attempts", "attempts", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_FAILED_ATTEMPTS] = { "bearer.stats.failed-attempts", "attempts", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_TOTAL_DURATION] = { "bearer.stats.total-duration", "total-duration", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_TOTAL_BYTES_RX] = { "bearer.stats.total-bytes-rx", "total-bytes rx", MMC_S_BEARER_STATS, },
[MMC_F_BEARER_STATS_TOTAL_BYTES_TX] = { "bearer.stats.total-bytes-tx", "total-bytes tx", MMC_S_BEARER_STATS, },
[MMC_F_CALL_GENERAL_DBUS_PATH] = { "call.dbus-path", "path", MMC_S_CALL_GENERAL, },
[MMC_F_CALL_PROPERTIES_NUMBER] = { "call.properties.number", "number", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_PROPERTIES_DIRECTION] = { "call.properties.direction", "direction", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_PROPERTIES_MULTIPARTY] = { "call.properties.multiparty", "multiparty", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_PROPERTIES_STATE] = { "call.properties.state", "state", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_PROPERTIES_STATE_REASON] = { "call.properties.state-reason", "state reason", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_PROPERTIES_AUDIO_PORT] = { "call.properties.audio-port", "audio port", MMC_S_CALL_PROPERTIES, },
[MMC_F_CALL_AUDIO_FORMAT_ENCODING] = { "call.audio-format.encoding", "encoding", MMC_S_CALL_AUDIO_FORMAT, },
[MMC_F_CALL_AUDIO_FORMAT_RESOLUTION] = { "call.audio-format.resolution", "resolution", MMC_S_CALL_AUDIO_FORMAT, },
[MMC_F_CALL_AUDIO_FORMAT_RATE] = { "call.audio-format.rate", "rate", MMC_S_CALL_AUDIO_FORMAT, },
[MMC_F_SMS_GENERAL_DBUS_PATH] = { "sms.dbus-path", "path", MMC_S_SMS_GENERAL, },
[MMC_F_SMS_CONTENT_NUMBER] = { "sms.content.number", "number", MMC_S_SMS_CONTENT, },
[MMC_F_SMS_CONTENT_TEXT] = { "sms.content.text", "text", MMC_S_SMS_CONTENT, },
[MMC_F_SMS_CONTENT_DATA] = { "sms.content.data", "data", MMC_S_SMS_CONTENT, },
[MMC_F_SMS_PROPERTIES_PDU_TYPE] = { "sms.properties.pdu-type", "pdu type", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_STATE] = { "sms.properties.state", "state", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_VALIDITY] = { "sms.properties.validity", "validity", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_STORAGE] = { "sms.properties.storage", "storage", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_SMSC] = { "sms.properties.smsc", "smsc", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_CLASS] = { "sms.properties.class", "class", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_TELESERVICE_ID] = { "sms.properties.teleservice-id", "teleservice id", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_SERVICE_CATEGORY] = { "sms.properties.service-category", "service category", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_DELIVERY_REPORT] = { "sms.properties.delivery-report", "delivery report", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_MSG_REFERENCE] = { "sms.properties.message-reference", "message reference", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_TIMESTAMP] = { "sms.properties.timestamp", "timestamp", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_DELIVERY_STATE] = { "sms.properties.delivery-state", "delivery state", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_DISCH_TIMESTAMP] = { "sms.properties.discharge-timestamp", "discharge timestamp", MMC_S_SMS_PROPERTIES, },
[MMC_F_SIM_GENERAL_DBUS_PATH] = { "sim.dbus-path", "path", MMC_S_SIM_GENERAL, },
[MMC_F_SIM_PROPERTIES_ACTIVE] = { "sim.properties.active", "active", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_IMSI] = { "sim.properties.imsi", "imsi", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_ICCID] = { "sim.properties.iccid", "iccid", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_EID] = { "sim.properties.eid", "eid", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_OPERATOR_ID] = { "sim.properties.operator-code", "operator id", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_OPERATOR_NAME] = { "sim.properties.operator-name", "operator name", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_EMERGENCY_NUMBERS] = { "sim.properties.emergency-numbers", "emergency numbers", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_PREFERRED_NETWORKS] = { "sim.properties.preferred-networks", "preferred networks", MMC_S_SIM_PROPERTIES, },
[MMC_F_MODEM_LIST_DBUS_PATH] = { "modem-list", "modems", MMC_S_UNKNOWN, },
[MMC_F_SMS_LIST_DBUS_PATH] = { "modem.messaging.sms", "sms messages", MMC_S_UNKNOWN, },
[MMC_F_CALL_LIST_DBUS_PATH] = { "modem.voice.call", "calls", MMC_S_UNKNOWN, },
};
/******************************************************************************/
@@ -839,6 +842,150 @@ mmcli_output_preferred_networks (GList *preferred_nets_list)
}
}
/******************************************************************************/
/* (Custom) Profile list output */
static void
build_profile_human (GPtrArray *array,
MM3gppProfile *profile)
{
const gchar *aux;
MMBearerAllowedAuth allowed_auth;
MMBearerIpFamily ip_type;
MMBearerApnType apn_type;
g_ptr_array_add (array, g_strdup_printf ("profile-id: %u", mm_3gpp_profile_get_profile_id (profile)));
if ((aux = mm_3gpp_profile_get_apn (profile)) != NULL)
g_ptr_array_add (array, g_strdup_printf (" apn: %s", aux));
allowed_auth = mm_3gpp_profile_get_allowed_auth (profile);
if (allowed_auth != MM_BEARER_ALLOWED_AUTH_NONE) {
g_autofree gchar *allowed_auth_str = NULL;
allowed_auth_str = mm_bearer_allowed_auth_build_string_from_mask (allowed_auth);
g_ptr_array_add (array, g_strdup_printf (" allowed-auth: %s", allowed_auth_str));
}
if ((aux = mm_3gpp_profile_get_user (profile)) != NULL)
g_ptr_array_add (array, g_strdup_printf (" user: %s", aux));
if ((aux = mm_3gpp_profile_get_password (profile)) != NULL)
g_ptr_array_add (array, g_strdup_printf (" password: %s", aux));
ip_type = mm_3gpp_profile_get_ip_type (profile);
if (ip_type != MM_BEARER_IP_FAMILY_NONE) {
g_autofree gchar *ip_type_str = NULL;
ip_type_str = mm_bearer_ip_family_build_string_from_mask (ip_type);
g_ptr_array_add (array, g_strdup_printf (" ip-type: %s", ip_type_str));
}
apn_type = mm_3gpp_profile_get_apn_type (profile);
if (apn_type != MM_BEARER_APN_TYPE_NONE) {
g_autofree gchar *apn_type_str = NULL;
apn_type_str = mm_bearer_apn_type_build_string_from_mask (apn_type);
g_ptr_array_add (array, g_strdup_printf (" apn-type: %s", apn_type_str));
}
}
static void
build_profile_keyvalue (GPtrArray *array,
MM3gppProfile *profile)
{
GString *str;
const gchar *aux;
MMBearerAllowedAuth allowed_auth;
MMBearerIpFamily ip_type;
MMBearerApnType apn_type;
str = g_string_new ("");
g_string_append_printf (str, "profile-id: %u", mm_3gpp_profile_get_profile_id (profile));
if ((aux = mm_3gpp_profile_get_apn (profile)) != NULL)
g_string_append_printf (str, ", apn: %s", aux);
allowed_auth = mm_3gpp_profile_get_allowed_auth (profile);
if (allowed_auth != MM_BEARER_ALLOWED_AUTH_NONE) {
g_autofree gchar *allowed_auth_str = NULL;
allowed_auth_str = mm_bearer_allowed_auth_build_string_from_mask (allowed_auth);
g_string_append_printf (str, ", allowed-auth: %s", allowed_auth_str);
}
if ((aux = mm_3gpp_profile_get_user (profile)) != NULL)
g_string_append_printf (str, ", user: %s", aux);
if ((aux = mm_3gpp_profile_get_password (profile)) != NULL)
g_string_append_printf (str, ", password: %s", aux);
ip_type = mm_3gpp_profile_get_ip_type (profile);
if (ip_type != MM_BEARER_IP_FAMILY_NONE) {
g_autofree gchar *ip_type_str = NULL;
ip_type_str = mm_bearer_ip_family_build_string_from_mask (ip_type);
g_string_append_printf (str, ", ip-type: %s", ip_type_str);
}
apn_type = mm_3gpp_profile_get_apn_type (profile);
if (apn_type != MM_BEARER_APN_TYPE_NONE) {
g_autofree gchar *apn_type_str = NULL;
apn_type_str = mm_bearer_apn_type_build_string_from_mask (apn_type);
g_string_append_printf (str, ", apn-type: %s", apn_type_str);
}
g_ptr_array_add (array, g_string_free (str, FALSE));
}
static void
output_profile_list (MmcF field,
GList *profile_list)
{
gchar **profiles = NULL;
if (profile_list) {
GPtrArray *aux;
GList *l;
aux = g_ptr_array_new ();
for (l = profile_list; l; l = g_list_next (l)) {
MM3gppProfile *profile = (MM3gppProfile *)(l->data);
if (selected_type == MMC_OUTPUT_TYPE_HUMAN)
build_profile_human (aux, profile);
else
build_profile_keyvalue (aux, profile);
}
g_ptr_array_add (aux, NULL);
profiles = (gchar **) g_ptr_array_free (aux, FALSE);
}
/* When printing human result, we want to show some result even if no profiles
* are found, so we force a explicit string result. */
if (selected_type == MMC_OUTPUT_TYPE_HUMAN && !profiles)
output_item_new_take_single (field, g_strdup ("n/a"));
else
output_item_new_take_multiple (field, profiles, TRUE);
}
void
mmcli_output_profile_list (GList *profile_list)
{
output_profile_list (MMC_F_3GPP_PROFILE_MANAGER_LIST, profile_list);
}
void
mmcli_output_profile_set (MM3gppProfile *profile)
{
GList *profile_list = NULL;
profile_list = g_list_append (profile_list, profile);
output_profile_list (MMC_F_3GPP_PROFILE_MANAGER_SET, profile_list);
g_list_free (profile_list);
}
/******************************************************************************/
/* Human-friendly output */

View File

@@ -42,6 +42,7 @@ typedef enum {
MMC_S_MODEM_3GPP_EPS,
MMC_S_MODEM_3GPP_SCAN,
MMC_S_MODEM_3GPP_USSD,
MMC_S_MODEM_3GPP_PROFILE_MANAGER,
MMC_S_MODEM_CDMA,
MMC_S_MODEM_SIM,
MMC_S_MODEM_BEARER,
@@ -140,6 +141,9 @@ typedef enum {
MMC_F_3GPP_EPS_BEARER_SETTINGS_PASSWORD,
/* 3GPP scan section */
MMC_F_3GPP_SCAN_NETWORKS,
/* 3GPP profile management section */
MMC_F_3GPP_PROFILE_MANAGER_LIST,
MMC_F_3GPP_PROFILE_MANAGER_SET,
/* USSD section */
MMC_F_3GPP_USSD_STATUS,
MMC_F_3GPP_USSD_NETWORK_REQUEST,
@@ -356,6 +360,8 @@ void mmcli_output_firmware_list (GList *firmware_list,
MMFirmwareProperties *selected);
void mmcli_output_pco_list (GList *pco_list);
void mmcli_output_preferred_networks (GList *preferred_nets_list);
void mmcli_output_profile_list (GList *profile_list);
void mmcli_output_profile_set (MM3gppProfile *profile);
/******************************************************************************/
/* Dump output */

View File

@@ -211,6 +211,8 @@ main (gint argc, gchar **argv)
mmcli_modem_get_option_group ());
g_option_context_add_group (context,
mmcli_modem_3gpp_get_option_group ());
g_option_context_add_group (context,
mmcli_modem_3gpp_profile_manager_get_option_group ());
g_option_context_add_group (context,
mmcli_modem_3gpp_ussd_get_option_group ());
g_option_context_add_group (context,
@@ -337,6 +339,13 @@ main (gint argc, gchar **argv)
else
mmcli_modem_3gpp_run_synchronous (connection);
}
/* Modem 3GPP profile manager options? */
else if (mmcli_modem_3gpp_profile_manager_options_enabled ()) {
if (async_flag)
mmcli_modem_3gpp_profile_manager_run_asynchronous (connection, cancellable);
else
mmcli_modem_3gpp_profile_manager_run_synchronous (connection);
}
/* Modem 3GPP USSD options? */
else if (mmcli_modem_3gpp_ussd_options_enabled ()) {
if (async_flag)
@@ -431,6 +440,8 @@ main (gint argc, gchar **argv)
mmcli_manager_shutdown ();
} else if (mmcli_modem_3gpp_options_enabled ()) {
mmcli_modem_3gpp_shutdown ();
} else if (mmcli_modem_3gpp_profile_manager_options_enabled ()) {
mmcli_modem_3gpp_profile_manager_shutdown ();
} else if (mmcli_modem_3gpp_ussd_options_enabled ()) {
mmcli_modem_3gpp_ussd_shutdown ();
} else if (mmcli_modem_cdma_options_enabled ()) {

View File

@@ -61,6 +61,14 @@ void mmcli_modem_3gpp_ussd_run_asynchronous (GDBusConnection *connect
void mmcli_modem_3gpp_ussd_run_synchronous (GDBusConnection *connection);
void mmcli_modem_3gpp_ussd_shutdown (void);
/* 3GPP profile manager group */
GOptionGroup *mmcli_modem_3gpp_profile_manager_get_option_group (void);
gboolean mmcli_modem_3gpp_profile_manager_options_enabled (void);
void mmcli_modem_3gpp_profile_manager_run_asynchronous (GDBusConnection *connection,
GCancellable *cancellable);
void mmcli_modem_3gpp_profile_manager_run_synchronous (GDBusConnection *connection);
void mmcli_modem_3gpp_profile_manager_shutdown (void);
/* CDMA group */
GOptionGroup *mmcli_modem_cdma_get_option_group (void);
gboolean mmcli_modem_cdma_options_enabled (void);

View File

@@ -71,6 +71,7 @@ expand_content_files = \
$(top_builddir)/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml \
$(top_builddir)/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml \
$(top_builddir)/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml \
$(top_builddir)/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml \
$(top_builddir)/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml \
$(top_builddir)/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml \
$(top_builddir)/libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Signal.xml \

View File

@@ -130,6 +130,7 @@
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.xml"/>
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml"/>
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml"/>
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml"/>
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml"/>
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml"/>
<xi:include href="../../../../libmm-glib/generated/mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Messaging.xml"/>

View File

@@ -105,6 +105,7 @@
</section>
<section>
<title>Profile management support</title>
<xi:include href="xml/mm-modem-3gpp-profile-manager.xml"/>
<xi:include href="xml/mm-3gpp-profile.xml"/>
</section>
<section>
@@ -197,6 +198,10 @@
<xi:include href="xml/MmGdbusModem3gppProxy.xml"/>
<xi:include href="xml/MmGdbusModem3gppSkeleton.xml"/>
<xi:include href="xml/MmGdbusModem3gppProfileManager.xml"/>
<xi:include href="xml/MmGdbusModem3gppProfileManagerProxy.xml"/>
<xi:include href="xml/MmGdbusModem3gppProfileManagerSkeleton.xml"/>
<xi:include href="xml/MmGdbusModem3gppUssd.xml"/>
<xi:include href="xml/MmGdbusModem3gppUssdProxy.xml"/>
<xi:include href="xml/MmGdbusModem3gppUssdSkeleton.xml"/>

View File

@@ -85,6 +85,8 @@ mm_object_peek_modem
mm_object_get_modem
mm_object_peek_modem_3gpp
mm_object_get_modem_3gpp
mm_object_peek_modem_3gpp_profile_manager
mm_object_get_modem_3gpp_profile_manager
mm_object_peek_modem_3gpp_ussd
mm_object_get_modem_3gpp_ussd
mm_object_peek_modem_cdma
@@ -1575,6 +1577,34 @@ MM_TYPE_3GPP_PROFILE
mm_3gpp_profile_get_type
</SECTION>
<SECTION>
<FILE>mm-modem-3gpp-profile-manager</FILE>
<TITLE>MMModem3gppProfileManager</TITLE>
MMModem3gppProfileManager
<SUBSECTION Getters>
mm_modem_3gpp_profile_manager_get_path
mm_modem_3gpp_profile_manager_dup_path
<SUBSECTION Methods>
mm_modem_3gpp_profile_manager_list
mm_modem_3gpp_profile_manager_list_finish
mm_modem_3gpp_profile_manager_list_sync
mm_modem_3gpp_profile_manager_set
mm_modem_3gpp_profile_manager_set_finish
mm_modem_3gpp_profile_manager_set_sync
mm_modem_3gpp_profile_manager_delete
mm_modem_3gpp_profile_manager_delete_finish
mm_modem_3gpp_profile_manager_delete_sync
<SUBSECTION Standard>
MMModem3gppProfileManagerClass
MM_IS_MODEM_3GPP_PROFILE_MANAGER
MM_IS_MODEM_3GPP_PROFILE_MANAGER_CLASS
MM_MODEM_3GPP_PROFILE_MANAGER
MM_MODEM_3GPP_PROFILE_MANAGER_CLASS
MM_MODEM_3GPP_PROFILE_MANAGER_GET_CLASS
MM_TYPE_MODEM_3GPP_PROFILE_MANAGER
mm_modem_3gpp_profile_manager_get_type
</SECTION>
<SECTION>
<FILE>mm-enums-types</FILE>
<TITLE>Flags and Enumerations</TITLE>
@@ -2137,6 +2167,77 @@ MmGdbusModem3gppUssdSkeletonPrivate
mm_gdbus_modem3gpp_ussd_skeleton_get_type
</SECTION>
<SECTION>
<FILE>MmGdbusModem3gppProfileManager</FILE>
<TITLE>MmGdbusModem3gppProfileManager</TITLE>
MmGdbusModem3gppProfileManager
MmGdbusModem3gppProfileManagerIface
<SUBSECTION Methods>
mm_gdbus_modem3gpp_profile_manager_call_delete
mm_gdbus_modem3gpp_profile_manager_call_delete_finish
mm_gdbus_modem3gpp_profile_manager_call_delete_sync
mm_gdbus_modem3gpp_profile_manager_call_list
mm_gdbus_modem3gpp_profile_manager_call_list_finish
mm_gdbus_modem3gpp_profile_manager_call_list_sync
mm_gdbus_modem3gpp_profile_manager_call_set
mm_gdbus_modem3gpp_profile_manager_call_set_finish
mm_gdbus_modem3gpp_profile_manager_call_set_sync
<SUBSECTION Private>
mm_gdbus_modem3gpp_profile_manager_emit_updated
mm_gdbus_modem3gpp_profile_manager_complete_delete
mm_gdbus_modem3gpp_profile_manager_complete_list
mm_gdbus_modem3gpp_profile_manager_complete_set
mm_gdbus_modem3gpp_profile_manager_interface_info
mm_gdbus_modem3gpp_profile_manager_override_properties
<SUBSECTION Standard>
MM_GDBUS_IS_MODEM3GPP_PROFILE_MANAGER
MM_GDBUS_MODEM3GPP_PROFILE_MANAGER
MM_GDBUS_MODEM3GPP_PROFILE_MANAGER_GET_IFACE
MM_GDBUS_TYPE_MODEM3GPP_PROFILE_MANAGER
mm_gdbus_modem3gpp_profile_manager_get_type
</SECTION>
<SECTION>
<FILE>MmGdbusModem3gppProfileManagerProxy</FILE>
<TITLE>MmGdbusModem3gppProfileManagerProxy</TITLE>
MmGdbusModem3gppProfileManagerProxy
<SUBSECTION New>
mm_gdbus_modem3gpp_profile_manager_proxy_new
mm_gdbus_modem3gpp_profile_manager_proxy_new_finish
mm_gdbus_modem3gpp_profile_manager_proxy_new_for_bus
mm_gdbus_modem3gpp_profile_manager_proxy_new_for_bus_finish
mm_gdbus_modem3gpp_profile_manager_proxy_new_for_bus_sync
mm_gdbus_modem3gpp_profile_manager_proxy_new_sync
<SUBSECTION Standard>
MmGdbusModem3gppProfileManagerProxyClass
MM_GDBUS_IS_MODEM3GPP_PROFILE_MANAGER_PROXY
MM_GDBUS_IS_MODEM3GPP_PROFILE_MANAGER_PROXY_CLASS
MM_GDBUS_MODEM3GPP_PROFILE_MANAGER_PROXY
MM_GDBUS_MODEM3GPP_PROFILE_MANAGER_PROXY_CLASS
MM_GDBUS_MODEM3GPP_PROFILE_MANAGER_PROXY_GET_CLASS
MM_GDBUS_TYPE_MODEM3GPP_PROFILE_MANAGER_PROXY
MmGdbusModem3gppProfileManagerProxyPrivate
mm_gdbus_modem3gpp_profile_manager_proxy_get_type
</SECTION>
<SECTION>
<FILE>MmGdbusModem3gppProfileManagerSkeleton</FILE>
<TITLE>MmGdbusModem3gppProfileManagerSkeleton</TITLE>
MmGdbusModem3gppProfileManagerSkeleton
<SUBSECTION New>
mm_gdbus_modem3gpp_profile_manager_skeleton_new
<SUBSECTION Standard>
MmGdbusModem3gppProfileManagerSkeletonClass
MM_GDBUS_IS_MODEM3GPP_PROFILE_MANAGER_SKELETON
MM_GDBUS_IS_MODEM3GPP_PROFILE_MANAGER_SKELETON_CLASS
MM_GDBUS_MODEM3GPP_PROFILE_MANAGER_SKELETON
MM_GDBUS_MODEM3GPP_PROFILE_MANAGER_SKELETON_CLASS
MM_GDBUS_MODEM3GPP_PROFILE_MANAGER_SKELETON_GET_CLASS
MM_GDBUS_TYPE_MODEM3GPP_PROFILE_MANAGER_SKELETON
MmGdbusModem3gppProfileManagerSkeletonPrivate
mm_gdbus_modem3gpp_profile_manager_skeleton_get_type
</SECTION>
<SECTION>
<FILE>MmGdbusModem</FILE>
<TITLE>MmGdbusModem</TITLE>
@@ -3166,6 +3267,8 @@ mm_gdbus_object_peek_modem3gpp
mm_gdbus_object_get_modem3gpp
mm_gdbus_object_peek_modem3gpp_ussd
mm_gdbus_object_get_modem3gpp_ussd
mm_gdbus_object_peek_modem3gpp_profile_manager
mm_gdbus_object_get_modem3gpp_profile_manager
mm_gdbus_object_peek_modem_cdma
mm_gdbus_object_get_modem_cdma
mm_gdbus_object_peek_modem_location
@@ -3224,6 +3327,7 @@ mm_gdbus_object_skeleton_new
mm_gdbus_object_skeleton_set_modem
mm_gdbus_object_skeleton_set_modem3gpp
mm_gdbus_object_skeleton_set_modem3gpp_ussd
mm_gdbus_object_skeleton_set_modem3gpp_profile_manager
mm_gdbus_object_skeleton_set_modem_cdma
mm_gdbus_object_skeleton_set_modem_firmware
mm_gdbus_object_skeleton_set_modem_oma

View File

@@ -22,6 +22,7 @@ xml_DATA = \
org.freedesktop.ModemManager1.Modem.Voice.xml \
org.freedesktop.ModemManager1.Call.xml \
org.freedesktop.ModemManager1.Modem.Sar.xml \
org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml \
$(NULL)
EXTRA_DIST = \

View File

@@ -10,6 +10,7 @@
<xi:include href="org.freedesktop.ModemManager1.Modem.xml"/>
<xi:include href="org.freedesktop.ModemManager1.Modem.Voice.xml"/>
<xi:include href="org.freedesktop.ModemManager1.Modem.Modem3gpp.xml"/>
<xi:include href="org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml"/>
<xi:include href="org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml"/>
<xi:include href="org.freedesktop.ModemManager1.Modem.ModemCdma.xml"/>
<xi:include href="org.freedesktop.ModemManager1.Modem.Messaging.xml"/>

View File

@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
ModemManager 1.0 Interface Specification
Copyright (C) 2021 Google Inc.
Copyright (C) 2021 Aleksander Morgado
-->
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
<!--
org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager:
@short_description: The ModemManager 3GPP profile management interface.
This interface provides access to actions with connection profiles.
This interface will only be available once the modem is ready to be
registered in the cellular network. 3GPP devices will require a valid
unlocked SIM card before any of the features in the interface can be
used.
The user of the interface can optionally choose to use the new profile
management methods to manage the connection setup, e.g by using the new
<literal>"profile-id"</literal> setting in either the
<link linkend="gdbus-method-org-freedesktop-ModemManager1-Modem.CreateBearer">CreateBearer</link>
or the
<link linkend="gdbus-method-org-freedesktop-ModemManager1-Modem-Simple.Connect">Connect</link>
methods. If that's the case, it is suggested that the legacy approach of
not using the profiles is completely avoided. If both approaches are
used at the same time, it may happen that a connection attempt not using
the <literal>"profile-id"</literal> implicitly updates a given profile
(without emitting
<link linkend="gdbus-signal-org-freedesktop-ModemManager1-Modem-Modem3gpp-ProfileManager.Updated">Updated</link>),
as the amount of profiles implemented in modems may be fixed.
-->
<interface name="org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager">
<!--
List:
@profiles: An array of dictionaries containing the properties of the provisioned profiles.
Lists the available profiles or contexts provisioned on the modem.
Profiles are represented as dictionaries of properties, and any of the
3GPP-specific properties defined in the
<link linkend="gdbus-property-org-freedesktop-ModemManager1-Bearer.Properties">bearer properties</link>
are allowed.
Depending on the implementation, the settings applicable to the initial
EPS bearer given in
<link linkend="gdbus-property-org-freedesktop-ModemManager1-Modem-Modem3gpp.InitialEpsBearerSettings">bearer properties</link>
may also be reported as an item in the returned list, identified by the
%MM_BEARER_APN_TYPE_INITIAL <literal>"apn-type"</literal> flag.
Since: 1.18
-->
<method name="List">
<arg name="profiles" type="aa{sv}" direction="out" />
</method>
<!--
Set:
@requested_properties: the requested profile properties.
@stored_properties: the stored profile properties.
Creates or updates a connection profile on this modem. If
<literal>"profile-id"</literal> is not given, a new profile will be
created; otherwise, the profile with the given ID will be updated.
Profiles are represented as dictionaries of properties, and any of the
3GPP-specific properties defined in the
<link linkend="gdbus-property-org-freedesktop-ModemManager1-Bearer.Properties">bearer properties</link>
are allowed. The real list of supported properties really depends on the
underlying protocol and implementation, though; e.g. in AT-based modems
setting <literal>"apn-type"</literal> won't be supported, and instead the
user should give that setting explicitly when creating the bearer object.
The operation may fail if it is attempting to update an existing
profile for which connected bearer objects already exist. In this case,
the user should make sure these bearer objects are already disconnected
before attempting to change the profile settings.
The operation may also fail if it is attempting to update the profile
associated to the settings of the initial EPS bearer, identified by the
%MM_BEARER_APN_TYPE_INITIAL <literal>"apn-type"</literal> flag. In this
case, <link linkend="gdbus-method-org-freedesktop-ModemManager1-Modem-Modem3gpp.SetInitialEpsBearerSettings">SetInitialEpsBearerSettings()</link>
should be used instead.
The output @stored_properties will contain the settings that were
successfully stored, including the new <literal>"profile-id"</literal>
if the operation was creating a new profile.
Since: 1.18
-->
<method name="Set">
<arg name="requested_properties" type="a{sv}" direction="in" />
<arg name="stored_properties" type="a{sv}" direction="out" />
</method>
<!--
Delete:
@properties: the profile properties.
Deletes the profile with the <literal>"profile-id"</literal> given in @properties.
If additional settings are given in @properties they are ignored. This
allows the user to easily request the deletion of a profile that has been
provided in the List() operation.
This method may just clear the existing profiles (i.e. reseting all the
properties to defaults) instead of fully removing them if the profiles
cannot be fully removed. In this case, the method will succeed, but the
size of the list of profiles will not change.
This method will fail if <literal>"profile-id"</literal> is not given.
The operation may fail if it is attempting to delete a profile
for which connected bearer objects already exist. In this case,
the user should make sure these bearer objects are already disconnected
before attempting to delete the profile.
The operation may also fail if it is attempting to delete the profile
associated to the settings of the initial EPS bearer, identified by the
%MM_BEARER_APN_TYPE_INITIAL <literal>"apn-type"</literal> flag. In this
case, <link linkend="gdbus-method-org-freedesktop-ModemManager1-Modem-Modem3gpp.SetInitialEpsBearerSettings">SetInitialEpsBearerSettings()</link>
may be used instead to clear these settings.
Since: 1.18
-->
<method name="Delete">
<arg name="properties" type="a{sv}" direction="in" />
</method>
<!--
Updated:
Emitted when the profiles are updated by the network through OTA
procedures.
Since: 1.18
-->
<signal name="Updated" />
</interface>
</node>

View File

@@ -18,6 +18,8 @@ libmm_glib_la_SOURCES = \
mm-modem.c \
mm-modem-3gpp.h \
mm-modem-3gpp.c \
mm-modem-3gpp-profile-manager.h \
mm-modem-3gpp-profile-manager.c \
mm-modem-3gpp-ussd.h \
mm-modem-3gpp-ussd.c \
mm-modem-cdma.h \
@@ -129,6 +131,7 @@ include_HEADERS = \
mm-object.h \
mm-modem.h \
mm-modem-3gpp.h \
mm-modem-3gpp-profile-manager.h \
mm-modem-3gpp-ussd.h \
mm-modem-cdma.h \
mm-modem-messaging.h \

View File

@@ -44,6 +44,7 @@ GENERATED_DOC = \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Sar.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml \
@@ -119,6 +120,7 @@ mm_gdbus_modem_generated = \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Oma.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.ModemCdma.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Sar.xml \
mm-gdbus-doc-org.freedesktop.ModemManager1.Modem.Simple.xml \
@@ -134,6 +136,7 @@ mm_gdbus_modem_deps = \
$(top_srcdir)/introspection/org.freedesktop.ModemManager1.Modem.Oma.xml \
$(top_srcdir)/introspection/org.freedesktop.ModemManager1.Modem.ModemCdma.xml \
$(top_srcdir)/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.xml \
$(top_srcdir)/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml \
$(top_srcdir)/introspection/org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml \
$(top_srcdir)/introspection/org.freedesktop.ModemManager1.Modem.Sar.xml \
$(top_srcdir)/introspection/org.freedesktop.ModemManager1.Modem.Simple.xml \
@@ -149,6 +152,7 @@ mm-gdbus-modem.c: $(mm_gdbus_modem_deps)
--annotate "org.freedesktop.ModemManager1.Modem.ModemCdma" org.gtk.GDBus.C.Name ModemCdma \
--annotate "org.freedesktop.ModemManager1.Modem.Modem3gpp" org.gtk.GDBus.C.Name Modem3gpp \
--annotate "org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd" org.gtk.GDBus.C.Name Modem3gppUssd \
--annotate "org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager" org.gtk.GDBus.C.Name Modem3gppProfileManager \
$^ \
$(NULL)
$(filter-out mm-gdbus-modem.c, $(mm_gdbus_modem_generated)): $(mm_gdbus_modem_deps) mm-gdbus-modem.c

View File

@@ -40,6 +40,7 @@
# include <mm-bearer.h>
# include <mm-modem.h>
# include <mm-modem-3gpp.h>
# include <mm-modem-3gpp-profile-manager.h>
# include <mm-modem-3gpp-ussd.h>
# include <mm-modem-cdma.h>
# include <mm-modem-simple.h>

View File

@@ -65,19 +65,20 @@ get_proxy_type (GDBusObjectManagerClient *manager,
if (g_once_init_enter (&once_init_value)) {
lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem", GSIZE_TO_POINTER (MM_TYPE_MODEM));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Messaging", GSIZE_TO_POINTER (MM_TYPE_MODEM_MESSAGING));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Voice", GSIZE_TO_POINTER (MM_TYPE_MODEM_VOICE));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Location", GSIZE_TO_POINTER (MM_TYPE_MODEM_LOCATION));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Time", GSIZE_TO_POINTER (MM_TYPE_MODEM_TIME));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Signal", GSIZE_TO_POINTER (MM_TYPE_MODEM_SIGNAL));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Firmware", GSIZE_TO_POINTER (MM_TYPE_MODEM_FIRMWARE));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Oma", GSIZE_TO_POINTER (MM_TYPE_MODEM_OMA));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.ModemCdma", GSIZE_TO_POINTER (MM_TYPE_MODEM_CDMA));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Modem3gpp", GSIZE_TO_POINTER (MM_TYPE_MODEM_3GPP));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd", GSIZE_TO_POINTER (MM_TYPE_MODEM_3GPP_USSD));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Simple", GSIZE_TO_POINTER (MM_TYPE_MODEM_SIMPLE));
/* g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Contacts", GSIZE_TO_POINTER (MM_GDBUS_TYPE_MODEM_CONTACTS_PROXY)); */
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem", GSIZE_TO_POINTER (MM_TYPE_MODEM));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Messaging", GSIZE_TO_POINTER (MM_TYPE_MODEM_MESSAGING));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Voice", GSIZE_TO_POINTER (MM_TYPE_MODEM_VOICE));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Location", GSIZE_TO_POINTER (MM_TYPE_MODEM_LOCATION));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Time", GSIZE_TO_POINTER (MM_TYPE_MODEM_TIME));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Signal", GSIZE_TO_POINTER (MM_TYPE_MODEM_SIGNAL));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Firmware", GSIZE_TO_POINTER (MM_TYPE_MODEM_FIRMWARE));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Oma", GSIZE_TO_POINTER (MM_TYPE_MODEM_OMA));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.ModemCdma", GSIZE_TO_POINTER (MM_TYPE_MODEM_CDMA));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Modem3gpp", GSIZE_TO_POINTER (MM_TYPE_MODEM_3GPP));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager", GSIZE_TO_POINTER (MM_TYPE_MODEM_3GPP_PROFILE_MANAGER));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd", GSIZE_TO_POINTER (MM_TYPE_MODEM_3GPP_USSD));
g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Simple", GSIZE_TO_POINTER (MM_TYPE_MODEM_SIMPLE));
/* g_hash_table_insert (lookup_hash, "org.freedesktop.ModemManager1.Modem.Contacts", GSIZE_TO_POINTER (MM_GDBUS_TYPE_MODEM_CONTACTS_PROXY)); */
g_once_init_leave (&once_init_value, 1);
}

View File

@@ -0,0 +1,489 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* libmm -- Access modem status & information from glib applications
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* Copyright (C) 2021 Aleksander Morgado <aleksander@aleksander.es>
* Copyright (C) 2021 Google, Inc.
*/
#include <gio/gio.h>
#include "mm-helpers.h"
#include "mm-errors-types.h"
#include "mm-modem-3gpp-profile-manager.h"
/**
* SECTION: mm-modem-3gpp-profile-manager
* @title: MMModem3gppProfileManager
* @short_description: The 3GPP profile manager interface
*
* The #MMModem3gppProfileManager is an object providing access to the methods
* and signals of the 3GPP Profile Manager interface.
*
* This interface is only exposed when the 3GPP modem is known to handle profile
* management operations.
*/
G_DEFINE_TYPE (MMModem3gppProfileManager, mm_modem_3gpp_profile_manager, MM_GDBUS_TYPE_MODEM3GPP_PROFILE_MANAGER_PROXY)
/*****************************************************************************/
/**
* mm_modem_3gpp_profile_manager_get_path:
* @self: A #MMModem3gppProfileManager.
*
* Gets the DBus path of the #MMObject which implements this interface.
*
* Returns: (transfer none): The DBus path of the #MMObject object.
*
* Since: 1.18
*/
const gchar *
mm_modem_3gpp_profile_manager_get_path (MMModem3gppProfileManager *self)
{
g_return_val_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self), NULL);
RETURN_NON_EMPTY_CONSTANT_STRING (
g_dbus_proxy_get_object_path (G_DBUS_PROXY (self)));
}
/**
* mm_modem_3gpp_profile_manager_dup_path:
* @self: A #MMModem3gppProfileManager.
*
* Gets a copy of the DBus path of the #MMObject object which implements this
* interface.
*
* Returns: (transfer full): The DBus path of the #MMObject. The returned value
* should be freed with g_free().
*
* Since: 1.18
*/
gchar *
mm_modem_3gpp_profile_manager_dup_path (MMModem3gppProfileManager *self)
{
gchar *value;
g_return_val_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self), NULL);
g_object_get (G_OBJECT (self),
"g-object-path", &value,
NULL);
RETURN_NON_EMPTY_STRING (value);
}
/*****************************************************************************/
static gboolean
build_list_results (GVariant *dictionaries,
GList **out_profiles,
GError **error)
{
g_autoptr(GError) saved_error = NULL;
GVariantIter iter;
guint n;
GList *profiles = NULL;
if (out_profiles)
*out_profiles = NULL;
if (!dictionaries)
return TRUE;
/* Parse array of dictionaries */
g_variant_iter_init (&iter, dictionaries);
n = g_variant_iter_n_children (&iter);
if (n > 0) {
g_autoptr(GVariant) dictionary = NULL;
while ((dictionary = g_variant_iter_next_value (&iter))) {
MM3gppProfile *profile = NULL;
g_autoptr(GError) inner_error = NULL;
profile = mm_3gpp_profile_new_from_dictionary (dictionary, &inner_error);
if (!profile) {
g_warning ("Couldn't create 3GPP profile: %s", inner_error->message);
if (!saved_error)
saved_error = g_steal_pointer (&inner_error);
} else
profiles = g_list_append (profiles, profile);
}
}
if (saved_error && !profiles) {
g_propagate_error (error, g_steal_pointer (&saved_error));
return FALSE;
}
if (out_profiles)
*out_profiles = profiles;
else
g_list_free_full (profiles, g_object_unref);
return TRUE;
}
/**
* mm_modem_3gpp_profile_manager_list_finish:
* @self: A #MMModem3gppProfileManager.
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to
* mm_modem_3gpp_profile_manager_list().
* @profiles: (out) (allow-none) (transfer full) (element-type ModemManager.3gppProfile):
* A list of #MM3gppProfile objects available in the device. The returned value
* should be freed with g_list_free_full() using g_object_unref() as
* #GDestroyNotify.
* @error: Return location for error or %NULL.
*
* Finishes an operation started with mm_modem_3gpp_profile_manager_list().
*
* Returns: %TRUE if the list was correctly retrieved, %FALSE if @error is set.
*
* Since: 1.18
*/
gboolean
mm_modem_3gpp_profile_manager_list_finish (MMModem3gppProfileManager *self,
GAsyncResult *res,
GList **profiles,
GError **error)
{
g_autoptr(GVariant) dictionaries = NULL;
g_return_val_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self), FALSE);
if (!mm_gdbus_modem3gpp_profile_manager_call_list_finish (MM_GDBUS_MODEM3GPP_PROFILE_MANAGER (self),
&dictionaries,
res,
error))
return FALSE;
return build_list_results (dictionaries, profiles, error);
}
/**
* mm_modem_3gpp_profile_manager_list:
* @self: A #MMModem3gppProfileManager.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or
* %NULL.
* @user_data: User data to pass to @callback.
*
* Asynchronously gets the list of available connection profiles.
*
* When the operation is finished, @callback will be invoked in the
* <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
* of the thread you are calling this method from. You can then call
* mm_modem_3gpp_profile_manager_list_finish() to get the result of the
* operation.
*
* See mm_modem_3gpp_profile_manager_list_sync() for the synchronous, blocking
* version of this method.
*
* Since: 1.18
*/
void
mm_modem_3gpp_profile_manager_list (MMModem3gppProfileManager *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_return_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self));
mm_gdbus_modem3gpp_profile_manager_call_list (MM_GDBUS_MODEM3GPP_PROFILE_MANAGER (self),
cancellable,
callback,
user_data);
}
/**
* mm_modem_3gpp_profile_manager_list_sync:
* @self: A #MMModem3gppProfileManager.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @profiles: (out) (allow-none) (transfer full) (element-type ModemManager.3gppProfile):
* A list of #MM3gppProfile objects available in the device. The returned value
* should be freed with g_list_free_full() using g_object_unref() as
* #GDestroyNotify.
* @error: Return location for error or %NULL.
*
* Synchronously gets the list of available connection profiles.
*
* The calling thread is blocked until a reply is received. See
* mm_modem_3gpp_profile_manager_list() for the asynchronous version of this
* method.
*
* Returns: %TRUE if the list was correctly retrieved, %FALSE if @error is set.
*
* Since: 1.18
*/
gboolean
mm_modem_3gpp_profile_manager_list_sync (MMModem3gppProfileManager *self,
GCancellable *cancellable,
GList **profiles,
GError **error)
{
g_autoptr(GVariant) dictionaries = NULL;
g_return_val_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self), FALSE);
if (!mm_gdbus_modem3gpp_profile_manager_call_list_sync (MM_GDBUS_MODEM3GPP_PROFILE_MANAGER (self),
&dictionaries,
cancellable,
error))
return FALSE;
return build_list_results (dictionaries, profiles, error);
}
/*****************************************************************************/
/**
* mm_modem_3gpp_profile_manager_set_finish:
* @self: A #MMModem3gppProfileManager.
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to
* mm_modem_3gpp_profile_manager_set().
* @error: Return location for error or %NULL.
*
* Finishes an operation started with mm_modem_3gpp_profile_manager_set().
*
* Returns: (transfer full): A #MM3gppProfile with the stored settings, or %NULL if @error is set.
*
* Since: 1.18
*/
MM3gppProfile *
mm_modem_3gpp_profile_manager_set_finish (MMModem3gppProfileManager *self,
GAsyncResult *res,
GError **error)
{
g_autoptr(GVariant) stored_dictionary = NULL;
g_return_val_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self), NULL);
if (!mm_gdbus_modem3gpp_profile_manager_call_set_finish (MM_GDBUS_MODEM3GPP_PROFILE_MANAGER (self),
&stored_dictionary,
res,
error))
return NULL;
return mm_3gpp_profile_new_from_dictionary (stored_dictionary, error);
}
/**
* mm_modem_3gpp_profile_manager_set:
* @self: A #MMModem3gppProfileManager.
* @requested: A #MM3gppProfile with the requested settings.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or
* %NULL.
* @user_data: User data to pass to @callback.
*
* Asynchronously updates a connection profile with the settings
* given in @profile.
*
* If @profile does not have an explicit profile ID set, a new profile will
* be created.
*
* When the operation is finished, @callback will be invoked in the
* <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
* of the thread you are calling this method from. You can then call
* mm_modem_3gpp_profile_manager_set_finish() to get the result of the
* operation.
*
* See mm_modem_3gpp_profile_manager_set_sync() for the synchronous, blocking
* version of this method.
*
* Since: 1.18
*/
void
mm_modem_3gpp_profile_manager_set (MMModem3gppProfileManager *self,
MM3gppProfile *requested,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_autoptr(GVariant) requested_dictionary = NULL;
g_return_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self));
requested_dictionary = mm_3gpp_profile_get_dictionary (requested);
mm_gdbus_modem3gpp_profile_manager_call_set (MM_GDBUS_MODEM3GPP_PROFILE_MANAGER (self),
requested_dictionary,
cancellable,
callback,
user_data);
}
/**
* mm_modem_3gpp_profile_manager_set_sync:
* @self: A #MMModem3gppProfileManager.
* @requested: A #MM3gppProfile with the requested settings.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @error: Return location for error or %NULL.
*
* Synchronously updates a connection profile with the settings
* given in @profile.
*
* If @profile does not have an explicit profile ID set, a new profile will
* be created.
*
* The calling thread is blocked until a reply is received. See
* mm_modem_3gpp_profile_manager_set() for the asynchronous version of this
* method.
*
* Returns: (transfer full): A #MM3gppProfile with the stored settings, or %NULL if @error is set.
*
* Since: 1.18
*/
MM3gppProfile *
mm_modem_3gpp_profile_manager_set_sync (MMModem3gppProfileManager *self,
MM3gppProfile *requested,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GVariant) requested_dictionary = NULL;
g_autoptr(GVariant) stored_dictionary = NULL;
g_return_val_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self), NULL);
requested_dictionary = mm_3gpp_profile_get_dictionary (requested);
if (!mm_gdbus_modem3gpp_profile_manager_call_set_sync (MM_GDBUS_MODEM3GPP_PROFILE_MANAGER (self),
requested_dictionary,
&stored_dictionary,
cancellable,
error))
return NULL;
return mm_3gpp_profile_new_from_dictionary (stored_dictionary, error);
}
/*****************************************************************************/
/**
* mm_modem_3gpp_profile_manager_delete_finish:
* @self: A #MMModem3gppProfileManager.
* @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to
* mm_modem_3gpp_profile_manager_delete().
* @error: Return location for error or %NULL.
*
* Finishes an operation started with mm_modem_3gpp_profile_manager_delete().
*
* Returns: %TRUE if the operation was successful, %FALSE if @error is set.
*
* Since: 1.18
*/
gboolean
mm_modem_3gpp_profile_manager_delete_finish (MMModem3gppProfileManager *self,
GAsyncResult *res,
GError **error)
{
g_return_val_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self), FALSE);
return mm_gdbus_modem3gpp_profile_manager_call_delete_finish (MM_GDBUS_MODEM3GPP_PROFILE_MANAGER (self), res, error);
}
/**
* mm_modem_3gpp_profile_manager_delete:
* @self: A #MMModem3gppProfileManager.
* @profile: A #MM3gppProfile.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or
* %NULL.
* @user_data: User data to pass to @callback.
*
* Asynchronously deletes the connection profile.
*
* The @profile should have at least the profile ID set for the delete operation
* to succeed.
*
* When the operation is finished, @callback will be invoked in the
* <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
* of the thread you are calling this method from. You can then call
* mm_modem_3gpp_profile_manager_delete_finish() to get the result of the
* operation.
*
* See mm_modem_3gpp_profile_manager_delete_sync() for the synchronous, blocking
* version of this method.
*
* Since: 1.18
*/
void
mm_modem_3gpp_profile_manager_delete (MMModem3gppProfileManager *self,
MM3gppProfile *profile,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_autoptr(GVariant) profile_dictionary = NULL;
g_return_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self));
profile_dictionary = mm_3gpp_profile_get_dictionary (profile);
mm_gdbus_modem3gpp_profile_manager_call_delete (MM_GDBUS_MODEM3GPP_PROFILE_MANAGER (self),
profile_dictionary,
cancellable,
callback,
user_data);
}
/**
* mm_modem_3gpp_profile_manager_delete_sync:
* @self: A #MMModem3gppProfileManager.
* @profile: A #MM3gppProfile.
* @cancellable: (allow-none): A #GCancellable or %NULL.
* @error: Return location for error or %NULL.
*
* Synchronously deletes the connection profile.
*
* The @profile should have at least the profile ID set for the delete operation
* to succeed.
*
* The calling thread is blocked until a reply is received. See
* mm_modem_3gpp_profile_manager_delete() for the asynchronous version of this
* method.
*
* Returns: %TRUE if the operation was successful, %FALSE if @error is set.
*
* Since: 1.18
*/
gboolean
mm_modem_3gpp_profile_manager_delete_sync (MMModem3gppProfileManager *self,
MM3gppProfile *profile,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GVariant) profile_dictionary = NULL;
g_return_val_if_fail (MM_IS_MODEM_3GPP_PROFILE_MANAGER (self), FALSE);
profile_dictionary = mm_3gpp_profile_get_dictionary (profile);
return mm_gdbus_modem3gpp_profile_manager_call_delete_sync (MM_GDBUS_MODEM3GPP_PROFILE_MANAGER (self),
profile_dictionary,
cancellable,
error);
}
/*****************************************************************************/
static void
mm_modem_3gpp_profile_manager_init (MMModem3gppProfileManager *self)
{
}
static void
mm_modem_3gpp_profile_manager_class_init (MMModem3gppProfileManagerClass *modem_class)
{
}

View File

@@ -0,0 +1,112 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* libmm -- Access modem status & information from glib applications
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* Copyright (C) 2021 Aleksander Morgado <aleksander@aleksander.es>
* Copyright (C) 2021 Google, Inc.
*/
#ifndef _MM_MODEM_3GPP_PROFILE_MANAGER_H_
#define _MM_MODEM_3GPP_PROFILE_MANAGER_H_
#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
#error "Only <libmm-glib.h> can be included directly."
#endif
#include <ModemManager.h>
#include "mm-3gpp-profile.h"
#include "mm-gdbus-modem.h"
G_BEGIN_DECLS
#define MM_TYPE_MODEM_3GPP_PROFILE_MANAGER (mm_modem_3gpp_profile_manager_get_type ())
#define MM_MODEM_3GPP_PROFILE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_MODEM_3GPP_PROFILE_MANAGER, MMModem3gppProfileManager))
#define MM_MODEM_3GPP_PROFILE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_MODEM_3GPP_PROFILE_MANAGER, MMModem3gppProfileManagerClass))
#define MM_IS_MODEM_3GPP_PROFILE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_MODEM_3GPP_PROFILE_MANAGER))
#define MM_IS_MODEM_3GPP_PROFILE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), MM_TYPE_MODEM_3GPP_PROFILE_MANAGER))
#define MM_MODEM_3GPP_PROFILE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_MODEM_3GPP_PROFILE_MANAGER, MMModem3gppProfileManagerClass))
typedef struct _MMModem3gppProfileManager MMModem3gppProfileManager;
typedef struct _MMModem3gppProfileManagerClass MMModem3gppProfileManagerClass;
/**
* MMModem3gppProfileManager:
*
* The #MMModem3gppProfileManager structure contains private data and should only be accessed
* using the provided API.
*/
struct _MMModem3gppProfileManager {
/*< private >*/
MmGdbusModem3gppProfileManagerProxy parent;
gpointer unused;
};
struct _MMModem3gppProfileManagerClass {
/*< private >*/
MmGdbusModem3gppProfileManagerProxyClass parent;
};
GType mm_modem_3gpp_profile_manager_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModem3gppProfileManager, g_object_unref)
const gchar *mm_modem_3gpp_profile_manager_get_path (MMModem3gppProfileManager *self);
gchar *mm_modem_3gpp_profile_manager_dup_path (MMModem3gppProfileManager *self);
void mm_modem_3gpp_profile_manager_list (MMModem3gppProfileManager *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean mm_modem_3gpp_profile_manager_list_finish (MMModem3gppProfileManager *self,
GAsyncResult *res,
GList **profiles,
GError **error);
gboolean mm_modem_3gpp_profile_manager_list_sync (MMModem3gppProfileManager *self,
GCancellable *cancellable,
GList **profiles,
GError **error);
void mm_modem_3gpp_profile_manager_set (MMModem3gppProfileManager *self,
MM3gppProfile *requested,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
MM3gppProfile *mm_modem_3gpp_profile_manager_set_finish (MMModem3gppProfileManager *self,
GAsyncResult *res,
GError **error);
MM3gppProfile *mm_modem_3gpp_profile_manager_set_sync (MMModem3gppProfileManager *self,
MM3gppProfile *requested,
GCancellable *cancellable,
GError **error);
void mm_modem_3gpp_profile_manager_delete (MMModem3gppProfileManager *self,
MM3gppProfile *profile,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean mm_modem_3gpp_profile_manager_delete_finish (MMModem3gppProfileManager *self,
GAsyncResult *res,
GError **error);
gboolean mm_modem_3gpp_profile_manager_delete_sync (MMModem3gppProfileManager *self,
MM3gppProfile *profile,
GCancellable *cancellable,
GError **error);
G_END_DECLS
#endif /* _MM_MODEM_3GPP_PROFILE_MANAGER_H_ */

View File

@@ -183,6 +183,52 @@ mm_object_peek_modem_3gpp (MMObject *self)
/*****************************************************************************/
/**
* mm_object_get_modem_3gpp_profile_manager:
* @self: A #MMObject.
*
* Gets the #MMModem3gppProfileManager instance for the D-Bus interface
* org.freedesktop.ModemManager1.Modem.Modem3gpp-ProfileManager on @self, if any.
*
* Returns: (transfer full): A #MMModem3gppProfileManager that must be freed with
* g_object_unref() or %NULL if @self does not implement the interface.
*
* Since: 1.18
*/
MMModem3gppProfileManager *
mm_object_get_modem_3gpp_profile_manager (MMObject *self)
{
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
return (MMModem3gppProfileManager *)mm_gdbus_object_get_modem3gpp_profile_manager (MM_GDBUS_OBJECT (self));
}
/**
* mm_object_peek_modem_3gpp_profile_manager: (skip)
* @self: A #MMObject.
*
* Like mm_object_get_modem_3gpp_profile_manager() but doesn't increase the reference count
* on the returned object.
*
* <warning>It is not safe to use the returned object if you are on another
* thread than the one where the #MMManager is running.</warning>
*
* Returns: (transfer none): A #MMModem3gppProfileManager or %NULL if @self does not
* implement the interface. Do not free the returned object, it is owned by
* @self.
*
* Since: 1.18
*/
MMModem3gppProfileManager *
mm_object_peek_modem_3gpp_profile_manager (MMObject *self)
{
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
return (MMModem3gppProfileManager *)mm_gdbus_object_peek_modem3gpp_profile_manager (MM_GDBUS_OBJECT (self));
}
/*****************************************************************************/
/**
* mm_object_get_modem_3gpp_ussd:
* @self: A #MMObject.

View File

@@ -33,6 +33,7 @@
#include "mm-gdbus-modem.h"
#include "mm-modem.h"
#include "mm-modem-3gpp.h"
#include "mm-modem-3gpp-profile-manager.h"
#include "mm-modem-3gpp-ussd.h"
#include "mm-modem-cdma.h"
#include "mm-modem-simple.h"
@@ -79,31 +80,33 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMObject, g_object_unref)
const gchar *mm_object_get_path (MMObject *self);
gchar *mm_object_dup_path (MMObject *self);
MMModem *mm_object_get_modem (MMObject *self);
MMModem3gpp *mm_object_get_modem_3gpp (MMObject *self);
MMModem3gppUssd *mm_object_get_modem_3gpp_ussd (MMObject *self);
MMModemCdma *mm_object_get_modem_cdma (MMObject *self);
MMModemSimple *mm_object_get_modem_simple (MMObject *self);
MMModemLocation *mm_object_get_modem_location (MMObject *self);
MMModemMessaging *mm_object_get_modem_messaging (MMObject *self);
MMModemVoice *mm_object_get_modem_voice (MMObject *self);
MMModemTime *mm_object_get_modem_time (MMObject *self);
MMModemFirmware *mm_object_get_modem_firmware (MMObject *self);
MMModemSignal *mm_object_get_modem_signal (MMObject *self);
MMModemOma *mm_object_get_modem_oma (MMObject *self);
MMModem *mm_object_get_modem (MMObject *self);
MMModem3gpp *mm_object_get_modem_3gpp (MMObject *self);
MMModem3gppProfileManager *mm_object_get_modem_3gpp_profile_manager (MMObject *self);
MMModem3gppUssd *mm_object_get_modem_3gpp_ussd (MMObject *self);
MMModemCdma *mm_object_get_modem_cdma (MMObject *self);
MMModemSimple *mm_object_get_modem_simple (MMObject *self);
MMModemLocation *mm_object_get_modem_location (MMObject *self);
MMModemMessaging *mm_object_get_modem_messaging (MMObject *self);
MMModemVoice *mm_object_get_modem_voice (MMObject *self);
MMModemTime *mm_object_get_modem_time (MMObject *self);
MMModemFirmware *mm_object_get_modem_firmware (MMObject *self);
MMModemSignal *mm_object_get_modem_signal (MMObject *self);
MMModemOma *mm_object_get_modem_oma (MMObject *self);
MMModem *mm_object_peek_modem (MMObject *self);
MMModem3gpp *mm_object_peek_modem_3gpp (MMObject *self);
MMModem3gppUssd *mm_object_peek_modem_3gpp_ussd (MMObject *self);
MMModemCdma *mm_object_peek_modem_cdma (MMObject *self);
MMModemSimple *mm_object_peek_modem_simple (MMObject *self);
MMModemLocation *mm_object_peek_modem_location (MMObject *self);
MMModemMessaging *mm_object_peek_modem_messaging (MMObject *self);
MMModemVoice *mm_object_peek_modem_voice (MMObject *self);
MMModemTime *mm_object_peek_modem_time (MMObject *self);
MMModemFirmware *mm_object_peek_modem_firmware (MMObject *self);
MMModemSignal *mm_object_peek_modem_signal (MMObject *self);
MMModemOma *mm_object_peek_modem_oma (MMObject *self);
MMModem *mm_object_peek_modem (MMObject *self);
MMModem3gpp *mm_object_peek_modem_3gpp (MMObject *self);
MMModem3gppProfileManager *mm_object_peek_modem_3gpp_profile_manager (MMObject *self);
MMModem3gppUssd *mm_object_peek_modem_3gpp_ussd (MMObject *self);
MMModemCdma *mm_object_peek_modem_cdma (MMObject *self);
MMModemSimple *mm_object_peek_modem_simple (MMObject *self);
MMModemLocation *mm_object_peek_modem_location (MMObject *self);
MMModemMessaging *mm_object_peek_modem_messaging (MMObject *self);
MMModemVoice *mm_object_peek_modem_voice (MMObject *self);
MMModemTime *mm_object_peek_modem_time (MMObject *self);
MMModemFirmware *mm_object_peek_modem_firmware (MMObject *self);
MMModemSignal *mm_object_peek_modem_signal (MMObject *self);
MMModemOma *mm_object_peek_modem_oma (MMObject *self);
G_END_DECLS