Navigation Menu

Skip to content

Commit

Permalink
Signal hw keyboard availability state over D-Bus System Bus
Browse files Browse the repository at this point in the history
Classify evdev nodes that send KEY_Q and KEY_P events as keyboards
or slide-in keypads depending on whether they also emit SW_KEYPAD_SLIDE
switch state events.

Maintain a hw-keyboard-is-available state - which is true as long as
there exists at least one keyboard device or slide-in keypad in open
position.

When availability state changes, a keypad_available_state_ind signal
is broadcast over D-Bus System Bus.

<node name="/com/nokia/mce/signal">
  <interface name="com.nokia.mce.signal">
    <signal name="keypad_available_state_ind">
      <arg name="keypad_state" type="s"/>
    </signal>
  </interface>
</node>

Current state can be queried from mce with keypad_available_state_req
D-Bus method call.

<node name="/com/nokia/mce/request">
  <interface name="com.nokia.mce.request">
    <method name="keypad_available_state_req">
      <arg direction="out" name="keypad_state" type="s"/>
    </method>
  </interface>
</node>

[mce] Signal hw keyboard availability state over D-Bus System Bus. Fixes JB#25232
  • Loading branch information
spiiroin committed Dec 23, 2014
1 parent 63960dd commit 19e6c04
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 257 deletions.
6 changes: 6 additions & 0 deletions datapipe.c
Expand Up @@ -82,6 +82,9 @@ datapipe_struct lockkey_pipe;
/** Keyboard open/closed; read only */
datapipe_struct keyboard_slide_pipe;

/** Keyboard available; read only */
datapipe_struct keyboard_available_pipe;

/** Lid cover open/closed; read only */
datapipe_struct lid_cover_pipe;

Expand Down Expand Up @@ -823,6 +826,8 @@ void mce_datapipe_init(void)
0, GINT_TO_POINTER(0));
setup_datapipe(&keyboard_slide_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(COVER_CLOSED));
setup_datapipe(&keyboard_available_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(COVER_CLOSED));
setup_datapipe(&lid_cover_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(COVER_OPEN));
setup_datapipe(&lens_cover_pipe, READ_ONLY, DONT_FREE_CACHE,
Expand Down Expand Up @@ -902,6 +907,7 @@ void mce_datapipe_quit(void)
free_datapipe(&lens_cover_pipe);
free_datapipe(&lid_cover_pipe);
free_datapipe(&keyboard_slide_pipe);
free_datapipe(&keyboard_available_pipe);
free_datapipe(&lockkey_pipe);
free_datapipe(&device_inactive_pipe);
free_datapipe(&touchscreen_pipe);
Expand Down
1 change: 1 addition & 0 deletions datapipe.h
Expand Up @@ -106,6 +106,7 @@ extern datapipe_struct keypress_pipe;
extern datapipe_struct touchscreen_pipe;
extern datapipe_struct lockkey_pipe;
extern datapipe_struct keyboard_slide_pipe;
extern datapipe_struct keyboard_available_pipe;
extern datapipe_struct lid_cover_pipe;
extern datapipe_struct lens_cover_pipe;
extern datapipe_struct proximity_sensor_pipe;
Expand Down

0 comments on commit 19e6c04

Please sign in to comment.