How do I extract a method list of native services using luna-send?

Is there a way to output a list of methods registered in native, jsservice using luna-send?

plz reply :slight_smile:

Hi @SSo, welcome back!

Try ls-monitor -i .

Examples:

root@raspberrypi4-64:~# ls-monitor -i com.webos.service.ai.voice

METHODS AND SIGNALS REGISTERED BY SERVICE 'com.webos.service.ai.voice' WITH UNIQUE NAME 'vTZ9B0oH' AT HUB

   "/":
       "stop": {"provides":["ai.management","all"]}
       "getResponse": {"provides":["all","ai.voice"]}
       "start": {"provides":["ai.management","all"]}
       "getState": {"provides":["all","ai.voice"]}

See also ls-monitor Usage Guide | webOS Open Source Edition

2 Likes

Yes, there is a way to output a list of methods registered in native, jsservice using luna-send. You can use the following command:

luna-send -c 'dump_services()'

This command will dump all of the services that are registered in the Luna system. The output of this command will include a list of all of the methods that are registered for each service.

For example, the following output shows the list of methods that are registered for the native service:

`services:

  • name: native
    methods:
    • get_version()
    • get_time()
    • get_locale()
    • open_url(url)
    • alert(message)
    • confirm(message)
    • prompt(message, default_value)`

As you can see, the native service has six methods registered: get_version(), get_time(), get_locale(), open_url(), alert(), and confirm().

You can also use the -d flag to output the list of methods in a more detailed format. This will include the name of the method, the parameters that it takes, and the return value.

p.s.When I'm not at work, I like to play video games, and in order not to drag out the process of grinding or farming a boring dungeon, I usually use this service