asyncapi: 2.6.0
info:
  title: SmartActuator
  version: 2.0.0
  description: Servo actuator protocol with CRC32 integrity checking and status reporting
  contact:
    name: Motion Control Systems
servers:
  serial_link:
    url: serial://tty/921600
    protocol: serial
    description: Physical UART Transport (921600 bps, 8N1.0)
    bindings:
      serial:
        baudRate: 921600
        dataBits: 8
        parity: none
        stopBits: 1.0
        framingType: binary
        integrity: crc32
channels:
  omniuart/cmd/set_position:
    publish:
      summary: 'Send command set_position (ID: 0x1001)'
      description: Sets servo angular position and maximum velocity
      message:
        name: set_position_Message
        title: set_position Command
        payload:
          $ref: '#/components/schemas/set_position_Request'
  omniuart/resp/set_position:
    subscribe:
      summary: Receive response for set_position
      description: Decoded async payload stream from device after command set_position
      message:
        name: set_position_Response_Message
        title: set_position Response
        payload:
          $ref: '#/components/schemas/set_position_Response'
components:
  messages: {}
  schemas:
    set_position_Request:
      type: object
      properties:
        command_id:
          type: integer
          const: 4097
          description: Opcode ID for set_position
        channel:
          type: integer
          minimum: 0.0
          maximum: 7.0
          default: 0
        angle_degrees:
          type: number
          unit: deg
          minimum: 0.0
          maximum: 360.0
          default: 90.0
        velocity_limit:
          type: integer
          unit: rpm
          default: 1000
      description: Sets servo angular position and maximum velocity
    set_position_Response:
      type: object
      properties:
        channel:
          type: integer
        current_position:
          type: number
          unit: deg
        status_flags:
          type: integer
      description: Decoded response frame payload for set_position
