Difference between revisions of "Luna Send"

From WebOS Internals
Jump to navigation Jump to search
(New page: NOTE: You have to run with root perms. Using luna-send to refresh the Launcher panel. <pre><nowiki> luna-send -n 1 palm://com.palm.applicationManager/rescan {} </nowiki></pre> Get a list...)
 
 
(31 intermediate revisions by 13 users not shown)
Line 1: Line 1:
NOTE: You have to run with root perms.
+
webOS applications may have backend components (that may not be implementable in JavaScript, or require extra hardware processing of native language) that are accessed through the <tt>Mojo.Service</tt> API. The browser engine delegates these calls from JavaScript to the backend components through a message bus infrastructure, like D-Bus.
 +
 
 +
With root permissions, the end user may be able to interact with the backends directly with the <tt>luna-send</tt> utility.
 +
 
 +
== Implementation ==
 +
=== webOS 1.x ===
 +
For example, the following JavaScript fragment:
 +
<pre>
 +
Mojo.Service.Request("palm://com.palm.systemservice/time", { method: "getSystemTime", onSuccess: callback });
 +
</pre>
 +
 
 +
corresponds to
 +
 
 +
<pre>
 +
luna-send -n 1 palm://com.palm.systemservice/time/getSystemTime {}
 +
</pre>
 +
 
 +
Since these are all effectively D-Bus calls, a <tt>luna-send</tt> call can be made equivalently with <tt>dbus-send</tt>, for example, the two commands below yield the same result:
 +
 
 +
<pre>
 +
luna-send -n 1 palm://com.palm.systemservice/time/getSystemTime {}
 +
dbus-send --system --type=method_call --print-reply --dest=com.palm.systemservice /time org.json.getSystemTime string:"{}"
 +
</pre>
 +
 
 +
=== webOS 2.x ===
 +
webOS 2.x does away with the standard dbus daemon and uses a similar, but ultimately proprietary message bus infrastructure, not based on D-Bus. It maintains the notion of a private and public bus like D-Bus, but is instead served by <tt>ls-hubd</tt>, which does not link against D-Bus but instead against <tt>liblunaservice.so</tt>.
 +
 
 +
The <tt>luna-send</tt> interface is the same, however.
 +
 
 +
 
 +
== Examples ==
 +
Install all your purchased apps:
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.service.backup/scheduleAppRestore '{}'
 +
luna-send -n 1 palm://com.palm.service.backup/restoreApps '{}'
 +
</nowiki></pre>
 +
 
 +
 
 +
Kick off a manual Palm Backup entirely from the command line:
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.applicationManager/launch '{"id":"com.palm.app.backup"}'
 +
luna-send -n 1 palm://com.palm.backup/startBackup '{}'
 +
luna-send -n 1 palm://com.palm.applicationManager/running '{}'
 +
luna-send -n 1 palm://com.palm.applicationManager/close '{"processId":"(GET ID NUMBER FROM /RUNNING)"}'
 +
</nowiki></pre>
 +
 
 +
 
 +
Connect to any (known) WAP in range (or simply turn on WiFi):
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.wifi/setstate '{"state":"enabled"}'
 +
luna-send -n 1 palm://com.palm.wifi/findnetworks '{""}'
 +
</nowiki></pre>
 +
 
 +
 
 +
Disconnect from WiFi:
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.wifi/setstate '{"state":"disabled"}'
 +
</nowiki></pre>
 +
 
 +
Turn Bluetooth ON:
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.btmonitor/monitor/radioon '{"visible":true, "connectable":true}'
 +
</nowiki></pre>
 +
 
 +
Turn Bluetooth OFF:
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.btmonitor/monitor/radiooff {}
 +
</nowiki></pre>
  
 
Using luna-send to refresh the Launcher panel.
 
Using luna-send to refresh the Launcher panel.
Line 5: Line 72:
 
luna-send -n 1 palm://com.palm.applicationManager/rescan {}
 
luna-send -n 1 palm://com.palm.applicationManager/rescan {}
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Get a list of all installed apps:
 
Get a list of all installed apps:
Line 10: Line 78:
 
luna-send -n 1 "palm://com.palm.applicationManager/listLaunchPoints" "{}"
 
luna-send -n 1 "palm://com.palm.applicationManager/listLaunchPoints" "{}"
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
Using luna-send to launch an application:
 
Using luna-send to launch an application:
Line 16: Line 85:
 
luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.browser\",\"params\":{\"scene\":\"page\",\"target\":\"http://www.google.com\"}}
 
luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.browser\",\"params\":{\"scene\":\"page\",\"target\":\"http://www.google.com\"}}
 
</nowiki></pre>
 
</nowiki></pre>
 +
  
 
The second command shows how to open www.google.com when the browser is launched.
 
The second command shows how to open www.google.com when the browser is launched.
Line 25: Line 95:
  
 
Replace www.google.com/index.html with whatever file you want downloaded.
 
Replace www.google.com/index.html with whatever file you want downloaded.
 +
 +
 +
Using luna-send to first import and then set the wallpaper image:
 +
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.systemservice/wallpaper/importWallpaper {"target": "/media/internal/wallpapers/your_file.jpg" }
 +
luna-send -n 1 palm://com.palm.systemservice/setPreferences {"wallpaper": {"wallpaperName": "your_file.jpg", "wallpaperFile": "/media/internal/wallpapers/your_file.jpg"}}
 +
</nowiki></pre>
 +
 +
Replace your_file.jpg with whatever file in the wallpapers folder you want for your next wallpaper.
 +
  
 
Using luna-send to control the palm progress animation (The pulsing "palm" logo seen at boot):
 
Using luna-send to control the palm progress animation (The pulsing "palm" logo seen at boot):
Line 34: Line 115:
  
 
TODO: These should probably be plugged into the Tracker app.
 
TODO: These should probably be plugged into the Tracker app.
 +
  
 
<pre><nowiki>
 
<pre><nowiki>
Line 41: Line 123:
 
</nowiki></pre>
 
</nowiki></pre>
  
Interesting note:
+
 
 +
List all of the processes which are running:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo luna-send -n 1 palm://com.palm.applicationManager/running {}
 
sudo luna-send -n 1 palm://com.palm.applicationManager/running {}
 
** Message: serviceResponse Handling: 2, { "running": [ { "id": "com.palm.launcher", "processid": "1006" }, { "id": "com.palm.systemui", "processid": "1007" }, { "id": "com.palm.app.email", "processid": "1000" }, { "id": "com.palm.app.phone", "processid": "1001" }, { "id": "com.palm.app.contacts", "processid": "1002" }, { "id": "com.palm.app.camera", "processid": "1003" }, { "id": "com.palm.app.messaging", "processid": "1004" }, { "id": "com.palm.app.calendar", "processid": "1005" }, { "id": "com.palm.app.phone", "processid": "1008" }, { "id": "com.palm.app.camera", "processid": "1014" } ] }
 
** Message: serviceResponse Handling: 2, { "running": [ { "id": "com.palm.launcher", "processid": "1006" }, { "id": "com.palm.systemui", "processid": "1007" }, { "id": "com.palm.app.email", "processid": "1000" }, { "id": "com.palm.app.phone", "processid": "1001" }, { "id": "com.palm.app.contacts", "processid": "1002" }, { "id": "com.palm.app.camera", "processid": "1003" }, { "id": "com.palm.app.messaging", "processid": "1004" }, { "id": "com.palm.app.calendar", "processid": "1005" }, { "id": "com.palm.app.phone", "processid": "1008" }, { "id": "com.palm.app.camera", "processid": "1014" } ] }
 
</nowiki></pre>
 
</nowiki></pre>
 +
Interesting note:
 
Seems everything with a processid below 1008 are static.  As seen above, open camera app has pid 1014 and startup app is pid 1003
 
Seems everything with a processid below 1008 are static.  As seen above, open camera app has pid 1014 and startup app is pid 1003
 +
 +
 +
Close a process:
 +
 +
<pre><nowiki>
 +
luna-send -n 1 "palm://com.palm.applicationManager/close" "{\"processId\":\"1058\"}"
 +
</nowiki></pre>
 +
 +
 +
Activate the vibrator:
 +
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.vibrate/vibrate {\"period\":1,\"duration\":1000\}
 +
</nowiki></pre>
 +
The duration value is in milliseconds and can be adjusted as desired.
 +
 +
 +
Photos Info - list album and image from mediadb.db3:
 +
 +
<pre><nowiki>
 +
luna-send -n 1 luna://com.palm.mediadb/image/listalbums {}
 +
</nowiki></pre>
 +
 +
<pre><nowiki>
 +
luna-send -n 1 luna://com.palm.mediadb/image/listimages {}
 +
</nowiki></pre>
 +
 +
 +
Set system volume - "volume" range is 0-100
 +
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.audio/system/setVolume '{"volume":80}'
 +
</nowiki></pre>
 +
 +
 +
Set media volume - "volume" range is 0-100
 +
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.audio/media/setVolume '{"volume":80}'
 +
</nowiki></pre>
 +
 +
 +
Set ringtone volume - "volume" range is 0-100
 +
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.audio/ringtone/setVolume '{"volume":100}'
 +
</nowiki></pre>
 +
 +
 +
Dial a number - this actually calls the number, not just setup
 +
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.telephony/dial '{"number":"8001234567"}'
 +
</nowiki></pre>
 +
 +
 +
Hash command RTN: ##RTN# aka ##786# commands using Luna-Send (Becarful Palm calls this Nuking your phone and do not remove battery when using
 +
 +
<pre><nowiki>
 +
luna-send -n 1 luna://com.palm.telephony/radioDefaultsRestore {}
 +
</nowiki></pre>
 +
<pre><nowiki>
 +
luna-send -n 1 luna://com.palm.telephony/resetRadio {}
 +
</nowiki></pre>
 +
<pre><nowiki>
 +
luna-send -n 1 luna://com.palm.storage/erase/EraseAll {}
 +
</nowiki></pre>
 +
 +
 +
Hang up a phone call :-) There are ways to end specific types of calls but I think this is good enough for now. Let me know if you want the other methods.
 +
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.telephony/hangupAll {}
 +
</nowiki></pre>
 +
 +
 +
Send a text message - only need to change phone "value" and "messageText"
 +
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.messaging/sendMessageFromCompose '{"recipientJSONArray": [{"lastName": "", "pictureLoc": "", "contactCount": 1, "displayText": "", "firstName": "", "pictureLocBig": "", "imAvailability": 6, "pictureLocSquare": "", "contactDisplay": "", "Person_id": "", "personId": "", "type": "phone", "value": "8165551234", "alreadyValidated": true, "prefix": "to$A", "identifier": ""}], "messageText": "Content of message here"}'
 +
</nowiki></pre>
 +
 +
 +
set phone to no roam (home network only)
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"homeonly"}'
 +
</nowiki></pre>
 +
 +
 +
set phone to auto roam
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"any"}'
 +
</nowiki></pre>
 +
 +
 +
set phone to roam only
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"roamonly"}'
 +
</nowiki></pre>
 +
 +
 +
===Applications===
 +
 +
Notes (view notes):
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.notes/getNotes {}
 +
</nowiki></pre>
 +
 +
 +
==Storage==
 +
 +
Enter usb storage mode:
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.storage/diskmode/enterMSM {\"user-confirmed\":true,\"enterIMasq\":false}
 +
</nowiki></pre>
 +
 +
 +
Exit usb storage mode (toggle):
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.storage/diskmode/enterMSM {\"user-confirmed\":true,\"enterIMasq\":false}
 +
</nowiki></pre>
 +
 +
==Airplane Mode==
 +
 +
Enable Airplane Mode:
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.systemservice/setPreferences '{"airplaneMode":true}'
 +
</nowiki></pre>
 +
 +
 +
Disable Airplane Mode:
 +
<pre><nowiki>
 +
luna-send -n 1 palm://com.palm.systemservice/setPreferences '{"airplaneMode":false}'
 +
</nowiki></pre>
 +
 +
== Searching for services ==
 +
 +
As mentioned above, since <tt>Mojo.Service.Request</tt> (or, equivalently, through the scene controller's <tt>serviceRequest</tt> method) make use of D-Bus, we can use two methods to determine what external calls can be made to their backend components
 +
 +
=== By examining JavaScript source ===
 +
 +
Simply grep through the application for <tt>Mojo.Service.Request</tt> or <tt>serviceRequest</tt> calls and note how they are invoked. They then can be adapted to use <tt>luna-send</tt>.
 +
 +
=== By examining dbus traffic directly ===
 +
 +
There are some tools available to trace D-Bus calls happening as the application is running, such as <tt>dbus-monitor</tt> or <tt>dbus-util</tt>.
 +
 +
==== Example ====
 +
To determine what governs roaming mode capability, we may do the following.
 +
<pre>
 +
# dbus-util --capture 2>&1 |tee /tmp/dbus.dump
 +
# grep roam /tmp/dbus.dump
 +
  com.palm.luna2  com.palm.telephony      //roamModeSet  «string=â{"mode": "homeonly"}
 +
</pre>
 +
 +
From this we see:
 +
* <tt>com.palm.telephony</tt> is the service
 +
* <tt>roamModeSet<tt> is the method
 +
* <tt>{ mode: "homeonly" }</tt> is the parameter
 +
 +
Thus:
 +
</pre>
 +
luna-send -n 1 palm://com.palm.telephony/roamModeSet '{"mode":"homeonly"}'
 +
</pre>
 +
 +
would perform the same function from the command line.

Latest revision as of 11:26, 13 June 2013

webOS applications may have backend components (that may not be implementable in JavaScript, or require extra hardware processing of native language) that are accessed through the Mojo.Service API. The browser engine delegates these calls from JavaScript to the backend components through a message bus infrastructure, like D-Bus.

With root permissions, the end user may be able to interact with the backends directly with the luna-send utility.

Implementation

webOS 1.x

For example, the following JavaScript fragment:

Mojo.Service.Request("palm://com.palm.systemservice/time", { method: "getSystemTime", onSuccess: callback });

corresponds to

luna-send -n 1 palm://com.palm.systemservice/time/getSystemTime {}

Since these are all effectively D-Bus calls, a luna-send call can be made equivalently with dbus-send, for example, the two commands below yield the same result:

luna-send -n 1 palm://com.palm.systemservice/time/getSystemTime {}
dbus-send --system --type=method_call --print-reply --dest=com.palm.systemservice /time org.json.getSystemTime string:"{}"

webOS 2.x

webOS 2.x does away with the standard dbus daemon and uses a similar, but ultimately proprietary message bus infrastructure, not based on D-Bus. It maintains the notion of a private and public bus like D-Bus, but is instead served by ls-hubd, which does not link against D-Bus but instead against liblunaservice.so.

The luna-send interface is the same, however.


Examples

Install all your purchased apps:

luna-send -n 1 palm://com.palm.service.backup/scheduleAppRestore '{}'
luna-send -n 1 palm://com.palm.service.backup/restoreApps '{}'


Kick off a manual Palm Backup entirely from the command line:

luna-send -n 1 palm://com.palm.applicationManager/launch '{"id":"com.palm.app.backup"}'
luna-send -n 1 palm://com.palm.backup/startBackup '{}'
luna-send -n 1 palm://com.palm.applicationManager/running '{}'
luna-send -n 1 palm://com.palm.applicationManager/close '{"processId":"(GET ID NUMBER FROM /RUNNING)"}'


Connect to any (known) WAP in range (or simply turn on WiFi):

luna-send -n 1 palm://com.palm.wifi/setstate '{"state":"enabled"}'
luna-send -n 1 palm://com.palm.wifi/findnetworks '{""}'


Disconnect from WiFi:

luna-send -n 1 palm://com.palm.wifi/setstate '{"state":"disabled"}'

Turn Bluetooth ON:

luna-send -n 1 palm://com.palm.btmonitor/monitor/radioon '{"visible":true, "connectable":true}'

Turn Bluetooth OFF:

luna-send -n 1 palm://com.palm.btmonitor/monitor/radiooff {}

Using luna-send to refresh the Launcher panel.

luna-send -n 1 palm://com.palm.applicationManager/rescan {}


Get a list of all installed apps:

luna-send -n 1 "palm://com.palm.applicationManager/listLaunchPoints" "{}"


Using luna-send to launch an application:

luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.browser\"}
luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.browser\",\"params\":{\"scene\":\"page\",\"target\":\"http://www.google.com\"}}


The second command shows how to open www.google.com when the browser is launched.

Using luna-send to download a file to /media/internal/downloads/:

luna-send -n 1 palm://com.palm.downloadmanager/download {\"target\":\"http://www.google.com/index.html\"}  

Replace www.google.com/index.html with whatever file you want downloaded.


Using luna-send to first import and then set the wallpaper image:

luna-send -n 1 palm://com.palm.systemservice/wallpaper/importWallpaper {"target": "/media/internal/wallpapers/your_file.jpg" }
luna-send -n 1 palm://com.palm.systemservice/setPreferences {"wallpaper": {"wallpaperName": "your_file.jpg", "wallpaperFile": "/media/internal/wallpapers/your_file.jpg"}}

Replace your_file.jpg with whatever file in the wallpapers folder you want for your next wallpaper.


Using luna-send to control the palm progress animation (The pulsing "palm" logo seen at boot):

luna-send -n 1 palm://com.palm.systemmanager/runProgressAnimation {\"state\":\"start\"}
luna-send -n 1 palm://com.palm.systemmanager/runProgressAnimation {\"state\":\"stop\"}

TODO: These should probably be plugged into the Tracker app.


luna-send -n 1 palm://com.palm.location/setUseGps {\"useGps\":\"true\"}
luna-send -n 1 palm://com.palm.location/setAutoLocate {\"autoLocate\":\"true\"}
luna-send -n 1 palm://com.palm.location/getCurrentPosition {}


List all of the processes which are running:

sudo luna-send -n 1 palm://com.palm.applicationManager/running {}
** Message: serviceResponse Handling: 2, { "running": [ { "id": "com.palm.launcher", "processid": "1006" }, { "id": "com.palm.systemui", "processid": "1007" }, { "id": "com.palm.app.email", "processid": "1000" }, { "id": "com.palm.app.phone", "processid": "1001" }, { "id": "com.palm.app.contacts", "processid": "1002" }, { "id": "com.palm.app.camera", "processid": "1003" }, { "id": "com.palm.app.messaging", "processid": "1004" }, { "id": "com.palm.app.calendar", "processid": "1005" }, { "id": "com.palm.app.phone", "processid": "1008" }, { "id": "com.palm.app.camera", "processid": "1014" } ] }

Interesting note: Seems everything with a processid below 1008 are static. As seen above, open camera app has pid 1014 and startup app is pid 1003


Close a process:

luna-send -n 1 "palm://com.palm.applicationManager/close" "{\"processId\":\"1058\"}"


Activate the vibrator:

luna-send -n 1 palm://com.palm.vibrate/vibrate {\"period\":1,\"duration\":1000\}

The duration value is in milliseconds and can be adjusted as desired.


Photos Info - list album and image from mediadb.db3:

luna-send -n 1 luna://com.palm.mediadb/image/listalbums {}
luna-send -n 1 luna://com.palm.mediadb/image/listimages {}


Set system volume - "volume" range is 0-100

luna-send -n 1 palm://com.palm.audio/system/setVolume '{"volume":80}'


Set media volume - "volume" range is 0-100

luna-send -n 1 palm://com.palm.audio/media/setVolume '{"volume":80}'


Set ringtone volume - "volume" range is 0-100

luna-send -n 1 palm://com.palm.audio/ringtone/setVolume '{"volume":100}'


Dial a number - this actually calls the number, not just setup

luna-send -n 1 palm://com.palm.telephony/dial '{"number":"8001234567"}'


Hash command RTN: ##RTN# aka ##786# commands using Luna-Send (Becarful Palm calls this Nuking your phone and do not remove battery when using

luna-send -n 1 luna://com.palm.telephony/radioDefaultsRestore {} 
luna-send -n 1 luna://com.palm.telephony/resetRadio {}
luna-send -n 1 luna://com.palm.storage/erase/EraseAll {}


Hang up a phone call :-) There are ways to end specific types of calls but I think this is good enough for now. Let me know if you want the other methods.

luna-send -n 1 palm://com.palm.telephony/hangupAll {}


Send a text message - only need to change phone "value" and "messageText"

luna-send -n 1 palm://com.palm.messaging/sendMessageFromCompose '{"recipientJSONArray": [{"lastName": "", "pictureLoc": "", "contactCount": 1, "displayText": "", "firstName": "", "pictureLocBig": "", "imAvailability": 6, "pictureLocSquare": "", "contactDisplay": "", "Person_id": "", "personId": "", "type": "phone", "value": "8165551234", "alreadyValidated": true, "prefix": "to$A", "identifier": ""}], "messageText": "Content of message here"}'


set phone to no roam (home network only)

luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"homeonly"}'


set phone to auto roam

luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"any"}'


set phone to roam only

luna-send -n 1 palm://com.palm.telephony//roamModeSet '{"mode":"roamonly"}'


Applications

Notes (view notes):

luna-send -n 1 palm://com.palm.notes/getNotes {}


Storage

Enter usb storage mode:

luna-send -n 1 palm://com.palm.storage/diskmode/enterMSM {\"user-confirmed\":true,\"enterIMasq\":false}


Exit usb storage mode (toggle):

luna-send -n 1 palm://com.palm.storage/diskmode/enterMSM {\"user-confirmed\":true,\"enterIMasq\":false}

Airplane Mode

Enable Airplane Mode:

luna-send -n 1 palm://com.palm.systemservice/setPreferences '{"airplaneMode":true}'


Disable Airplane Mode:

luna-send -n 1 palm://com.palm.systemservice/setPreferences '{"airplaneMode":false}'

Searching for services

As mentioned above, since Mojo.Service.Request (or, equivalently, through the scene controller's serviceRequest method) make use of D-Bus, we can use two methods to determine what external calls can be made to their backend components

By examining JavaScript source

Simply grep through the application for Mojo.Service.Request or serviceRequest calls and note how they are invoked. They then can be adapted to use luna-send.

By examining dbus traffic directly

There are some tools available to trace D-Bus calls happening as the application is running, such as dbus-monitor or dbus-util.

Example

To determine what governs roaming mode capability, we may do the following.

# dbus-util --capture 2>&1 |tee /tmp/dbus.dump
# grep roam /tmp/dbus.dump
  com.palm.luna2  com.palm.telephony      //roamModeSet   «string=â{"mode": "homeonly"}

From this we see:

  • com.palm.telephony is the service
  • roamModeSet is the method
  • { mode: "homeonly" } is the parameter

Thus:

luna-send -n 1 palm://com.palm.telephony/roamModeSet '{"mode":"homeonly"}'

would perform the same function from the command line.