diff options
author | Zeeshan Ali <zeeshanak@gnome.org> | 2018-04-14 23:20:00 +0200 |
---|---|---|
committer | Zeeshan Ali <zeeshanak@gnome.org> | 2018-04-17 12:30:20 +0200 |
commit | ef26c1430a41c2c633e54a64cdc3922fb5d76f05 (patch) | |
tree | df8f5c1c58466492d3a8422c935e0327dcad6f37 | |
parent | 59acc463bf5f8a97f551a48a9f826ca3f106738e (diff) | |
download | geoclue-ef26c1430a41c2c633e54a64cdc3922fb5d76f05.tar.gz |
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
-rw-r--r-- | src/gclue-modem.c | 27 | ||||
-rw-r--r-- | src/gclue-modem.h | 6 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/gclue-modem.c b/src/gclue-modem.c index dd5516f..53c8701 100644 --- a/src/gclue-modem.c +++ b/src/gclue-modem.c @@ -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, diff --git a/src/gclue-modem.h b/src/gclue-modem.h index efcef98..ce2c955 100644 --- a/src/gclue-modem.h +++ b/src/gclue-modem.h @@ -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); |