classdef Structures
%This class is for internal use only. It may be removed in the future.

%STRUCTURES creates struct templates for MAVLink usage

%   Copyright 2018-2020 The MathWorks, Inc.

    methods (Static)

        function output = createMsgExt(count)
        %createMsgExt creates empty message struct with extra
        %information
            output = struct('MsgID', cell(1,count), ...
                            'SystemID', cell(1,count), ...
                            'ComponentID', cell(1,count), ...
                            'Payload', cell(1,count), ...
                            'Seq', cell(1,count));
        end

        function output = createMsg(count)
        %createMsg creates empty message struct
            output = struct('MsgID', cell(1,count), ...
                            'Payload', cell(1,count));
        end

        function output = createPacket()
        %createPacket creates empty MAVLink packet
            output = struct('Checksum', uint16(0), ...
                            'Magic', uint8(0), ...
                            'Length', uint8(0), ...
                            'IncompatFlags', uint8(0), ...
                            'CompatFlags', uint8(0), ...
                            'Seq', uint8(0), ...
                            'SystemID', uint8(0), ...
                            'ComponentID', uint8(0), ...
                            'MsgID', uint32(0), ...
                            'Payload', zeros(1, uav.internal.mavlink.Constants.PayloadSize, 'uint8'), ...
                            'MessageCK', zeros(1, 2, 'uint8'), ...
                            'Signature', zeros(1, uav.internal.mavlink.Constants.SignatureSize, 'uint8'));
        end
    end
end
