#include "LoraDevice.h"

CLoraDevice::CLoraDevice()
{

}

QByteArray CLoraDevice::GetLoraFrame(unsigned short DestAddress, unsigned char DestChannel, QByteArray Payload)
{
    QByteArray OutputFrame;
    OutputFrame.clear();

    //E32 modules frame is [Address_MSB][Address_LSB][Channel][Payload]



    char AddressByte = (char)((DestAddress >> 8) & 0x00FF);
    OutputFrame.append(AddressByte);
    AddressByte = (char)(DestAddress & 0x00FF);
    OutputFrame.append(AddressByte);
    OutputFrame.append(DestChannel);
    OutputFrame.append(Payload);

    return OutputFrame;
}
