Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 04-21-2025, 07:27 AM   #1
hanginwithdaddo
Enthusiast
hanginwithdaddo doesn't litterhanginwithdaddo doesn't litter
 
hanginwithdaddo's Avatar
 
Posts: 32
Karma: 122
Join Date: Apr 2025
Location: Pennsylvania, USA
Device: Kindle Signature, 12th Gen.
How to send/receive custom events

I'm running Kindle OS 5.17.0 on a Kindle Signature 12th Generation and found that the following can be done to send/receive custom lipc events:

To send a custom event:

Code:
lipc-send-event aaa.bbb.ccc event_name1 -s "somestring"
lipc-send-event aaa.bbb.ccc event_name2 -i #
where:

Quote:
aaa-bbb-ccc is a "source" for the event
aaa is a custom domain (I used "com")
bbb is package name
ccc is an app name
event_name1/event_name2 are event names
somestring is some text that you want to pass along with the event
# is an integer
Example:

Quote:
lipc-send-event com.mypackage.myapp myevent -s "my event data"
To receive and process the event above:

Code:
lipc-wait-event -m com.mypackage.myapp myevent 2>/dev/null | while read event
do
    # $event contains all of the event details in the form:
    #
    # source name data
    #
    # where:
    #
    # data will be enclosed in quotes if a string, and not if a numeric value
    #
    # We cannot use IFS substitution because the data
    # may include spaces. Therefore, we just use cut.
    source=$(echo "${event}" | cut -d ' ' -f1)
    name=$(echo "${event}" | cut -d ' ' -f2)
    data=$(echo "${event}" | cut -d ' ' -f3-)
    case "${event}" in
    "com.mypackage.myapp myevent"*)
        echo "source = ${source}, name = ${name}, data = ${data}"
        ;;
    esac

Last edited by hanginwithdaddo; 04-22-2025 at 02:54 PM.
hanginwithdaddo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sleep cover events - how to receive? sergeyvl12 Kobo Developer's Corner 2 10-10-2013 03:41 PM
Touch uinput : send simulated touch/key events to Kobo ? Rom1 Kobo Reader 0 06-08-2012 08:50 AM
Using the kindle to send/receive text messages (launchpad browser shortcut) daxp Amazon Kindle 0 09-25-2011 03:49 PM
Send/Receive files WiFi then 3G? jerrywojo Amazon Kindle 1 03-01-2011 09:57 PM
Send to device now supports custom paths user_none Calibre 0 01-04-2010 06:13 AM


All times are GMT -4. The time now is 10:32 PM.


MobileRead.com is a privately owned, operated and funded community.