Commit 30d39840 authored by Zeeshan Ali's avatar Zeeshan Ali

modem: Add 'time-threshold' property

Add 'time-threshold' property of type guint, not GClueMinUINT to Modem
interface. In a following patch, ModemManager implementation will
translate this to ModemLocation::gps-refresh-rate property of
ModemManager service.

There is no reason to use the more complex GClueMinUINT type here since
the Modem implementations are at the last end of the time-threshold users
and hence just needs one specific value to be set on them.

https://bugs.freedesktop.org/show_bug.cgi?id=105993
parent d26392ea
......@@ -63,6 +63,15 @@ gclue_modem_default_init (GClueModemInterface *iface)
G_PARAM_READABLE);
g_object_interface_install_property (iface, spec);
spec = g_param_spec_uint ("time-threshold",
"TimeThreshold",
"Time Threshold",
0,
G_MAXUINT,
0,
G_PARAM_READWRITE);
g_object_interface_install_property (iface, spec);
g_signal_new ("fix-3g",
GCLUE_TYPE_MODEM,
G_SIGNAL_RUN_LAST,
......@@ -125,6 +134,24 @@ gclue_modem_get_is_gps_available (GClueModem *modem)
return GCLUE_MODEM_GET_INTERFACE (modem)->get_is_gps_available (modem);
}
guint
gclue_modem_get_time_threshold (GClueModem *modem)
{
g_return_val_if_fail (GCLUE_IS_MODEM (modem), 0);
return GCLUE_MODEM_GET_INTERFACE (modem)->get_time_threshold (modem);
}
void
gclue_modem_set_time_threshold (GClueModem *modem,
guint threshold)
{
g_return_if_fail (GCLUE_IS_MODEM (modem));
return GCLUE_MODEM_GET_INTERFACE (modem)->set_time_threshold
(modem, threshold);
}
void
gclue_modem_enable_3g (GClueModem *modem,
GCancellable *cancellable,
......
......@@ -47,6 +47,9 @@ struct _GClueModemInterface {
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
guint (*get_time_threshold) (GClueModem *modem);
void (*set_time_threshold) (GClueModem *modem,
guint threshold);
gboolean (*enable_3g_finish) (GClueModem *modem,
GAsyncResult *result,
GError **error);
......@@ -82,6 +85,9 @@ void gclue_modem_enable_3g (GClueModem *modem,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
guint gclue_modem_get_time_threshold (GClueModem *modem);
void gclue_modem_set_time_threshold (GClueModem *modem,
guint threshold);
gboolean gclue_modem_enable_3g_finish (GClueModem *modem,
GAsyncResult *result,
GError **error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment