Skip to content

Conversation

@cmaglie
Copy link
Member

@cmaglie cmaglie commented Nov 25, 2025

Motivation

Adding a tool to ease the debugging of RPC clients.

Change description

This PR adds a new tool called arduino-router-client.

$ ./arduino-router-client  -h
Send a MsgPack RPC REQUEST or NOTIFICATION.

Usage:
  ./arduino-router-client [flags] <METHOD> [<ARG> [<ARG> ...]]

Send REQUEST:      ./arduino-router-client [-s server_addr]    <METHOD> [<ARG> [<ARG> ...]]
Send NOTIFICATION: ./arduino-router-client [-s server_addr] -n <METHOD> [<ARG> [<ARG> ...]]

  <METHOD> is the method name to request/notify,
  <ARG> are the arguments to pass to the method:
      - Use 'true', 'false' for boolean
      - Use 'null' for null.
      - Use integer values directly (e.g., 42).
      - Use the 'f32:' or 'f64:' prefix for floating point values (e.g. f32:3.14159).
      - Use '[' and ']' to start and end an array.
      - Use '{' and '}' to start and end a map.
        Keys and values should be listed in order { KEY1 VAL1 KEY2 VAL2 }.
      - Any other value is treated as a string, or you may use the 'str:' prefix
        explicitly in case of ambiguity (e.g. str:42)

Flags:
  -h, --help            help for ./arduino-router-client
  -n, --notification    Send a NOTIFICATION instead of a CALL
  -s, --server string   Server address (file path for unix socket) (default "/var/run/arduino-router.sock")

some usage examples:

$ ./arduino-router-client ping { a [ 1 2 b ] c d }
Sending parameters:
- a:
    - 1
    - 2
    - b
  c: d
Got RPC response:
- a:
    - 1
    - 2
    - b
  c: d
$ ./arduino-router-client ping { version 2.15.3-rc.1 name Max surname Mad }
Sending parameters:
- name: Max
  surname: Mad
  version: 2.15.3-rc.1
Got RPC response:
- name: Max
  surname: Mad
  version: 2.15.3-rc.1
$ ./arduino-router-client $/version 
Sending parameters:
[]
Got RPC response:
0.0.0-dev

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@cmaglie cmaglie self-assigned this Nov 25, 2025
@cmaglie cmaglie added the enhancement New feature or request label Nov 25, 2025
@lucarin91 lucarin91 linked an issue Nov 26, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add an arduino-router-cli for sending message to the router

1 participant