iface-modem-3gpp-profile-manager: new interface for profile management
This interface will provide support for the profile management operations in different modem types. This initial commit introduces support for the interface and provides handlers for the methods that may be called in the interface.
This commit is contained in:
@@ -184,6 +184,21 @@
|
|||||||
send_interface="org.freedesktop.ModemManager1.Bearer"
|
send_interface="org.freedesktop.ModemManager1.Bearer"
|
||||||
send_member="Disconnect"/>
|
send_member="Disconnect"/>
|
||||||
|
|
||||||
|
<!-- org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager.xml -->
|
||||||
|
|
||||||
|
<!-- Protected by the Device.Control policy rule -->
|
||||||
|
<allow send_destination="org.freedesktop.ModemManager1"
|
||||||
|
send_interface="org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager"
|
||||||
|
send_member="List"/>
|
||||||
|
|
||||||
|
<allow send_destination="org.freedesktop.ModemManager1"
|
||||||
|
send_interface="org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager"
|
||||||
|
send_member="Set"/>
|
||||||
|
|
||||||
|
<allow send_destination="org.freedesktop.ModemManager1"
|
||||||
|
send_interface="org.freedesktop.ModemManager1.Modem.Modem3gpp.ProfileManager"
|
||||||
|
send_member="Delete"/>
|
||||||
|
|
||||||
<!-- org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml -->
|
<!-- org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml -->
|
||||||
|
|
||||||
<!-- Protected by the USSD policy rule -->
|
<!-- Protected by the USSD policy rule -->
|
||||||
|
@@ -346,6 +346,8 @@ ModemManager_SOURCES = \
|
|||||||
mm-iface-modem.c \
|
mm-iface-modem.c \
|
||||||
mm-iface-modem-3gpp.h \
|
mm-iface-modem-3gpp.h \
|
||||||
mm-iface-modem-3gpp.c \
|
mm-iface-modem-3gpp.c \
|
||||||
|
mm-iface-modem-3gpp-profile-manager.h \
|
||||||
|
mm-iface-modem-3gpp-profile-manager.c \
|
||||||
mm-iface-modem-3gpp-ussd.h \
|
mm-iface-modem-3gpp-ussd.h \
|
||||||
mm-iface-modem-3gpp-ussd.c \
|
mm-iface-modem-3gpp-ussd.c \
|
||||||
mm-iface-modem-cdma.h \
|
mm-iface-modem-cdma.h \
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "mm-broadband-modem.h"
|
#include "mm-broadband-modem.h"
|
||||||
#include "mm-iface-modem.h"
|
#include "mm-iface-modem.h"
|
||||||
#include "mm-iface-modem-3gpp.h"
|
#include "mm-iface-modem-3gpp.h"
|
||||||
|
#include "mm-iface-modem-3gpp-profile-manager.h"
|
||||||
#include "mm-iface-modem-3gpp-ussd.h"
|
#include "mm-iface-modem-3gpp-ussd.h"
|
||||||
#include "mm-iface-modem-cdma.h"
|
#include "mm-iface-modem-cdma.h"
|
||||||
#include "mm-iface-modem-simple.h"
|
#include "mm-iface-modem-simple.h"
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
|
|
||||||
static void iface_modem_init (MMIfaceModem *iface);
|
static void iface_modem_init (MMIfaceModem *iface);
|
||||||
static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface);
|
static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface);
|
||||||
|
static void iface_modem_3gpp_profile_manager_init (MMIfaceModem3gppProfileManager *iface);
|
||||||
static void iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssd *iface);
|
static void iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssd *iface);
|
||||||
static void iface_modem_cdma_init (MMIfaceModemCdma *iface);
|
static void iface_modem_cdma_init (MMIfaceModemCdma *iface);
|
||||||
static void iface_modem_simple_init (MMIfaceModemSimple *iface);
|
static void iface_modem_simple_init (MMIfaceModemSimple *iface);
|
||||||
@@ -74,6 +76,7 @@ static void iface_modem_firmware_init (MMIfaceModemFirmware *iface);
|
|||||||
G_DEFINE_TYPE_EXTENDED (MMBroadbandModem, mm_broadband_modem, MM_TYPE_BASE_MODEM, 0,
|
G_DEFINE_TYPE_EXTENDED (MMBroadbandModem, mm_broadband_modem, MM_TYPE_BASE_MODEM, 0,
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init)
|
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init)
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP, iface_modem_3gpp_init)
|
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP, iface_modem_3gpp_init)
|
||||||
|
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP_PROFILE_MANAGER, iface_modem_3gpp_profile_manager_init)
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP_USSD, iface_modem_3gpp_ussd_init)
|
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP_USSD, iface_modem_3gpp_ussd_init)
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_CDMA, iface_modem_cdma_init)
|
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_CDMA, iface_modem_cdma_init)
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_SIMPLE, iface_modem_simple_init)
|
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_SIMPLE, iface_modem_simple_init)
|
||||||
@@ -89,6 +92,7 @@ enum {
|
|||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_MODEM_DBUS_SKELETON,
|
PROP_MODEM_DBUS_SKELETON,
|
||||||
PROP_MODEM_3GPP_DBUS_SKELETON,
|
PROP_MODEM_3GPP_DBUS_SKELETON,
|
||||||
|
PROP_MODEM_3GPP_PROFILE_MANAGER_DBUS_SKELETON,
|
||||||
PROP_MODEM_3GPP_USSD_DBUS_SKELETON,
|
PROP_MODEM_3GPP_USSD_DBUS_SKELETON,
|
||||||
PROP_MODEM_CDMA_DBUS_SKELETON,
|
PROP_MODEM_CDMA_DBUS_SKELETON,
|
||||||
PROP_MODEM_SIMPLE_DBUS_SKELETON,
|
PROP_MODEM_SIMPLE_DBUS_SKELETON,
|
||||||
@@ -189,6 +193,10 @@ struct _MMBroadbandModemPrivate {
|
|||||||
MMModem3gppFacility modem_3gpp_ignored_facility_locks;
|
MMModem3gppFacility modem_3gpp_ignored_facility_locks;
|
||||||
MMBaseBearer *modem_3gpp_initial_eps_bearer;
|
MMBaseBearer *modem_3gpp_initial_eps_bearer;
|
||||||
|
|
||||||
|
/*<--- Modem 3GPP Profile Manager interface --->*/
|
||||||
|
/* Properties */
|
||||||
|
GObject *modem_3gpp_profile_manager_dbus_skeleton;
|
||||||
|
|
||||||
/*<--- Modem 3GPP USSD interface --->*/
|
/*<--- Modem 3GPP USSD interface --->*/
|
||||||
/* Properties */
|
/* Properties */
|
||||||
GObject *modem_3gpp_ussd_dbus_skeleton;
|
GObject *modem_3gpp_ussd_dbus_skeleton;
|
||||||
@@ -10510,6 +10518,7 @@ typedef enum {
|
|||||||
DISABLING_STEP_IFACE_LOCATION,
|
DISABLING_STEP_IFACE_LOCATION,
|
||||||
DISABLING_STEP_IFACE_CDMA,
|
DISABLING_STEP_IFACE_CDMA,
|
||||||
DISABLING_STEP_IFACE_3GPP_USSD,
|
DISABLING_STEP_IFACE_3GPP_USSD,
|
||||||
|
DISABLING_STEP_IFACE_3GPP_PROFILE_MANAGER,
|
||||||
DISABLING_STEP_IFACE_3GPP,
|
DISABLING_STEP_IFACE_3GPP,
|
||||||
DISABLING_STEP_IFACE_MODEM,
|
DISABLING_STEP_IFACE_MODEM,
|
||||||
DISABLING_STEP_LAST,
|
DISABLING_STEP_LAST,
|
||||||
@@ -10585,16 +10594,17 @@ common_disable_finish (MMBroadbandModem *self,
|
|||||||
disabling_step (task); \
|
disabling_step (task); \
|
||||||
}
|
}
|
||||||
|
|
||||||
INTERFACE_DISABLE_READY_FN (iface_modem, MM_IFACE_MODEM, TRUE)
|
INTERFACE_DISABLE_READY_FN (iface_modem, MM_IFACE_MODEM, TRUE)
|
||||||
INTERFACE_DISABLE_READY_FN (iface_modem_3gpp, MM_IFACE_MODEM_3GPP, TRUE)
|
INTERFACE_DISABLE_READY_FN (iface_modem_3gpp, MM_IFACE_MODEM_3GPP, TRUE)
|
||||||
INTERFACE_DISABLE_READY_FN (iface_modem_3gpp_ussd, MM_IFACE_MODEM_3GPP_USSD, FALSE)
|
INTERFACE_DISABLE_READY_FN (iface_modem_3gpp_ussd, MM_IFACE_MODEM_3GPP_USSD, FALSE)
|
||||||
INTERFACE_DISABLE_READY_FN (iface_modem_cdma, MM_IFACE_MODEM_CDMA, TRUE)
|
INTERFACE_DISABLE_READY_FN (iface_modem_3gpp_profile_manager, MM_IFACE_MODEM_3GPP_PROFILE_MANAGER, FALSE)
|
||||||
INTERFACE_DISABLE_READY_FN (iface_modem_location, MM_IFACE_MODEM_LOCATION, FALSE)
|
INTERFACE_DISABLE_READY_FN (iface_modem_cdma, MM_IFACE_MODEM_CDMA, TRUE)
|
||||||
INTERFACE_DISABLE_READY_FN (iface_modem_messaging, MM_IFACE_MODEM_MESSAGING, FALSE)
|
INTERFACE_DISABLE_READY_FN (iface_modem_location, MM_IFACE_MODEM_LOCATION, FALSE)
|
||||||
INTERFACE_DISABLE_READY_FN (iface_modem_voice, MM_IFACE_MODEM_VOICE, FALSE)
|
INTERFACE_DISABLE_READY_FN (iface_modem_messaging, MM_IFACE_MODEM_MESSAGING, FALSE)
|
||||||
INTERFACE_DISABLE_READY_FN (iface_modem_signal, MM_IFACE_MODEM_SIGNAL, FALSE)
|
INTERFACE_DISABLE_READY_FN (iface_modem_voice, MM_IFACE_MODEM_VOICE, FALSE)
|
||||||
INTERFACE_DISABLE_READY_FN (iface_modem_time, MM_IFACE_MODEM_TIME, FALSE)
|
INTERFACE_DISABLE_READY_FN (iface_modem_signal, MM_IFACE_MODEM_SIGNAL, FALSE)
|
||||||
INTERFACE_DISABLE_READY_FN (iface_modem_oma, MM_IFACE_MODEM_OMA, FALSE)
|
INTERFACE_DISABLE_READY_FN (iface_modem_time, MM_IFACE_MODEM_TIME, FALSE)
|
||||||
|
INTERFACE_DISABLE_READY_FN (iface_modem_oma, MM_IFACE_MODEM_OMA, FALSE)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
bearer_list_disconnect_all_bearers_ready (MMBearerList *list,
|
bearer_list_disconnect_all_bearers_ready (MMBearerList *list,
|
||||||
@@ -10813,6 +10823,17 @@ disabling_step (GTask *task)
|
|||||||
ctx->step++;
|
ctx->step++;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
|
case DISABLING_STEP_IFACE_3GPP_PROFILE_MANAGER:
|
||||||
|
if (ctx->self->priv->modem_3gpp_profile_manager_dbus_skeleton) {
|
||||||
|
mm_obj_dbg (ctx->self, "modem has 3GPP profile management capabilities, disabling the Modem 3GPP Profile Manager interface...");
|
||||||
|
mm_iface_modem_3gpp_profile_manager_disable (MM_IFACE_MODEM_3GPP_PROFILE_MANAGER (ctx->self),
|
||||||
|
(GAsyncReadyCallback)iface_modem_3gpp_profile_manager_disable_ready,
|
||||||
|
task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctx->step++;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
case DISABLING_STEP_IFACE_3GPP:
|
case DISABLING_STEP_IFACE_3GPP:
|
||||||
if (ctx->self->priv->modem_3gpp_dbus_skeleton) {
|
if (ctx->self->priv->modem_3gpp_dbus_skeleton) {
|
||||||
mm_obj_dbg (ctx->self, "modem has 3GPP capabilities, disabling the Modem 3GPP interface...");
|
mm_obj_dbg (ctx->self, "modem has 3GPP capabilities, disabling the Modem 3GPP interface...");
|
||||||
@@ -10930,6 +10951,7 @@ typedef enum {
|
|||||||
ENABLING_STEP_STARTED,
|
ENABLING_STEP_STARTED,
|
||||||
ENABLING_STEP_IFACE_MODEM,
|
ENABLING_STEP_IFACE_MODEM,
|
||||||
ENABLING_STEP_IFACE_3GPP,
|
ENABLING_STEP_IFACE_3GPP,
|
||||||
|
ENABLING_STEP_IFACE_3GPP_PROFILE_MANAGER,
|
||||||
ENABLING_STEP_IFACE_3GPP_USSD,
|
ENABLING_STEP_IFACE_3GPP_USSD,
|
||||||
ENABLING_STEP_IFACE_CDMA,
|
ENABLING_STEP_IFACE_CDMA,
|
||||||
ENABLING_STEP_IFACE_LOCATION,
|
ENABLING_STEP_IFACE_LOCATION,
|
||||||
@@ -11028,16 +11050,17 @@ enable_failed_ready (MMBroadbandModem *self,
|
|||||||
enabling_step (task); \
|
enabling_step (task); \
|
||||||
}
|
}
|
||||||
|
|
||||||
INTERFACE_ENABLE_READY_FN (iface_modem, MM_IFACE_MODEM, TRUE)
|
INTERFACE_ENABLE_READY_FN (iface_modem, MM_IFACE_MODEM, TRUE)
|
||||||
INTERFACE_ENABLE_READY_FN (iface_modem_3gpp, MM_IFACE_MODEM_3GPP, TRUE)
|
INTERFACE_ENABLE_READY_FN (iface_modem_3gpp, MM_IFACE_MODEM_3GPP, TRUE)
|
||||||
INTERFACE_ENABLE_READY_FN (iface_modem_3gpp_ussd, MM_IFACE_MODEM_3GPP_USSD, FALSE)
|
INTERFACE_ENABLE_READY_FN (iface_modem_3gpp_profile_manager, MM_IFACE_MODEM_3GPP_PROFILE_MANAGER, FALSE)
|
||||||
INTERFACE_ENABLE_READY_FN (iface_modem_cdma, MM_IFACE_MODEM_CDMA, TRUE)
|
INTERFACE_ENABLE_READY_FN (iface_modem_3gpp_ussd, MM_IFACE_MODEM_3GPP_USSD, FALSE)
|
||||||
INTERFACE_ENABLE_READY_FN (iface_modem_location, MM_IFACE_MODEM_LOCATION, FALSE)
|
INTERFACE_ENABLE_READY_FN (iface_modem_cdma, MM_IFACE_MODEM_CDMA, TRUE)
|
||||||
INTERFACE_ENABLE_READY_FN (iface_modem_messaging, MM_IFACE_MODEM_MESSAGING, FALSE)
|
INTERFACE_ENABLE_READY_FN (iface_modem_location, MM_IFACE_MODEM_LOCATION, FALSE)
|
||||||
INTERFACE_ENABLE_READY_FN (iface_modem_voice, MM_IFACE_MODEM_VOICE, FALSE)
|
INTERFACE_ENABLE_READY_FN (iface_modem_messaging, MM_IFACE_MODEM_MESSAGING, FALSE)
|
||||||
INTERFACE_ENABLE_READY_FN (iface_modem_signal, MM_IFACE_MODEM_SIGNAL, FALSE)
|
INTERFACE_ENABLE_READY_FN (iface_modem_voice, MM_IFACE_MODEM_VOICE, FALSE)
|
||||||
INTERFACE_ENABLE_READY_FN (iface_modem_time, MM_IFACE_MODEM_TIME, FALSE)
|
INTERFACE_ENABLE_READY_FN (iface_modem_signal, MM_IFACE_MODEM_SIGNAL, FALSE)
|
||||||
INTERFACE_ENABLE_READY_FN (iface_modem_oma, MM_IFACE_MODEM_OMA, FALSE)
|
INTERFACE_ENABLE_READY_FN (iface_modem_time, MM_IFACE_MODEM_TIME, FALSE)
|
||||||
|
INTERFACE_ENABLE_READY_FN (iface_modem_oma, MM_IFACE_MODEM_OMA, FALSE)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
enabling_started_ready (MMBroadbandModem *self,
|
enabling_started_ready (MMBroadbandModem *self,
|
||||||
@@ -11154,6 +11177,17 @@ enabling_step (GTask *task)
|
|||||||
ctx->step++;
|
ctx->step++;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
|
case ENABLING_STEP_IFACE_3GPP_PROFILE_MANAGER:
|
||||||
|
if (ctx->self->priv->modem_3gpp_profile_manager_dbus_skeleton) {
|
||||||
|
mm_obj_dbg (ctx->self, "modem has 3GPP profile management capabilities, enabling the Modem 3GPP Profile Manager interface...");
|
||||||
|
mm_iface_modem_3gpp_profile_manager_enable (MM_IFACE_MODEM_3GPP_PROFILE_MANAGER (ctx->self),
|
||||||
|
(GAsyncReadyCallback)iface_modem_3gpp_profile_manager_enable_ready,
|
||||||
|
task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctx->step++;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
case ENABLING_STEP_IFACE_3GPP_USSD:
|
case ENABLING_STEP_IFACE_3GPP_USSD:
|
||||||
if (ctx->self->priv->modem_3gpp_ussd_dbus_skeleton) {
|
if (ctx->self->priv->modem_3gpp_ussd_dbus_skeleton) {
|
||||||
mm_obj_dbg (ctx->self, "modem has 3GPP/USSD capabilities, enabling the Modem 3GPP/USSD interface...");
|
mm_obj_dbg (ctx->self, "modem has 3GPP/USSD capabilities, enabling the Modem 3GPP/USSD interface...");
|
||||||
@@ -11364,6 +11398,7 @@ typedef enum {
|
|||||||
INITIALIZE_STEP_SETUP_SIMPLE_STATUS,
|
INITIALIZE_STEP_SETUP_SIMPLE_STATUS,
|
||||||
INITIALIZE_STEP_IFACE_MODEM,
|
INITIALIZE_STEP_IFACE_MODEM,
|
||||||
INITIALIZE_STEP_IFACE_3GPP,
|
INITIALIZE_STEP_IFACE_3GPP,
|
||||||
|
INITIALIZE_STEP_IFACE_3GPP_PROFILE_MANAGER,
|
||||||
INITIALIZE_STEP_IFACE_3GPP_USSD,
|
INITIALIZE_STEP_IFACE_3GPP_USSD,
|
||||||
INITIALIZE_STEP_IFACE_CDMA,
|
INITIALIZE_STEP_IFACE_CDMA,
|
||||||
INITIALIZE_STEP_IFACE_LOCATION,
|
INITIALIZE_STEP_IFACE_LOCATION,
|
||||||
@@ -11549,16 +11584,17 @@ iface_modem_initialize_ready (MMBroadbandModem *self,
|
|||||||
initialize_step (task); \
|
initialize_step (task); \
|
||||||
}
|
}
|
||||||
|
|
||||||
INTERFACE_INIT_READY_FN (iface_modem_3gpp, MM_IFACE_MODEM_3GPP, TRUE)
|
INTERFACE_INIT_READY_FN (iface_modem_3gpp, MM_IFACE_MODEM_3GPP, TRUE)
|
||||||
INTERFACE_INIT_READY_FN (iface_modem_3gpp_ussd, MM_IFACE_MODEM_3GPP_USSD, FALSE)
|
INTERFACE_INIT_READY_FN (iface_modem_3gpp_profile_manager, MM_IFACE_MODEM_3GPP_PROFILE_MANAGER, FALSE)
|
||||||
INTERFACE_INIT_READY_FN (iface_modem_cdma, MM_IFACE_MODEM_CDMA, TRUE)
|
INTERFACE_INIT_READY_FN (iface_modem_3gpp_ussd, MM_IFACE_MODEM_3GPP_USSD, FALSE)
|
||||||
INTERFACE_INIT_READY_FN (iface_modem_location, MM_IFACE_MODEM_LOCATION, FALSE)
|
INTERFACE_INIT_READY_FN (iface_modem_cdma, MM_IFACE_MODEM_CDMA, TRUE)
|
||||||
INTERFACE_INIT_READY_FN (iface_modem_messaging, MM_IFACE_MODEM_MESSAGING, FALSE)
|
INTERFACE_INIT_READY_FN (iface_modem_location, MM_IFACE_MODEM_LOCATION, FALSE)
|
||||||
INTERFACE_INIT_READY_FN (iface_modem_voice, MM_IFACE_MODEM_VOICE, FALSE)
|
INTERFACE_INIT_READY_FN (iface_modem_messaging, MM_IFACE_MODEM_MESSAGING, FALSE)
|
||||||
INTERFACE_INIT_READY_FN (iface_modem_time, MM_IFACE_MODEM_TIME, FALSE)
|
INTERFACE_INIT_READY_FN (iface_modem_voice, MM_IFACE_MODEM_VOICE, FALSE)
|
||||||
INTERFACE_INIT_READY_FN (iface_modem_signal, MM_IFACE_MODEM_SIGNAL, FALSE)
|
INTERFACE_INIT_READY_FN (iface_modem_time, MM_IFACE_MODEM_TIME, FALSE)
|
||||||
INTERFACE_INIT_READY_FN (iface_modem_oma, MM_IFACE_MODEM_OMA, FALSE)
|
INTERFACE_INIT_READY_FN (iface_modem_signal, MM_IFACE_MODEM_SIGNAL, FALSE)
|
||||||
INTERFACE_INIT_READY_FN (iface_modem_firmware, MM_IFACE_MODEM_FIRMWARE, FALSE)
|
INTERFACE_INIT_READY_FN (iface_modem_oma, MM_IFACE_MODEM_OMA, FALSE)
|
||||||
|
INTERFACE_INIT_READY_FN (iface_modem_firmware, MM_IFACE_MODEM_FIRMWARE, FALSE)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
initialize_step (GTask *task)
|
initialize_step (GTask *task)
|
||||||
@@ -11625,6 +11661,17 @@ initialize_step (GTask *task)
|
|||||||
ctx->step++;
|
ctx->step++;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
|
case INITIALIZE_STEP_IFACE_3GPP_PROFILE_MANAGER:
|
||||||
|
if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (ctx->self))) {
|
||||||
|
/* Initialize the 3GPP Profile Manager interface */
|
||||||
|
mm_iface_modem_3gpp_profile_manager_initialize (MM_IFACE_MODEM_3GPP_PROFILE_MANAGER (ctx->self),
|
||||||
|
(GAsyncReadyCallback)iface_modem_3gpp_profile_manager_initialize_ready,
|
||||||
|
task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctx->step++;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
case INITIALIZE_STEP_IFACE_3GPP_USSD:
|
case INITIALIZE_STEP_IFACE_3GPP_USSD:
|
||||||
if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (ctx->self))) {
|
if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (ctx->self))) {
|
||||||
/* Initialize the 3GPP/USSD interface */
|
/* Initialize the 3GPP/USSD interface */
|
||||||
@@ -11809,6 +11856,7 @@ sim_hot_swap_enabled:
|
|||||||
* emergency voice calls.
|
* emergency voice calls.
|
||||||
*/
|
*/
|
||||||
mm_iface_modem_3gpp_shutdown (MM_IFACE_MODEM_3GPP (ctx->self));
|
mm_iface_modem_3gpp_shutdown (MM_IFACE_MODEM_3GPP (ctx->self));
|
||||||
|
mm_iface_modem_3gpp_profile_manager_shutdown (MM_IFACE_MODEM_3GPP_PROFILE_MANAGER (ctx->self));
|
||||||
mm_iface_modem_3gpp_ussd_shutdown (MM_IFACE_MODEM_3GPP_USSD (ctx->self));
|
mm_iface_modem_3gpp_ussd_shutdown (MM_IFACE_MODEM_3GPP_USSD (ctx->self));
|
||||||
mm_iface_modem_cdma_shutdown (MM_IFACE_MODEM_CDMA (ctx->self));
|
mm_iface_modem_cdma_shutdown (MM_IFACE_MODEM_CDMA (ctx->self));
|
||||||
mm_iface_modem_location_shutdown (MM_IFACE_MODEM_LOCATION (ctx->self));
|
mm_iface_modem_location_shutdown (MM_IFACE_MODEM_LOCATION (ctx->self));
|
||||||
@@ -12002,6 +12050,10 @@ set_property (GObject *object,
|
|||||||
g_clear_object (&self->priv->modem_3gpp_dbus_skeleton);
|
g_clear_object (&self->priv->modem_3gpp_dbus_skeleton);
|
||||||
self->priv->modem_3gpp_dbus_skeleton = g_value_dup_object (value);
|
self->priv->modem_3gpp_dbus_skeleton = g_value_dup_object (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_MODEM_3GPP_PROFILE_MANAGER_DBUS_SKELETON:
|
||||||
|
g_clear_object (&self->priv->modem_3gpp_profile_manager_dbus_skeleton);
|
||||||
|
self->priv->modem_3gpp_profile_manager_dbus_skeleton = g_value_dup_object (value);
|
||||||
|
break;
|
||||||
case PROP_MODEM_3GPP_USSD_DBUS_SKELETON:
|
case PROP_MODEM_3GPP_USSD_DBUS_SKELETON:
|
||||||
g_clear_object (&self->priv->modem_3gpp_ussd_dbus_skeleton);
|
g_clear_object (&self->priv->modem_3gpp_ussd_dbus_skeleton);
|
||||||
self->priv->modem_3gpp_ussd_dbus_skeleton = g_value_dup_object (value);
|
self->priv->modem_3gpp_ussd_dbus_skeleton = g_value_dup_object (value);
|
||||||
@@ -12160,6 +12212,9 @@ get_property (GObject *object,
|
|||||||
case PROP_MODEM_3GPP_DBUS_SKELETON:
|
case PROP_MODEM_3GPP_DBUS_SKELETON:
|
||||||
g_value_set_object (value, self->priv->modem_3gpp_dbus_skeleton);
|
g_value_set_object (value, self->priv->modem_3gpp_dbus_skeleton);
|
||||||
break;
|
break;
|
||||||
|
case PROP_MODEM_3GPP_PROFILE_MANAGER_DBUS_SKELETON:
|
||||||
|
g_value_set_object (value, self->priv->modem_3gpp_profile_manager_dbus_skeleton);
|
||||||
|
break;
|
||||||
case PROP_MODEM_3GPP_USSD_DBUS_SKELETON:
|
case PROP_MODEM_3GPP_USSD_DBUS_SKELETON:
|
||||||
g_value_set_object (value, self->priv->modem_3gpp_ussd_dbus_skeleton);
|
g_value_set_object (value, self->priv->modem_3gpp_ussd_dbus_skeleton);
|
||||||
break;
|
break;
|
||||||
@@ -12356,6 +12411,11 @@ dispose (GObject *object)
|
|||||||
g_clear_object (&self->priv->modem_3gpp_dbus_skeleton);
|
g_clear_object (&self->priv->modem_3gpp_dbus_skeleton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self->priv->modem_3gpp_profile_manager_dbus_skeleton) {
|
||||||
|
mm_iface_modem_3gpp_profile_manager_shutdown (MM_IFACE_MODEM_3GPP_PROFILE_MANAGER (object));
|
||||||
|
g_clear_object (&self->priv->modem_3gpp_profile_manager_dbus_skeleton);
|
||||||
|
}
|
||||||
|
|
||||||
if (self->priv->modem_3gpp_ussd_dbus_skeleton) {
|
if (self->priv->modem_3gpp_ussd_dbus_skeleton) {
|
||||||
mm_iface_modem_3gpp_ussd_shutdown (MM_IFACE_MODEM_3GPP_USSD (object));
|
mm_iface_modem_3gpp_ussd_shutdown (MM_IFACE_MODEM_3GPP_USSD (object));
|
||||||
g_clear_object (&self->priv->modem_3gpp_ussd_dbus_skeleton);
|
g_clear_object (&self->priv->modem_3gpp_ussd_dbus_skeleton);
|
||||||
@@ -12515,6 +12575,14 @@ iface_modem_3gpp_init (MMIfaceModem3gpp *iface)
|
|||||||
iface->create_initial_eps_bearer = modem_3gpp_create_initial_eps_bearer;
|
iface->create_initial_eps_bearer = modem_3gpp_create_initial_eps_bearer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
iface_modem_3gpp_profile_manager_init (MMIfaceModem3gppProfileManager *iface)
|
||||||
|
{
|
||||||
|
/* Initialization steps */
|
||||||
|
iface->check_support = NULL;
|
||||||
|
iface->check_support_finish = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssd *iface)
|
iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssd *iface)
|
||||||
{
|
{
|
||||||
@@ -12722,6 +12790,10 @@ mm_broadband_modem_class_init (MMBroadbandModemClass *klass)
|
|||||||
PROP_MODEM_3GPP_DBUS_SKELETON,
|
PROP_MODEM_3GPP_DBUS_SKELETON,
|
||||||
MM_IFACE_MODEM_3GPP_DBUS_SKELETON);
|
MM_IFACE_MODEM_3GPP_DBUS_SKELETON);
|
||||||
|
|
||||||
|
g_object_class_override_property (object_class,
|
||||||
|
PROP_MODEM_3GPP_PROFILE_MANAGER_DBUS_SKELETON,
|
||||||
|
MM_IFACE_MODEM_3GPP_PROFILE_MANAGER_DBUS_SKELETON);
|
||||||
|
|
||||||
g_object_class_override_property (object_class,
|
g_object_class_override_property (object_class,
|
||||||
PROP_MODEM_3GPP_USSD_DBUS_SKELETON,
|
PROP_MODEM_3GPP_USSD_DBUS_SKELETON,
|
||||||
MM_IFACE_MODEM_3GPP_USSD_DBUS_SKELETON);
|
MM_IFACE_MODEM_3GPP_USSD_DBUS_SKELETON);
|
||||||
|
1673
src/mm-iface-modem-3gpp-profile-manager.c
Normal file
1673
src/mm-iface-modem-3gpp-profile-manager.c
Normal file
File diff suppressed because it is too large
Load Diff
248
src/mm-iface-modem-3gpp-profile-manager.h
Normal file
248
src/mm-iface-modem-3gpp-profile-manager.h
Normal file
@@ -0,0 +1,248 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* 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:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 Aleksander Morgado <aleksander@aleksander.es>
|
||||||
|
* Copyright (C) 2021 Google, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MM_IFACE_MODEM_3GPP_PROFILE_MANAGER_H
|
||||||
|
#define MM_IFACE_MODEM_3GPP_PROFILE_MANAGER_H
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
#include <gio/gio.h>
|
||||||
|
|
||||||
|
#define _LIBMM_INSIDE_MM
|
||||||
|
#include <libmm-glib.h>
|
||||||
|
|
||||||
|
#define MM_TYPE_IFACE_MODEM_3GPP_PROFILE_MANAGER (mm_iface_modem_3gpp_profile_manager_get_type ())
|
||||||
|
#define MM_IFACE_MODEM_3GPP_PROFILE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_IFACE_MODEM_3GPP_PROFILE_MANAGER, MMIfaceModem3gppProfileManager))
|
||||||
|
#define MM_IS_IFACE_MODEM_3GPP_PROFILE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_IFACE_MODEM_3GPP_PROFILE_MANAGER))
|
||||||
|
#define MM_IFACE_MODEM_3GPP_PROFILE_MANAGER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_IFACE_MODEM_3GPP_PROFILE_MANAGER, MMIfaceModem3gppProfileManager))
|
||||||
|
|
||||||
|
#define MM_IFACE_MODEM_3GPP_PROFILE_MANAGER_DBUS_SKELETON "iface-modem-3gpp-profile-manager-dbus-skeleton"
|
||||||
|
|
||||||
|
typedef struct _MMIfaceModem3gppProfileManager MMIfaceModem3gppProfileManager;
|
||||||
|
|
||||||
|
struct _MMIfaceModem3gppProfileManager {
|
||||||
|
GTypeInterface g_iface;
|
||||||
|
|
||||||
|
/* Check for profile management support (async) */
|
||||||
|
void (* check_support) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* check_support_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Asynchronous setup of unsolicited events */
|
||||||
|
void (* setup_unsolicited_events) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* setup_unsolicited_events_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Asynchronous enabling of unsolicited events */
|
||||||
|
void (* enable_unsolicited_events) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* enable_unsolicited_events_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Asynchronous disabling of unsolicited events */
|
||||||
|
void (* disable_unsolicited_events) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* disable_unsolicited_events_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Asynchronous cleaning up of unsolicited events */
|
||||||
|
void (* cleanup_unsolicited_events) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* cleanup_unsolicited_events_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Get a single profile.
|
||||||
|
* This is completely optional, and should be used by implementations that are able
|
||||||
|
* to query one single profile settings. For all other implementations, it should be
|
||||||
|
* set to NULL so that the generic implementation is used (listing all and lookup by
|
||||||
|
* profile id) */
|
||||||
|
void (* get_profile) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
gint profile_id,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
MM3gppProfile * (* get_profile_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* List */
|
||||||
|
void (* list_profiles) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* list_profiles_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GList **profiles,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Delete */
|
||||||
|
void (* delete_profile) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
MM3gppProfile *requested,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* delete_profile_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check profile format (substep of 'set profiles')
|
||||||
|
*
|
||||||
|
* Before a profile is set, we would like to check the format of the set
|
||||||
|
* operation, if possible.
|
||||||
|
*
|
||||||
|
* Expected outputs:
|
||||||
|
* - new_id: whether new profiles can be created with a specific known id.
|
||||||
|
* - min_profile_id: minimum supported profile id.
|
||||||
|
* - max_profile_id: maximum supported profile id.
|
||||||
|
* - apn_cmp: method to use when comparing APN strings.
|
||||||
|
* - profile_cmp_flags: flags to use when comparing profile objects.
|
||||||
|
*
|
||||||
|
* The check is done per IP family, as the ranges may be different for each.
|
||||||
|
*/
|
||||||
|
void (* check_format) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
MMBearerIpFamily family,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* check_format_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
gboolean *new_id,
|
||||||
|
gint *min_profile_id,
|
||||||
|
gint *max_profile_id,
|
||||||
|
GEqualFunc *apn_cmp,
|
||||||
|
MM3gppProfileCmpFlags *profile_cmp_flags,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Check activated profile (substep of 'set profiles')
|
||||||
|
*
|
||||||
|
* Before a profile is set, we may attempt to deactivate it first, but only
|
||||||
|
* if there is no known bearer using it already and only if this check for
|
||||||
|
* activation really reports the profile being already activated.
|
||||||
|
*
|
||||||
|
* The given profile MUST have profile-id set, so the set_profile()
|
||||||
|
* implementation should only use it once the profile-id is known, never
|
||||||
|
* before.
|
||||||
|
*
|
||||||
|
* This step is optional (method pointers can be initialized to NULL), so
|
||||||
|
* that the deactivate profile step is done always.
|
||||||
|
*/
|
||||||
|
void (* check_activated_profile) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
MM3gppProfile *requested,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* check_activated_profile_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
gboolean *out_activated,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Deactivate profile (substep of 'set profiles')
|
||||||
|
*
|
||||||
|
* Before a profile is set, we may attempt to deactivate it first, but only
|
||||||
|
* if there is no known bearer using it already.
|
||||||
|
*
|
||||||
|
* The given profile MUST have profile-id set, so the set_profile()
|
||||||
|
* implementation should only use it once the profile-id is known, never
|
||||||
|
* before.
|
||||||
|
*/
|
||||||
|
void (* deactivate_profile) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
MM3gppProfile *requested,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean (* deactivate_profile_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Store profile (substep of 'set profiles') */
|
||||||
|
void (* store_profile) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
MM3gppProfile *requested,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gint (* store_profile_finish) (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
};
|
||||||
|
|
||||||
|
GType mm_iface_modem_3gpp_profile_manager_get_type (void);
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModem3gppProfileManager, g_object_unref)
|
||||||
|
|
||||||
|
/* Initialize profile manager interface (async) */
|
||||||
|
void mm_iface_modem_3gpp_profile_manager_initialize (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean mm_iface_modem_3gpp_profile_manager_initialize_finish (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Enable profile manager interface (async) */
|
||||||
|
void mm_iface_modem_3gpp_profile_manager_enable (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean mm_iface_modem_3gpp_profile_manager_enable_finish (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Disable profile manager interface (async) */
|
||||||
|
void mm_iface_modem_3gpp_profile_manager_disable (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean mm_iface_modem_3gpp_profile_manager_disable_finish (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
/* Shutdown profile manager interface */
|
||||||
|
void mm_iface_modem_3gpp_profile_manager_shutdown (MMIfaceModem3gppProfileManager *self);
|
||||||
|
|
||||||
|
/* Bind properties for simple GetStatus() */
|
||||||
|
void mm_iface_modem_3gpp_profile_manager_bind_simple_status (MMIfaceModem3gppProfileManager *self,
|
||||||
|
MMSimpleStatus *status);
|
||||||
|
|
||||||
|
/* Helper to emit the Updated signal by implementations */
|
||||||
|
void mm_iface_modem_3gpp_profile_manager_updated (MMIfaceModem3gppProfileManager *self);
|
||||||
|
|
||||||
|
/* Internal list profile management */
|
||||||
|
void mm_iface_modem_3gpp_profile_manager_get_profile (MMIfaceModem3gppProfileManager *self,
|
||||||
|
gint profile_id,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
MM3gppProfile *mm_iface_modem_3gpp_profile_manager_get_profile_finish (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
void mm_iface_modem_3gpp_profile_manager_list_profiles (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
gboolean mm_iface_modem_3gpp_profile_manager_list_profiles_finish (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GList **profiles,
|
||||||
|
GError **error);
|
||||||
|
void mm_iface_modem_3gpp_profile_manager_set_profile (MMIfaceModem3gppProfileManager *self,
|
||||||
|
MM3gppProfile *requested,
|
||||||
|
gboolean strict,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
MM3gppProfile *mm_iface_modem_3gpp_profile_manager_set_profile_finish (MMIfaceModem3gppProfileManager *self,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* MM_IFACE_MODEM_3GPP_PROFILE_MANAGER_H */
|
Reference in New Issue
Block a user