#include "LoraModuleInterfaceData.h"

CLoraModuleInterfaceStatus::CLoraModuleInterfaceStatus()
{

}

CLoraModuleInterfaceStatus& CLoraModuleInterfaceStatus::operator = (const CLoraModuleInterfaceStatus &rhs)
{
    if(this == &rhs)
        return *this;

    mModuleModel = rhs.mModuleModel;
    mModuleInternalAddress = rhs.mModuleInternalAddress;
    mModuleUARTParity = rhs.mModuleUARTParity;
    mModuleUARTRate = rhs.mModuleUARTRate;
    mModuleAirRate = rhs.mModuleAirRate;
    mModuleSubPacket = rhs.mModuleSubPacket;
    mModuleRSSIEnabled = rhs.mModuleRSSIEnabled;
    mModuleTxPower = rhs.mModuleTxPower;
    mModuleInternalChannel = rhs.mModuleInternalChannel;
    mModuleRSSIByteEnabled = rhs.mModuleRSSIByteEnabled;
    mModuleTxMethod = rhs.mModuleTxMethod;
    mModuleLBTEnabled = rhs.mModuleLBTEnabled;
    mModuleWORCycle = rhs.mModuleWORCycle;
    mModuleAmbientRSSI = rhs.mModuleAmbientRSSI;
    mModuleLastRxRSSI = rhs.mModuleLastRxRSSI;

    mIPAddress1 = rhs.mIPAddress1;
    mIPAddress2 = rhs.mIPAddress2;
    mIPAddress3 = rhs.mIPAddress3;
    mIPAddress4 = rhs.mIPAddress4;



    return *this;
}

QDataStream &operator<<(QDataStream &out, const CLoraModuleInterfaceStatus &source)
{
   out << source.mModuleModel
       << source.mModuleInternalAddress
       << source.mModuleUARTParity
       << source.mModuleUARTRate
       << source.mModuleAirRate
       << source.mModuleSubPacket
       << source.mModuleRSSIEnabled
       << source.mModuleTxPower
       << source.mModuleInternalChannel
       << source.mModuleRSSIByteEnabled
       << source.mModuleTxMethod
       << source.mModuleLBTEnabled
       << source.mModuleWORCycle
       << source.mModuleAmbientRSSI
       << source.mModuleLastRxRSSI
       << source.mIPAddress1
       << source.mIPAddress2
       << source.mIPAddress3
       << source.mIPAddress4;



    return out;
}

QDataStream &operator>>(QDataStream &in, CLoraModuleInterfaceStatus &dest)
{
    in >> dest.mModuleModel
       >> dest.mModuleInternalAddress
       >> dest.mModuleUARTParity
       >> dest.mModuleUARTRate
       >> dest.mModuleAirRate
       >> dest.mModuleSubPacket
       >> dest.mModuleRSSIEnabled
       >> dest.mModuleTxPower
       >> dest.mModuleInternalChannel
       >> dest.mModuleRSSIByteEnabled
       >> dest.mModuleTxMethod
       >> dest.mModuleLBTEnabled
       >> dest.mModuleWORCycle
       >> dest.mModuleAmbientRSSI
       >> dest.mModuleLastRxRSSI
       >> dest.mIPAddress1
       >> dest.mIPAddress2
       >> dest.mIPAddress3
       >> dest.mIPAddress4;


    return in;
}
