Commit e7b1195f authored by Philippe De Swert's avatar Philippe De Swert

Add dbus method to query set config and update docs

Signed-off-by: default avatarPhilippe De Swert <philippe.deswert@jollamobile.com>
parent 3d2613dd
AC_INIT([usb_moded], [0.58])
AC_INIT([usb_moded], [0.59])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_CONFIG_HEADER([config.h])
......
usb-moded (0.59) unstable; urgency=low
* Do not depend on the config, but always go to developer mode in rescue mode
* Add a dbus method to query the currently set config option
-- Philippe De Swert <philippe.deswert@jollamobile.com> Fri, 15 Feb 2013 23:32:55 +0200
usb-moded (0.58) unstable; urgency=low
* Fix bug with ask mode since module loading failed
......
......@@ -43,6 +43,12 @@ Even the configuration can be set over DBus (this will set either the gconf key
dbus-send --system --type=method_call --print-reply --dest=com.meego.usb_moded /com/meego/usb_moded com.meego.usb_moded.set_config string:'<mode_name>'
To get the currently stored default mode from the config:
dbus-send --system --type=method_call --print-reply --dest=com.meego.usb_moded /com/meego/usb_moded com.meego.usb_moded.get_config
=== WITH GCONF ONLY ===
However this can also be optionally handled by setting the following GConf key (gconf has to be compiled in).
/Meego/System/UsbMode (querying and setting can be done as follows:
......@@ -50,6 +56,8 @@ However this can also be optionally handled by setting the following GConf key (
gconftool-2 -g /Meego/System/UsbMode
gconftool-2 -s /Meego/System/UsbMode --type=string <mode_name>
=== END WITH GCONF ONLY ===
Usb_moded will also broadcast changes and errors over the system bus.
This will happen on the com.meego.usb_moded interface
......@@ -243,3 +251,12 @@ android kernels.
atm only networking mode is fully supported, mass-storage partly.
rescue mode
-----------
When started with -r usb_moded will always enable developer mode (networking)
if it can. This is a debug feature and should not be used in a final image.
Turning it off when the device is booted completely can easily be done over dbus.
dbus-send --system --type=method_call --print-reply --dest=com.meego.usb_moded /com/meego/usb_moded com.meego.usb_moded.rescue_off
......@@ -152,6 +152,13 @@ error_reply:
}
dbus_error_free(&err);
}
else if(!strcmp(member, USB_MODE_CONFIG_GET))
{
const char *config = get_mode_setting();
if((reply = dbus_message_new_method_return(msg)))
dbus_message_append_args (reply, DBUS_TYPE_STRING, &config, DBUS_TYPE_INVALID);
}
else if(!strcmp(member, USB_MODE_RESCUE_OFF))
{
rescue_mode = FALSE;
......
......@@ -31,12 +31,14 @@
/* supported methods */
#define USB_MODE_STATE_REQUEST "mode_request"
#define USB_MODE_RESCUE_OFF "rescue_off"
#define USB_MODE_CONFIG_GET "get_config" /* returns the mode set in the config */
/**
* @credential usb-moded::USBControl Credential needed to be able to call the set_mode or set_config methods
**/
#define USB_MODE_STATE_SET "set_mode"
#define USB_MODE_CONFIG_SET "set_config"
#define USB_MODE_NETWORK_SET "net_config"
#define USB_MODE_STATE_SET "set_mode" /* set a mode (only works when connected) */
#define USB_MODE_CONFIG_SET "set_config" /* set the mode that needs to be activated in the config file */
#define USB_MODE_NETWORK_SET "net_config" /* set the network config in the config file */
/* state definitions for signals and method parameters */
#define USB_CONNECTED "USB connected"
......
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