only add rf props ifdef USE_RF

This commit is contained in:
Thomas Kunze 2020-01-11 21:20:25 +01:00
parent 82f463f965
commit 4dda99b341
2 changed files with 11 additions and 4 deletions

View File

@ -160,6 +160,8 @@ void CemiFrame::fillTelegramTP(uint8_t* data)
data[len - 1] = calcCrcTP(data, len - 1); data[len - 1] = calcCrcTP(data, len - 1);
} }
#ifdef USE_RF
uint16_t CemiFrame::telegramLengthtRF() const uint16_t CemiFrame::telegramLengthtRF() const
{ {
return totalLenght() - 3; return totalLenght() - 3;
@ -183,7 +185,7 @@ void CemiFrame::fillTelegramRF(uint8_t* data)
//printHex("cEMI_fill: ", &data[0], len); //printHex("cEMI_fill: ", &data[0], len);
} }
#endif
uint8_t* CemiFrame::data() uint8_t* CemiFrame::data()
{ {
return _data; return _data;
@ -315,7 +317,7 @@ void CemiFrame::destinationAddress(uint16_t value)
{ {
pushWord(value, _ctrl1 + 4); pushWord(value, _ctrl1 + 4);
} }
#ifdef USE_RF
uint8_t* CemiFrame::rfSerialOrDoA() const uint8_t* CemiFrame::rfSerialOrDoA() const
{ {
return _rfSerialOrDoA; return _rfSerialOrDoA;
@ -345,7 +347,7 @@ void CemiFrame::rfLfn(uint8_t rfLfn)
{ {
_rfLfn = rfLfn; _rfLfn = rfLfn;
} }
#endif
NPDU& CemiFrame::npdu() NPDU& CemiFrame::npdu()
{ {
return _npdu; return _npdu;

View File

@ -5,6 +5,7 @@
#include "npdu.h" #include "npdu.h"
#include "tpdu.h" #include "tpdu.h"
#include "apdu.h" #include "apdu.h"
#include "config.h"
#define NPDU_LPDU_DIFF 8 #define NPDU_LPDU_DIFF 8
#define TPDU_NPDU_DIFF 1 #define TPDU_NPDU_DIFF 1
@ -56,6 +57,7 @@ class CemiFrame
uint16_t destinationAddress() const; uint16_t destinationAddress() const;
void destinationAddress(uint16_t value); void destinationAddress(uint16_t value);
#ifdef USE_RF
// only for RF medium // only for RF medium
uint8_t* rfSerialOrDoA() const; uint8_t* rfSerialOrDoA() const;
void rfSerialOrDoA(uint8_t* rfSerialOrDoA); void rfSerialOrDoA(uint8_t* rfSerialOrDoA);
@ -63,7 +65,7 @@ class CemiFrame
void rfInfo(uint8_t rfInfo); void rfInfo(uint8_t rfInfo);
uint8_t rfLfn() const; uint8_t rfLfn() const;
void rfLfn(uint8_t rfInfo); void rfLfn(uint8_t rfInfo);
#endif
NPDU& npdu(); NPDU& npdu();
TPDU& tpdu(); TPDU& tpdu();
APDU& apdu(); APDU& apdu();
@ -80,8 +82,11 @@ class CemiFrame
APDU _apdu; APDU _apdu;
uint16_t _length = 0; // only set if created from byte array uint16_t _length = 0; // only set if created from byte array
#ifdef USE_RF
// FIXME: integrate this propery in _data
// only for RF medium // only for RF medium
uint8_t* _rfSerialOrDoA = 0; uint8_t* _rfSerialOrDoA = 0;
uint8_t _rfInfo = 0; uint8_t _rfInfo = 0;
uint8_t _rfLfn = 0xFF; // RF Data Link layer frame number uint8_t _rfLfn = 0xFF; // RF Data Link layer frame number
#endif
}; };