Roarm.Communication (RoArm v0.1.1)

View Source

UART communication module for Waveshare RoArm robot arms.

Handles serial communication using Circuits.UART, providing a clean interface for sending commands and receiving responses from RoArm devices.

Summary

Functions

Returns a specification to start this module under a supervisor.

Open connection to the robot arm.

Check if connection is active.

Disconnect from the robot arm.

List available serial ports.

Send a command to the robot and wait for response.

Send raw data to the robot without waiting for response.

Start the communication GenServer.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

connect(port, opts \\ [])

Open connection to the robot arm.

connected?(opts \\ [])

Check if connection is active.

disconnect(opts \\ [])

Disconnect from the robot arm.

list_ports()

List available serial ports.

send_command(command, opts \\ [])

Send a command to the robot and wait for response.

send_raw(data, opts \\ [])

Send raw data to the robot without waiting for response.

start_link(opts \\ [])

Start the communication GenServer.

Options

  • :name - Process name for registry (default: MODULE)
  • :port - Serial port path (e.g., "/dev/ttyUSB0", "COM3")
  • :baudrate - Communication speed (default: from config or 115200)
  • :timeout - Response timeout in milliseconds (default: from config or 5000)