Hidd
Intro
This is a research page on hidd -- how to examine what it does, how it works, etc.
Files
Hidd is started from upstart (/etc/event.d/hidd) with a -f option to load a given configuration file. On the emulator, this is /etc/hidd/HidPluginsVbox.xml. On a pre, this is /etc/hidd/HidPlugins.xml. There's also something called casper there, not sure what that is as of yet
Architecture
Hidd seems to use a modular plugin-style architecture where each plugin is a shared library.
Default files are:
libhid.so libhidavrcp.so libhidlight.so libhidqemukeypad.so libhidtouchpanel.so libhidaccelerometer.so libhidkeypad.so libhidproximity.so libhidqemutouchpanel.so
Plugin definition in config file
<source lang=xml>
<plugin> <name>HidKeypad</name> <eventsDeferIdle>true</eventsDeferIdle> <eventSocketAddress>/var/tmp/hidd/KeypadEventSocket</eventSocketAddress> <cmdSocketAddress>/var/tmp/hidd/KeypadCmdSocket</cmdSocketAddress> <path>/usr/lib/libhidkeypad.so</path> </plugin>
</source>
Starting the daemon
A lot of debug information can be obtained by starting the daemon like so (on a pre, on an emulator add Vbox before .xml)
/usr/bin/hidd -vvv -f /etc/hidd/HidPlugins.xml
Example trace
/usr/bin/hidd -vvv -f /etc/hidd/HidPlugins-keypadonly.xml
Verbosity level set to 7
root@castle:/etc/hidd# hidd -vvvv -f /etc/hidd/HidPlugins-test.xml
Verbosity level set to 7
Plugin: 0
Name: HidKeypad Path: /usr/lib/libhidkeypad.so Event Socket Address: /var/tmp/hidd/KeypadEventSocket Cmd Socket Address: /var/tmp/hidd/KeypadCmdSocket
_SetupPluginTransport:
Socket created successfully
_SetupPluginTransport:
--> Event socket address: /var/tmp/hidd/KeypadEventSocket
_SetupPluginTransport:
--> Command socket address: /var/tmp/hidd/KeypadCmdSocket
Init:
HidKeypad: init function called!
HidKeypadIpc.c:104 : GetSwitchStates: Bad file descriptor ReportEvent:
kInputEvent received 1 events, fd: 7
_ReportStandardEvent:
Event: 0.0, type=EV_SYN, code=8, value=0
HidPluginStartReaderThread:
HidKeypad: starting reader thread
main:
Setting up power management...
ReportEvent:
kInputEvent received 2 events, fd: 7
_ReportStandardEvent:
Event: 85906.791100, type=EV_KEY, code=19, value=1
_ReportStandardEvent:
Event: 85906.791130, type=EV_SYN, code=0, value=0
ReportEvent:
kInputEvent received 2 events, fd: 7
_ReportStandardEvent:
Event: 85906.999809, type=EV_KEY, code=19, value=0
_ReportStandardEvent:
Event: 85906.999840, type=EV_SYN, code=0, value=0