fix alsactl invocation bug. Spotted by DocScrutinizer -- thanks!
[openmoko-gsoc2008.git] / odeviced-old / docs / PLUGINS.txt
blob67d53dc7a85a8771f04360a5ec953ba9f8ecbe3c
1 For writing plugins refer the example ones present in plugins/
3 There are two types of configurations files which odeviced reads at
4 startup. 
6 * The global configuration located at /etc/odeviced.conf
7 * Plugin specific configuration at /usr/share/odeviced/plugins/<foo>.plugin
11 1.) Ensure that the shared module exports the init symbol of the form
12     <your_plugin_name>_init(ODevicedPlugin *plugin).
14     For example, for the "wifi" plugin it would be
15     wifi_init(ODevicedPlugin *plugin) {.......}
17     or
18     
19     wifi_init(ODeviced.Plugin plugin) {.......} if you are using vala
23 2.) If the plugin provides a DBus interface, odeviced_helpers_register_dbus_object()
24     can be used to register the dbus object that pertains to the plugin interface.
26     In the plugin configuration file, define the path as follows
27     
28     [wifi]
29     dbus_object_path=/org/freesmartphone/Device/Plugins/Wifi 
30     
31     In case the plugin uses sysfs, compute_objects() can be used to return a list of objects, 
32     one for each node under the device class. To do so define the device class as follows,
33     [power]
34     ...
35     device_class = power_supply
37     This is used in the power and the backlight plugin to register DBus paths automatically 
38     based on the device class which is set in their respective configuration files.
42 3.) If a plugin is to be loaded at odeviced startup, append the plugin name to
43     "enable" of [odeviced] group in the global configuration file. For example
45     [odeviced]
46     enable = powercontrol,wifi
50 4.) Dependencies for the plugins can be set in the plugin configuration file
51     using the "depends" key.
53     [battery]
54     depends = powercontrol
56     Multiple dependencies can be separated using ','.
58     
60 WARNING: Docs may change drastically as the code evolves :D