Skip to content

feat(communication): add MQTTLite protocol#33

Merged
ttwards merged 7 commits into
masterfrom
refactor/motor-controller-header
Jul 7, 2026
Merged

feat(communication): add MQTTLite protocol#33
ttwards merged 7 commits into
masterfrom
refactor/motor-controller-header

Conversation

@ttwards

@ttwards ttwards commented Jul 7, 2026

Copy link
Copy Markdown
Owner

概要

  • Add MQTTLite, a lightweight ARES publish/subscribe protocol with QoS0/1/2, topic-id registration, and a QoS0 zero-copy publish path.
  • Align ARES USB/UART transport callbacks around send_with_callback(), caps(), and mtu(); update Dual protocol send completion handling.
  • Require explicit motor CAN scheduler priorities by removing the boolean motor_can_sched_send_prio() helper and updating motor drivers to use MOTOR_CAN_SCHED_PRIO_CRITICAL.
  • This branch is long-running and also includes the existing motor/controller/docs/board/native_sim work already present on refactor/motor-controller-header.

测试

  • git diff --check
  • west twister -T tests/native_sim/motor_driver_sim --platform native_sim/native/64 --inline-logs
  • west twister -T tests/native_sim/mqttlite --platform native_sim/native/64 --inline-logs
  • west twister -T tests/native_sim/module_smoke --platform native_sim/native/64 --inline-logs
  • west build -b dm_mc02 samples/communication/mqttlite_usb --pristine
  • west build -b robomaster_board_c samples/communication/ares_communication --pristine

硬件

  • 未进行硬件刷写或实机验证。

影响

  • ARES interface API changes from the old send_with_lock() model to TX completion callbacks and capability/MTU queries.
  • MQTTLite payloads are variable length and bounded by CONFIG_ARES_MQTTLITE_MAX_PAYLOAD_SIZE.
  • Motor CAN callers now express critical priority explicitly through motor_can_sched_send_with_priority().

限制

  • The ares_communication local build still reports the existing CAN_COUNT/MOTOR=n Kconfig warning; the build completes successfully.

ttwards added 7 commits July 6, 2026 18:05
Replace the old USB send-with-lock transport hook with TX completion callbacks, add transport capability metadata, and keep USB/UART callback semantics aligned for Dual protocol sends.

Validation: git diff --check; west build -b robomaster_board_c samples/communication/ares_communication --pristine; west build -b dm_mc02 samples/communication/mqttlite_usb --pristine; west twister -T tests/native_sim/mqttlite --platform native_sim/native/64 --inline-logs; west twister -T tests/native_sim/module_smoke --platform native_sim/native/64 --inline-logs.
Remove the boolean motor_can_sched_send_prio() wrapper and route high-priority motor control frames through motor_can_sched_send_with_priority() with MOTOR_CAN_SCHED_PRIO_CRITICAL.

Validation: git diff --cached --check; west twister -T tests/native_sim/motor_driver_sim --platform native_sim/native/64 --inline-logs.
Update the communication references for send_with_callback(), transport capability queries, and buffer ownership rules after the USB/UART interface callback update.
Add a lightweight MQTT-like publish/subscribe protocol for ARES interfaces with QoS0/1/2, topic-id registration, and a QoS0 zero-copy publish path.

Also add a USB bulk sample, native_sim coverage, protocol Kconfig/CMake integration, and documentation for variable-length payloads and topic-id fast paths.

Validation: git diff --cached --check; west twister -T tests/native_sim/mqttlite --platform native_sim/native/64 --inline-logs; west build -b dm_mc02 samples/communication/mqttlite_usb --pristine.
Resolve ARES communication documentation conflicts and bring in the latest master UART USART1 validation updates before updating the PR.

Validation: git diff --check; west twister -T tests/native_sim/mqttlite --platform native_sim/native/64 --inline-logs; west twister -T tests/native_sim/ares_communication --platform native_sim/native/64 --inline-logs; west build -b robomaster_board_c samples/communication/ares_communication --pristine; west build -b dm_mc02 samples/communication/mqttlite_usb --pristine.
@ttwards
ttwards marked this pull request as ready for review July 7, 2026 17:51
@ttwards
ttwards merged commit a175530 into master Jul 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant