Main Content

addChannel

Add MAVLink signing channel

Since R2022a

    Description

    channel = addChannel(stream,sysid,compid,linkid,keyname) adds a new channel channel defined by the system ID sysid, component ID compid, and link ID linkid to MAVLink signing stream stream.

    example

    Examples

    collapse all

    Create a mavlinksigning object to store MAVLink signing channels.

    stream = mavlinksigning;

    Load and list the keys from the keys.env file.

    addmavlinkkeys("keys.env");
    lsmavlinkkeys
    ans = 1x2 string
        "Key1"    "Key2"
    
    

    Add channel with a system ID of 1, component ID of 2, link ID of 3.

    addChannel(stream,1,2,3,"Key1")
    ans = struct with fields:
              Stream: [1x1 mavlinksigning]
            SystemID: 1
         ComponentID: 2
              LinkID: 3
                 Key: "Key1"
           Timestamp: 30549430805844
        CreationTime: 05-Sep-2024 19:31:48
    
    

    Remove the same channel.

    removeChannel(stream,1,2,3)

    Input Arguments

    collapse all

    MAVLink signing stream, specified as a mavlinksigning object.

    System ID, specified as an integer in the range [0, 255].

    Component ID, specified as an integer in the range [0, 255].

    Link ID, specified as an integer in the range [0, 255].

    MAVLink key, specified as a string scalar.

    Output Arguments

    collapse all

    Added channel, returned as a structure containing these fields:

    • Stream — Signing stream, specified by stream.

    • SystemID — System ID, specified by sysid.

    • ComponentID — Component ID, specified by compid.

    • LinkID — Link ID, specified by linkid.

    • Key — Key, specified by keyname.

    • Timestamp — Time passed since 2015-01-01 UTC. Unit is 10 microseconds.

    • CreationTime — Time of creation, specified as a datetime array.

    Version History

    Introduced in R2022a