//
// Generated file, do not edit! Created by opp_msgc 4.1 from src/node/communication/mac/mac802154/Mac802154Packet.msg.
//

#ifndef _MAC802154PACKET_M_H_
#define _MAC802154PACKET_M_H_

#include <omnetpp.h>

// opp_msgc version check
#define MSGC_VERSION 0x0401
#if (MSGC_VERSION!=OMNETPP_VERSION)
#    error Version mismatch! Probably this file was generated by an earlier version of opp_msgc: 'make clean' should help.
#endif

// cplusplus {{
#include "MacPacket_m.h"
// }}



/**
 * Enum generated from <tt>src/node/communication/mac/mac802154/Mac802154Packet.msg</tt> by opp_msgc.
 * <pre>
 * enum MAC802154Packet_type {
 * 	MAC_802154_BEACON_PACKET = 1001;
 * 	MAC_802154_ASSOCIATE_PACKET = 1002;
 * 	MAC_802154_DATA_PACKET = 1003;
 * 	MAC_802154_ACK_PACKET = 1004;
 * 	MAC_802154_GTS_REQUEST_PACKET = 1005;
 * }
 * </pre>
 */
enum MAC802154Packet_type {
    MAC_802154_BEACON_PACKET = 1001,
    MAC_802154_ASSOCIATE_PACKET = 1002,
    MAC_802154_DATA_PACKET = 1003,
    MAC_802154_ACK_PACKET = 1004,
    MAC_802154_GTS_REQUEST_PACKET = 1005
};

/**
 * Struct generated from src/node/communication/mac/mac802154/Mac802154Packet.msg by opp_msgc.
 */
struct GTSspec
{
    GTSspec();
    int owner;
    int start;
    int length;
};

void doPacking(cCommBuffer *b, GTSspec& a);
void doUnpacking(cCommBuffer *b, GTSspec& a);

/**
 * Class generated from <tt>src/node/communication/mac/mac802154/Mac802154Packet.msg</tt> by opp_msgc.
 * <pre>
 * packet Mac802154Packet extends MacPacket {
 * 	int Mac802154PacketType enum (MAC802154Packet_type);
 * 	int PANid;
 * 	int srcID;
 * 	int dstID;
 * 
 * 	
 * 	int beaconOrder;
 * 	int frameOrder;
 * 	int BSN;
 * 	int CAPlength;
 * 	int GTSlength;
 * 	GTSspec GTSlist[];
 * }
 * </pre>
 */
class Mac802154Packet : public ::MacPacket
{
  protected:
    int Mac802154PacketType_var;
    int PANid_var;
    int srcID_var;
    int dstID_var;
    int beaconOrder_var;
    int frameOrder_var;
    int BSN_var;
    int CAPlength_var;
    int GTSlength_var;
    ::GTSspec *GTSlist_var; // array ptr
    unsigned int GTSlist_arraysize;

    // protected and unimplemented operator==(), to prevent accidental usage
    bool operator==(const Mac802154Packet&);

  public:
    Mac802154Packet(const char *name=NULL, int kind=0);
    Mac802154Packet(const Mac802154Packet& other);
    virtual ~Mac802154Packet();
    Mac802154Packet& operator=(const Mac802154Packet& other);
    virtual Mac802154Packet *dup() const {return new Mac802154Packet(*this);}
    virtual void parsimPack(cCommBuffer *b);
    virtual void parsimUnpack(cCommBuffer *b);

    // field getter/setter methods
    virtual int getMac802154PacketType() const;
    virtual void setMac802154PacketType(int Mac802154PacketType_var);
    virtual int getPANid() const;
    virtual void setPANid(int PANid_var);
    virtual int getSrcID() const;
    virtual void setSrcID(int srcID_var);
    virtual int getDstID() const;
    virtual void setDstID(int dstID_var);
    virtual int getBeaconOrder() const;
    virtual void setBeaconOrder(int beaconOrder_var);
    virtual int getFrameOrder() const;
    virtual void setFrameOrder(int frameOrder_var);
    virtual int getBSN() const;
    virtual void setBSN(int BSN_var);
    virtual int getCAPlength() const;
    virtual void setCAPlength(int CAPlength_var);
    virtual int getGTSlength() const;
    virtual void setGTSlength(int GTSlength_var);
    virtual void setGTSlistArraySize(unsigned int size);
    virtual unsigned int getGTSlistArraySize() const;
    virtual GTSspec& getGTSlist(unsigned int k);
    virtual const GTSspec& getGTSlist(unsigned int k) const {return const_cast<Mac802154Packet*>(this)->getGTSlist(k);}
    virtual void setGTSlist(unsigned int k, const GTSspec& GTSlist_var);
};

inline void doPacking(cCommBuffer *b, Mac802154Packet& obj) {obj.parsimPack(b);}
inline void doUnpacking(cCommBuffer *b, Mac802154Packet& obj) {obj.parsimUnpack(b);}


#endif // _MAC802154PACKET_M_H_
