luna-send Usage Guide

Caution
webOS IoT is ONLY supported from webOS OSE 2.4.0 to webOS OSE 2.18.0. We plan to replace webOS IoT with Matter in the future release.

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).

Note
To access the device shell, you must connect to the device using the Secure Shell (SSH) protocol. For more details, see Network Setup.

Syntax

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

Options

OptionParameterDescription

-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 formatted JSON.

-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

ParameterDescription

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.enactbrowser” by calling launch method.

$ luna-send -n 1 -f luna://com.webos.service.applicationmanager/launch '{"id":"com.webos.app.enactbrowser"}'

{
    "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
}

Contents