peer to peer rx terminal

Dependencies:   ISL29011 libxDot-dev-mbed5-deprecated

Fork of peer-to-peer_rxtx by Natalia Requejo

RadioEvent.h

Committer:
NataliaRequejo
Date:
2018-03-10
Revision:
61:ebe1838a9301
Child:
62:5a4266922385

File content as of revision 61:ebe1838a9301:

#ifndef __RADIO_EVENT_H__
#define __RADIO_EVENT_H__

#include "mDotEvent.h"

class RadioEvent : public mDotEvent
{
 
public:
    RadioEvent() {}
 
    virtual ~RadioEvent() {}
 
    virtual void MacEvent(LoRaMacEventFlags* flags, LoRaMacEventInfo* info) {
        if (flags->Bits.Rx) {
 
            logDebug("Rx %d bytes", info->RxBufferSize);
            if (info->RxBufferSize > 0) {
                // print RX data as string and hexadecimal 
                std::string rx((const char*)info->RxBuffer, info->RxBufferSize);
                printf("Rx data: %s [%s]\r\n", rx.c_str(), mts::Text::bin2hexString(info->RxBuffer, info->RxBufferSize).c_str());
            }
        }
    }
};

#endif