View Single Post
Old 12-19-2011, 02:10 PM   #6
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Ha, found it!

Next to /usr/bin/powerd is a binary /usr/bin/powerd_test which gives the following usage hint when executed:

Code:
powerd_test: Utility to test powerd
Options:
  s          : Print status
  i          : Simulate input event
  p          : Simulate power button pressed event
  h          : Simulate power button held event
  l          : Simulate low batt low event
  d <value>  : Set defer sleep property to given value
  r          : Simulate a random series of events at random intervals.
               Max interval is 10s by default.
  b<optional>: Set fake battery level if a value is provided. Remember to
               there is no space between b and value.  If no value is
               provided, it interactively accepts values from you and sets
               fake battery level
  t <value>  : Max interval between events in seconds.
               Valid only when used with -r
  NOTE       : Only one of i,p,d, b and r can be used at one time
Using strings on powerd_test reveals that the following command toggles the power state:

Code:
lipc-send-event com.lab126.powerd.debug dbg_power_button_pressed
And this command gives information about the current state:

Code:
[root@kindle /]# lipc-get-prop com.lab126.powerd status
Powerd state: Screen Saver
Remaining time in this state: Unknown
defer_suspend:0
suspend_grace:0
prevent_screen_saver:0
drive_mode:off
Battery Level: 92%
Last batt event at: 92%
Charging: Yes
batt_full=0
Battery logging: On
I still haven't found a way to trigger the whispersync without simulating key presses...

Ciao,
Steffen
siebert is offline   Reply With Quote