/* Sends the buffer of size. Prepares the packet to be sent and sets the radio in transmission.  */
void RadioSend(uint8_t *buffer, uint8_t size)
/* Sends the buffer of size. Prepares the packet to be sent and sets the radio in transmission.  */
void RadioSend(uint8_t *buffer, uint8_t size)
{
    SX126xSetDioIrqParams( IRQ_TX_DONE,
                           IRQ_TX_DONE,
                           IRQ_RADIO_NONE,
                           IRQ_RADIO_NONE );
    if( SX126xGetPacketType( ) == PACKET_TYPE_LORA )
    {
        SX126x.PacketParams.Params.LoRa.PayloadLength = size;
    }
    else
    {
        SX126x.PacketParams.Params.Gfsk.PayloadLength = size;
    }
    SX126xSetPacketParams( &SX126x.PacketParams );
    SX126xSendPayload( buffer, size, 0 );
}