knx
ETS configurable knx-stack
rf_physical_layer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "config.h"
4 #ifdef USE_RF
5 
6 #include <stdint.h>
7 
8 #include "platform.h"
9 
10 // Calculate the real packet size out of the L-field of FT3 frame data. See KNX-RF spec. 3.2.5 Data Link Layer frame format
11 #define PACKET_SIZE(lField) ((((lField - 10 /*size of first pkt*/))/16 + 2 /*CRC in first pkt */) * 2 /*to bytes*/ +lField + 1 /*size of len byte*/)
12 
13 class RfDataLinkLayer;
14 
16 {
17  public:
18  RfPhysicalLayer(RfDataLinkLayer& rfDataLinkLayer, Platform& platform)
19  : _rfDataLinkLayer(rfDataLinkLayer), _platform(platform) {}
20 
21  virtual bool InitChip() = 0;
22  virtual void stopChip() = 0;
23  virtual void loop() = 0;
24 
25  protected:
28 };
29 
30 #endif
Platform & _platform
virtual bool InitChip()=0
RfPhysicalLayer(RfDataLinkLayer &rfDataLinkLayer, Platform &platform)
virtual void loop()=0
RfDataLinkLayer & _rfDataLinkLayer
virtual void stopChip()=0