From 715a7759491b3c7c716ffbf768a2ece222b23fb1 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 2 Oct 2012 11:37:01 +0200 Subject: libmm-glib,firmware: new `MMModemFirmware' type to handle the Firmware interface --- libmm-glib/mm-object.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'libmm-glib/mm-object.c') diff --git a/libmm-glib/mm-object.c b/libmm-glib/mm-object.c index ebcfd6ae..9cc281f7 100644 --- a/libmm-glib/mm-object.c +++ b/libmm-glib/mm-object.c @@ -375,6 +375,42 @@ mm_object_peek_modem_time (MMObject *self) /*****************************************************************************/ +/** + * mm_object_get_modem_firmware: + * @self: A #MMObject. + * + * Gets the #MMModemFirmware instance for the D-Bus interface org.freedesktop.ModemManager1.Modem.Firmware on @self, if any. + * + * Returns: (transfer full): A #MMModemFirmware that must be freed with g_object_unref() or %NULL if @self does not implement the interface. + */ +MMModemFirmware * +mm_object_get_modem_firmware (MMObject *self) +{ + g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL); + + return (MMModemFirmware *)mm_gdbus_object_get_modem_firmware (MM_GDBUS_OBJECT (self)); +} + +/** + * mm_object_peek_modem_firmware: (skip) + * @self: A #MMObject. + * + * Like mm_object_get_modem_firmware() but doesn't increase the reference count on the returned object. + * + * It is not safe to use the returned object if you are on another thread than the one where the #MMManager is running. + * + * Returns: (transfer none): A #MMModemFirmware or %NULL if @self does not implement the interface. Do not free the returned object, it is owned by @self. + */ +MMModemFirmware * +mm_object_peek_modem_firmware (MMObject *self) +{ + g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL); + + return (MMModemFirmware *)mm_gdbus_object_peek_modem_firmware (MM_GDBUS_OBJECT (self)); +} + +/*****************************************************************************/ + static void mm_object_init (MMObject *self) { -- cgit v1.2.3-70-g09d2