api,bearer: new 'DisconnectRequest' property
To report that the bearer has been killed from the modem side and the connection should be terminated. Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
This commit is contained in:
@@ -138,6 +138,7 @@ print_bearer_info (MMBearer *bearer)
|
||||
g_autoptr(MMBearerProperties) properties = NULL;
|
||||
g_autoptr(MMBearerStats) stats = NULL;
|
||||
g_autoptr(GError) connection_error = NULL;
|
||||
gboolean disconnect_request = FALSE;
|
||||
gint profile_id;
|
||||
gchar *profile_id_str;
|
||||
|
||||
@@ -147,6 +148,7 @@ print_bearer_info (MMBearer *bearer)
|
||||
stats = mm_bearer_get_stats (bearer);
|
||||
profile_id = mm_bearer_get_profile_id (bearer);
|
||||
connection_error = mm_bearer_get_connection_error (bearer);
|
||||
disconnect_request = mm_bearer_get_disconnect_request (bearer);
|
||||
|
||||
profile_id_str = (profile_id != MM_3GPP_PROFILE_ID_UNKNOWN) ? g_strdup_printf ("%d", profile_id) : NULL;
|
||||
|
||||
@@ -156,6 +158,7 @@ print_bearer_info (MMBearer *bearer)
|
||||
mmcli_output_string (MMC_F_BEARER_STATUS_CONNECTED, mm_bearer_get_connected (bearer) ? "yes" : "no");
|
||||
mmcli_output_string_take (MMC_F_BEARER_STATUS_CONNECTION_ERROR_NAME, connection_error ? g_dbus_error_encode_gerror (connection_error) : NULL);
|
||||
mmcli_output_string (MMC_F_BEARER_STATUS_CONNECTION_ERROR_MESSAGE, connection_error ? connection_error->message : NULL);
|
||||
mmcli_output_string (MMC_F_BEARER_STATUS_DISCONNECT_REQUEST, disconnect_request ? "yes" : "no");
|
||||
mmcli_output_string (MMC_F_BEARER_STATUS_SUSPENDED, mm_bearer_get_suspended (bearer) ? "yes" : "no");
|
||||
mmcli_output_string (MMC_F_BEARER_STATUS_MULTIPLEXED, mm_bearer_get_multiplexed (bearer) ? "yes" : "no");
|
||||
mmcli_output_string (MMC_F_BEARER_STATUS_INTERFACE, mm_bearer_get_interface (bearer));
|
||||
|
||||
@@ -242,6 +242,7 @@ static FieldInfo field_infos[] = {
|
||||
[MMC_F_BEARER_STATUS_CONNECTED] = { "bearer.status.connected", "connected", MMC_S_BEARER_STATUS, },
|
||||
[MMC_F_BEARER_STATUS_CONNECTION_ERROR_NAME] = { "bearer.status.connection-error.name", "connection error name", MMC_S_BEARER_STATUS, },
|
||||
[MMC_F_BEARER_STATUS_CONNECTION_ERROR_MESSAGE] = { "bearer.status.connection-error.message", "connection error message", MMC_S_BEARER_STATUS, },
|
||||
[MMC_F_BEARER_STATUS_DISCONNECT_REQUEST] = { "bearer.status.disconnect-request", "disconnect request", 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, },
|
||||
|
||||
@@ -260,6 +260,7 @@ typedef enum {
|
||||
MMC_F_BEARER_STATUS_CONNECTED,
|
||||
MMC_F_BEARER_STATUS_CONNECTION_ERROR_NAME,
|
||||
MMC_F_BEARER_STATUS_CONNECTION_ERROR_MESSAGE,
|
||||
MMC_F_BEARER_STATUS_DISCONNECT_REQUEST,
|
||||
MMC_F_BEARER_STATUS_SUSPENDED,
|
||||
MMC_F_BEARER_STATUS_MULTIPLEXED,
|
||||
MMC_F_BEARER_STATUS_INTERFACE,
|
||||
|
||||
@@ -1448,6 +1448,7 @@ mm_bearer_dup_path
|
||||
mm_bearer_get_interface
|
||||
mm_bearer_dup_interface
|
||||
mm_bearer_get_connected
|
||||
mm_bearer_get_disconnect_request
|
||||
mm_bearer_get_suspended
|
||||
mm_bearer_get_multiplexed
|
||||
mm_bearer_get_ip_timeout
|
||||
@@ -2345,6 +2346,7 @@ mm_gdbus_bearer_dup_properties
|
||||
mm_gdbus_bearer_get_connected
|
||||
mm_gdbus_bearer_get_connection_error
|
||||
mm_gdbus_bearer_dup_connection_error
|
||||
mm_gdbus_bearer_get_disconnect_request
|
||||
mm_gdbus_bearer_get_suspended
|
||||
mm_gdbus_bearer_get_multiplexed
|
||||
mm_gdbus_bearer_get_bearer_type
|
||||
@@ -2363,6 +2365,7 @@ mm_gdbus_bearer_call_disconnect_sync
|
||||
mm_gdbus_bearer_interface_info
|
||||
mm_gdbus_bearer_set_connected
|
||||
mm_gdbus_bearer_set_connection_error
|
||||
mm_gdbus_bearer_set_disconnect_request
|
||||
mm_gdbus_bearer_set_interface
|
||||
mm_gdbus_bearer_set_ip4_config
|
||||
mm_gdbus_bearer_set_ip6_config
|
||||
|
||||
@@ -115,6 +115,16 @@
|
||||
-->
|
||||
<property name="ConnectionError" type="(ss)" access="read" />
|
||||
|
||||
<!--
|
||||
DisconnectRequest:
|
||||
|
||||
Indicates that the bearer is no longer useable and the connection
|
||||
manager should terminate it as soon as possible.
|
||||
|
||||
Since: 1.26
|
||||
-->
|
||||
<property name="DisconnectRequest" type="b" access="read" />
|
||||
|
||||
<!--
|
||||
Suspended:
|
||||
|
||||
|
||||
@@ -517,6 +517,27 @@ PROPERTY_ERROR_DEFINE_FAILABLE (connection_error,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_bearer_get_disconnect_request:
|
||||
* @self: A #MMBearer.
|
||||
*
|
||||
* Gets whether a disconnect request is pending for this bearer
|
||||
*
|
||||
* Returns: %TRUE if the #MMBearer is waiting for disconnection,
|
||||
* #FALSE otherwise.
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
gboolean
|
||||
mm_bearer_get_disconnect_request (MMBearer *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_BEARER (self), FALSE);
|
||||
|
||||
return mm_gdbus_bearer_get_disconnect_request (MM_GDBUS_BEARER (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_bearer_connect_finish:
|
||||
* @self: A #MMBearer.
|
||||
|
||||
@@ -76,6 +76,8 @@ gchar *mm_bearer_dup_interface (MMBearer *self);
|
||||
|
||||
gboolean mm_bearer_get_connected (MMBearer *self);
|
||||
|
||||
gboolean mm_bearer_get_disconnect_request (MMBearer *self);
|
||||
|
||||
gboolean mm_bearer_get_reload_stats_supported (MMBearer *self);
|
||||
|
||||
gboolean mm_bearer_get_suspended (MMBearer *self);
|
||||
|
||||
Reference in New Issue
Block a user