メインコンテンツ

sendserialmsg

R2026b

Send MAVLink message to serial port

Since R2026b

    Description

    sendserialmsg(mavlink,msg,portName) sends the message msg from the local MAVLink client mavlink to the serial port portName.

    Input Arguments

    collapse all

    Local MAVLink client, specified as a mavlinkio object.

    MAVLink message, specified as a structure with these fields:

    • MsgID — Message ID, specified as a positive integer.

    • Payload — Message definition, specified as a structure.

    Tip

    To create a blank message, use the createmsg object function of the mavlinkdialect object.

    Serial port name, specified as a character vector or string scalar.

    Tip

    • Before sending a message, you must connect the MAVLink client to the serial port by using the connect function.

    • To see which serial ports the MAVLink client is connected to, use the listConnections function.

    Example: "COM2"

    Data Types: char | string

    Version History

    Introduced in R2026b