//
// Copyright (C) 2006 Andras Varga
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, see <http://www.gnu.org/licenses/>.
//

cplusplus {{
#include "inet/common/Units.h"
#include "inet/physicallayer/ieee80211/packetlevel/Ieee80211ControlInfo_m.h"
#include "inet/physicallayer/contract/packetlevel/RadioControlInfo_m.h"
#include "inet/physicallayer/ieee80211/mode/Ieee80211ModeSet.h"
#include "inet/physicallayer/ieee80211/mode/Ieee80211Channel.h"
}}


namespace inet::physicallayer;

class noncobject bps;

class noncobject Ieee80211ChannelPtr;

class ConfigureRadioCommand extends cObject;
class Ieee80211ModeSet extends cObject;
class IIeee80211Band extends cObject;
class IIeee80211Mode extends cObject;
class ReceptionIndication extends cObject;
class TransmissionRequest extends cObject;

//
// Control info attached to a configure command that is sent to the ~Radio.
//
class Ieee80211ConfigureRadioCommand extends ConfigureRadioCommand
{
    @existingClass;
    string opMode;                         // new default operation mode or "" if not set.
    Ieee80211ModeSet *modeSet = nullptr; // new default mode set or nullptr if not set.
    IIeee80211Mode *mode = nullptr;      // new default transmission mode or nullptr if not set.
    IIeee80211Band *band = nullptr;      // new default band or nullptr if not set.
    Ieee80211ChannelPtr channel = nullptr @opaque @tostring($ ? $->getCompleteStringRepresentation() : std::string("<nullptr>")); // new default band and channel or nullptr if not set.
    int channelNumber = -1;                // new default channel number in the range [0, numChannels] or -1 if not set.
}

//
// Control info attached to a mac frame that is sent down to the ~Ieee80211Radio.
//
class Ieee80211TransmissionRequest extends TransmissionRequest
{
    @existingClass;
    IIeee80211Mode *mode = nullptr;      // override default transmission mode or nullptr if not set.
    int channelNumber = -1;                // override default channel or -1 if not set.
    Ieee80211ChannelPtr channel = nullptr @opaque @tostring($ ? $->getCompleteStringRepresentation() : std::string("<nullptr>")); // override default band and channel or nullptr if not set.
}

class Ieee80211ReceptionIndication extends ReceptionIndication
{
    @existingClass;
    IIeee80211Mode* mode = nullptr;      // specifies reception mode.
    Ieee80211ChannelPtr channel = nullptr @opaque @tostring($ ? $->getCompleteStringRepresentation() : std::string("<nullptr>")); // specifies reception band and channel
    // TODO: remove already inherited fields
    double snr;
    double lossRate;
    double recPow;
    bool airtimeMetric;
    double testFrameDuration;
    double testFrameError;
    int    testFrameSize;
}
