handedness (GET)
Get the handedness result (left / right).
ip (SET/GET)
Read and write the device’s static IP address. set writes the new IP to the device’s flash. The firmware doesn’t hot-swap the running Ethernet stack, so the new IP takes effect only after the next reboot. Between set and reboot, get still returns the current IP.
The IP must be unique on the subnet. Avoid addresses already used by other devices or the host network adapter.
Changing the IP takes four steps: set the new address, reboot the device, reconnect at the new IP, and get to confirm.
The new IP takes effect only after a reboot. set writes to flash without changing the live connection. Before the reboot, get still returns the current IP.
port (SET/GET)
Read and write the device’s data port, the UDP port the hand accepts SDK connections on. The factory default is 50001. Changing the port requires recent firmware and Wuji SDK. Upgrade both to the latest version first. Firmware earlier than v2.10.0 allows reads only and rejects writes with an error.
set saves the new port, and the device switches to that port after the next reboot. The saved port persists across power loss. Unlike ip, get returns the new port as soon as set succeeds, which is the port the device uses after its next reboot.
Valid ports are 10000–65535, except the discovery port 50000. A port outside that range, or 50000, makes set raise WujiException (the message contains Invalid argument), and the port keeps its current value. Writes also fail while the device is upgrading firmware. Retry after the upgrade finishes.
To change the port:
- Call
hand.port().set() to write the new port.
- Call
hand.reboot() to restart the device.
- Reconnect to the device on the new port.
- Call
hand.port().get() to confirm the port.
Connections made through auto_connect, sn, or handedness pick up the new port from device discovery, so the connection code stays the same. For connections by address, change the port in the address. Example:
The new port takes effect only after a reboot. Until then, the device keeps communicating on the current port. If your computer runs a firewall, allow UDP traffic on the new port before the reboot.
reboot (EXEC)
Reboot the device. The device disconnects and needs a fresh connection. Pair it with ip().set() or port().set() to apply a newly saved IP or port.
Enable / Disable / Emergency Stop
clear_fault (EXEC)
Clear faults: a direct action. Without arguments it acts on the whole hand.
The C API matches the Python API on this page and uses the wuji_hand_2_ prefix. For initialization conventions, memory management, error codes, and build setup, see the C API Reference.
Control Actions (With 20-Joint Mask)
enable / disable / clear_fault / set_origin / clear_origin accept an optional const uint8_t mask[20]. Pass NULL to act on every joint. emergency_stop only acts on the whole hand and accepts no mask:
Data Port
wuji_hand_2_get_port reads the data port (the UDP port the device accepts SDK connections on, 50001 by factory default), and wuji_hand_2_set_port saves a new port. Changing the port requires recent Wuji Hand 2 firmware and Wuji SDK. Upgrade both to the latest version first.
The new port takes effect after the device reboots and persists across power loss. Once wuji_hand_2_set_port succeeds, wuji_hand_2_get_port returns the new port right away. Valid ports are 10000–65535, except the discovery port 50000. An out-of-range port makes wuji_hand_2_set_port return a status other than WUJI_STATUS_OK, with Invalid argument in wuji_last_error(), and the port keeps its current value. Firmware earlier than v2.10.0 doesn’t accept the write and also returns an error status. After the reboot, connections by address need the new port. Connections through device discovery need no change.
Identity and Diagnostics
Write the IP with wuji_hand_2_set_ip(dev, "192.168.1.201") and restart the device with wuji_hand_2_reboot(dev). Both take effect exactly as the Python calls do.
get_hw_version / get_comm_diag return an out struct with heap-owned fields. Release with the matching _free function after use (only when the call returned WUJI_STATUS_OK).