luna-send

Version added 26-Oct-2017| Modified 15-Oct-2018

luna-send is a command-line tool accessible through a shell on a device. luna-send is mainly used to test calls to services accessible on the system bus through the LS2 (Luna Bus).

SYNTAX

luna-send [OPTIONS...] URL '{JSON object}'

OPTIONS

Option Parameter Description

-h

None

Displays the help.

-P

None

Deprecated

-s

None

Sends a signal.

-a

None

Sends a specified appId in a message. (default is none)

-m

None

Displays service name. (default is none)

-d

None

Turns debug logging on.

-i

None

Turns interactive mode on.

-t

NUMBER_OF_TIMES

Displays average response time after calling this command the number of times.

-n

NUMBER_OF_REPLIES

Exits interactive mode after the number of replies.

-l

None

Displays the order of responses.

-f

None

Displays the response in the JSON format.

-q

QUERY_NAME

Displays a specific query item from responses. (multiple queries can be supplied)
e.g.:  -q 'returnValue' -q 'queues[0]'

-w

TIMEOUT

Sets exit timeout value.

PARAMETERS

Parameter Description

NUMBER_OF_TIMES

Specifies the number of times for calling a command.

NUMBER_OF_REPLIES

Specifies the number of replies.

QUERY_NAME

Specifies the name of query item.

TIMEOUT

Specifies exit timeout value. (Unit: milliseconds)

EXAMPLES

Get locale information by calling getSystemSettings method.

luna-send -n 1 luna://com.webos.settingsservice/getSystemSettings '{"keys":["localeInfo"]}'

{"subscribed":false,"method":"getSystemSettings","settings":{"localeInfo":{"locales":{"UI":"ko-KR"}}},"returnValue":true}

Set location information by calling setSystemSettings method.

luna-send -n 1 luna://com.webos.settingsservice/setSystemSettings '{"category":"option", "settings":{"country":"KOR"}}'

{"method":"setSystemSettings","returnValue":true}

List all of the registered applications by calling listApps method.

luna-send -n 1 -f luna://com.webos.service.applicationManager/listApps '{}'

{
    "subscribed": false,
    "apps": [
        {
            "defaultWindowType": "card",
            "bgImages": [
            ],
            "CPApp": false,
            "systemApp": true,
            "version": "0.0.1",
            "vendor": "My Company",
            "portraitResize": {
            },
            "hasPromotion": false,
            "requestedWindowOrientation": "",
            "icons": [
            ],
            "class": {
                "hidden": false
            },
            "largeIcon": "icon_130.png",
            "lockable": true,
            "privilegedJail": false,
             ... 
}

Launch an app which has ID of "com.webos.app.browser" by calling launch method.

luna-send -n 1 -f luna://com.webos.service.applicationManager/launch '{"id":"com.webos.app.browser"}'


    "returnValue": true 
}

Get network information by calling getStatus method. 

luna-send -n 1 -f luna://com.webos.service.connectionmanager/getStatus '{}'

{
    "cellular": {
        "enabled": false
    },
    "returnValue": true,
    "offlineMode": "disabled",
    "wired": {
        "netmask": "255.255.254.0",
        "dns1": "156.147.135.180", 
        "ipAddress": "10.177.232.163",
        "proxyinfo": {
            "method": "direct"
        },
        "onInternet": "no",
        "method": "dhcp",
        "state": "connected",
        ...
   "isInternetConnectionAvailable": false
}

 

Except as noted, this content is licensed under Creative Commons Attribution 4.0 and sample code is licensed under Apache License 2.0.