api,3gpp: new 'PacketServiceState' property

This property allows the user to know whether the device is attached
or detached from the packet domain service.
This commit is contained in:
Aleksander Morgado
2021-10-21 10:51:38 +02:00
parent 98738521ef
commit f55ea211a9
9 changed files with 68 additions and 6 deletions

View File

@@ -395,6 +395,7 @@ print_modem_info (void)
const gchar *operator_code = NULL;
const gchar *operator_name = NULL;
const gchar *registration = NULL;
const gchar *packet_service_state = NULL;
const gchar *eps_ue_mode = NULL;
GList *pco_list = NULL;
const gchar *initial_eps_bearer_path = NULL;
@@ -409,6 +410,7 @@ print_modem_info (void)
operator_code = mm_modem_3gpp_get_operator_code (ctx->modem_3gpp);
operator_name = mm_modem_3gpp_get_operator_name (ctx->modem_3gpp);
registration = mm_modem_3gpp_registration_state_get_string (mm_modem_3gpp_get_registration_state (ctx->modem_3gpp));
packet_service_state = mm_modem_3gpp_packet_service_state_get_string (mm_modem_3gpp_get_packet_service_state (ctx->modem_3gpp));
eps_ue_mode = mm_modem_3gpp_eps_ue_mode_operation_get_string (mm_modem_3gpp_get_eps_ue_mode_operation (ctx->modem_3gpp));
pco_list = mm_modem_3gpp_get_pco (ctx->modem_3gpp);
initial_eps_bearer_path = mm_modem_3gpp_get_initial_eps_bearer_path (ctx->modem_3gpp);
@@ -431,6 +433,7 @@ print_modem_info (void)
mmcli_output_string (MMC_F_3GPP_OPERATOR_ID, operator_code);
mmcli_output_string (MMC_F_3GPP_OPERATOR_NAME, operator_name);
mmcli_output_string (MMC_F_3GPP_REGISTRATION, registration);
mmcli_output_string (MMC_F_3GPP_PACKET_SERVICE_STATE, packet_service_state);
mmcli_output_string (MMC_F_3GPP_EPS_UE_MODE, eps_ue_mode);
mmcli_output_string (MMC_F_3GPP_EPS_INITIAL_BEARER_PATH, g_strcmp0 (initial_eps_bearer_path, "/") != 0 ? initial_eps_bearer_path : NULL);
mmcli_output_string (MMC_F_3GPP_EPS_BEARER_SETTINGS_APN, initial_eps_bearer_apn);

View File

@@ -131,6 +131,7 @@ static FieldInfo field_infos[] = {
[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_PACKET_SERVICE_STATE] = { "modem.3gpp.packet-service-state", "packet service state", 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, },

View File

@@ -132,6 +132,7 @@ typedef enum {
MMC_F_3GPP_OPERATOR_ID,
MMC_F_3GPP_OPERATOR_NAME,
MMC_F_3GPP_REGISTRATION,
MMC_F_3GPP_PACKET_SERVICE_STATE,
MMC_F_3GPP_PCO,
/* 3GPP EPS section */
MMC_F_3GPP_EPS_UE_MODE,

View File

@@ -26,6 +26,7 @@ MMModem3gppSubscriptionState
MMModem3gppRegistrationState
MMModem3gppUssdSessionState
MMModem3gppEpsUeModeOperation
MMModem3gppPacketServiceState
MMModemAccessTechnology
MMModemBand
MMModemCapability

View File

@@ -307,6 +307,7 @@ mm_modem_3gpp_get_initial_eps_bearer_finish
mm_modem_3gpp_get_initial_eps_bearer_sync
mm_modem_3gpp_get_initial_eps_bearer_settings
mm_modem_3gpp_peek_initial_eps_bearer_settings
mm_modem_3gpp_get_packet_service_state
<SUBSECTION Methods>
mm_modem_3gpp_register
mm_modem_3gpp_register_finish
@@ -1699,6 +1700,7 @@ mm_modem_3gpp_facility_build_string_from_mask
mm_modem_3gpp_network_availability_get_string
mm_modem_3gpp_ussd_session_state_get_string
mm_modem_3gpp_eps_ue_mode_operation_get_string
mm_modem_3gpp_packet_service_state_get_string
mm_modem_cdma_registration_state_get_string
mm_modem_cdma_activation_state_get_string
mm_modem_cdma_rm_protocol_get_string
@@ -1751,6 +1753,7 @@ mm_modem_cdma_registration_state_build_string_from_mask
mm_modem_cdma_activation_state_build_string_from_mask
mm_modem_cdma_rm_protocol_build_string_from_mask
mm_modem_3gpp_registration_state_build_string_from_mask
mm_modem_3gpp_packet_service_state_build_string_from_mask
mm_modem_3gpp_subscription_state_build_string_from_mask
mm_modem_3gpp_facility_get_string
mm_modem_3gpp_network_availability_build_string_from_mask
@@ -1780,6 +1783,7 @@ MM_TYPE_MODEM_3GPP_REGISTRATION_STATE
MM_TYPE_MODEM_3GPP_SUBSCRIPTION_STATE
MM_TYPE_MODEM_3GPP_USSD_SESSION_STATE
MM_TYPE_MODEM_3GPP_EPS_UE_MODE_OPERATION
MM_TYPE_MODEM_3GPP_PACKET_SERVICE_STATE
MM_TYPE_MODEM_ACCESS_TECHNOLOGY
MM_TYPE_MODEM_BAND
MM_TYPE_MODEM_CAPABILITY
@@ -1824,6 +1828,7 @@ mm_modem_3gpp_registration_state_get_type
mm_modem_3gpp_subscription_state_get_type
mm_modem_3gpp_ussd_session_state_get_type
mm_modem_3gpp_eps_ue_mode_operation_get_type
mm_modem_3gpp_packet_service_state_get_type
mm_modem_access_technology_get_type
mm_modem_band_get_type
mm_modem_capability_get_type
@@ -2112,6 +2117,7 @@ mm_gdbus_modem3gpp_get_initial_eps_bearer
mm_gdbus_modem3gpp_dup_initial_eps_bearer
mm_gdbus_modem3gpp_get_initial_eps_bearer_settings
mm_gdbus_modem3gpp_dup_initial_eps_bearer_settings
mm_gdbus_modem3gpp_get_packet_service_state
<SUBSECTION Methods>
mm_gdbus_modem3gpp_call_register
mm_gdbus_modem3gpp_call_register_finish
@@ -2146,6 +2152,7 @@ mm_gdbus_modem3gpp_set_eps_ue_mode_operation
mm_gdbus_modem3gpp_set_pco
mm_gdbus_modem3gpp_set_initial_eps_bearer
mm_gdbus_modem3gpp_set_initial_eps_bearer_settings
mm_gdbus_modem3gpp_set_packet_service_state
<SUBSECTION Standard>
MM_GDBUS_IS_MODEM3GPP
MM_GDBUS_MODEM3GPP

View File

@@ -1601,4 +1601,20 @@ typedef enum { /*< underscore_name=mm_bearer_apn_type >*/
MM_BEARER_APN_TYPE_PRIVATE = 1 << 7,
} MMBearerApnType;
/**
* MMModem3gppPacketServiceState:
* @MM_MODEM_3GPP_PACKET_SERVICE_STATE_UNKNOWN: Unknown.
* @MM_MODEM_3GPP_PACKET_SERVICE_STATE_DETACHED: Detached.
* @MM_MODEM_3GPP_PACKET_SERVICE_STATE_ATTACHED: Attached.
*
* The packet domain service state.
*
* Since 1.20
*/
typedef enum { /*< underscore_name=mm_modem_3gpp_packet_service_state >*/
MM_MODEM_3GPP_PACKET_SERVICE_STATE_UNKNOWN = 0,
MM_MODEM_3GPP_PACKET_SERVICE_STATE_DETACHED = 1,
MM_MODEM_3GPP_PACKET_SERVICE_STATE_ATTACHED = 2,
} MMModem3gppPacketServiceState;
#endif /* _MODEMMANAGER_ENUMS_H_ */

View File

@@ -295,5 +295,15 @@
-->
<property name="InitialEpsBearerSettings" type="a{sv}" access="read" />
<!--
PacketServiceState:
A <link linkend="MMModem3gppPacketServiceState">MMModem3gppPacketServiceState</link>
value specifying the packet domain service state.
Since: 1.20
-->
<property name="PacketServiceState" type="u" access="read" />
</interface>
</node>

View File

@@ -404,6 +404,27 @@ mm_modem_3gpp_dup_initial_eps_bearer_path (MMModem3gpp *self)
/*****************************************************************************/
/**
* mm_modem_3gpp_get_packet_service_state:
* @self: A #MMModem.
*
* Get the packet domain service state.
*
* Returns: A #MMModem3gppPacketServiceState value, specifying the current PS attach
* state.
*
* Since: 1.20
*/
MMModem3gppPacketServiceState
mm_modem_3gpp_get_packet_service_state (MMModem3gpp *self)
{
g_return_val_if_fail (MM_IS_MODEM_3GPP (self), MM_MODEM_3GPP_PACKET_SERVICE_STATE_UNKNOWN);
return mm_gdbus_modem3gpp_get_packet_service_state (MM_GDBUS_MODEM3GPP (self));
}
/*****************************************************************************/
/**
* mm_modem_3gpp_register_finish:
* @self: A #MMModem3gpp.

View File

@@ -92,6 +92,8 @@ gchar *mm_modem_3gpp_dup_initial_eps_bearer_path (MMModem3gpp *self);
MMBearerProperties *mm_modem_3gpp_get_initial_eps_bearer_settings (MMModem3gpp *self);
MMBearerProperties *mm_modem_3gpp_peek_initial_eps_bearer_settings (MMModem3gpp *self);
MMModem3gppPacketServiceState mm_modem_3gpp_get_packet_service_state (MMModem3gpp *self);
void mm_modem_3gpp_register (MMModem3gpp *self,
const gchar *network_id,
GCancellable *cancellable,