Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-developer:ubus [2016/10/27 06:20] – ↷ Page moved from docs:config:ubus to docs:guide-developer:ubus bobafetthotmail | docs:guide-developer:ubus [2020/01/11 13:16] (current) – removed duplicated description stokito | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== uBus - IPC/RPC ===== | ===== uBus - IPC/RPC ===== | ||
| - | uBus is the interconnect system used by most services running on a //LEDE// setup. Services can connect to the bus and provide methods that can be called by other services or clients. | + | uBus is the interconnect system used by most services running on a //OpenWrt// setup. Services can connect to the bus and provide methods that can be called by other services or clients. |
| - | There is a CLI that can be used to communicate with services on the bus. | + | See [[docs: |
| - | < | ||
| - | root@lede:/# | ||
| - | Usage: ubus [< | ||
| - | Options: | ||
| - | -s < | ||
| - | -t < | ||
| - | -S: Use simplified output (for scripts) | ||
| - | -v: More verbose output | ||
| - | Commands: | ||
| - | - list [< | ||
| - | - call < | ||
| - | - listen [< | ||
| - | - send < | ||
| - | - wait_for < | ||
| - | </ | ||
| + | ====Reference documentation for ubus==== | ||
| - | To find out which services are currently running on the bus simply use the list command. This will show a complete list. | + | **Path only contains |
| - | + | ||
| - | + | ||
| - | < | + | |
| - | root@lede:/# | + | |
| - | dhcp | + | |
| - | log | + | |
| - | network | + | |
| - | network.device | + | |
| - | network.interface | + | |
| - | network.interface.loopback | + | |
| - | network.interface.wan | + | |
| - | network.interface.wan6 | + | |
| - | network.wireless | + | |
| - | service | + | |
| - | system | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | To find out which methods a specific service provides also use the list command but add a few more parameters to see a complete list | + | |
| - | + | ||
| - | + | ||
| - | < | + | |
| - | root@OpenWrt:/# | + | |
| - | ' | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | You can now call a remote method and receive a reply. A reply may be a simple integer return code or a more complete reply. Internally the bus uses a blob format, the CLI conveniently converts this to JSON. | + | |
| - | + | ||
| - | + | ||
| - | < | + | |
| - | root@lede:/# | + | |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | } | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | You can call a method and pass it some parameters by simply appending a JSON structure to the CLI command. | + | |
| - | + | ||
| - | + | ||
| - | < | + | |
| - | root@lede:/# | + | |
| - | root@lede:/# | + | |
| - | 0 | + | |
| - | </ | + | |
| + | ^ path ^ Description ^ Package ^ | ||
| + | | [[docs: | ||
| + | | [[docs: | ||
| + | | [[docs: | ||
| + | | [[docs: | ||
| + | | [[docs: | ||
| + | | [[docs: | ||
| + | | [[docs: | ||
| + | | [[docs: | ||
| + | | [[docs: | ||
| + | | [[docs: | ||
| + | | [[docs: | ||