knx/data_link_layer.h
Thomas Kunze b0b6336899 - refactor data-link layer
- add dummy tp-uart dl
- add bau07b0 (copy of bau57B0; refactoring needed)
2018-06-05 00:32:26 +02:00

31 lines
1.1 KiB
C++

#pragma once
#include <stdint.h>
#include "device_object.h"
#include "address_table_object.h"
#include "knx_types.h"
#include "network_layer.h"
class DataLinkLayer
{
public:
DataLinkLayer(DeviceObject& devObj, AddressTableObject& addrTab, NetworkLayer& layer,
Platform& platform);
// from network layer
void dataRequest(AckType ack, AddressType addrType, uint16_t destinationAddr, FrameFormat format,
Priority priority, NPDU& npdu);
void systemBroadcastRequest(AckType ack, FrameFormat format, Priority priority, NPDU& npdu);
virtual void loop() = 0;
virtual void enabled(bool value) = 0;
virtual bool enabled() const = 0;
protected:
void frameRecieved(CemiFrame& frame);
bool sendTelegram(NPDU &npdu, AckType ack, uint16_t destinationAddr, AddressType addrType, FrameFormat format, Priority priority);
virtual bool sendFrame(CemiFrame& frame) = 0;
uint8_t* frameData(CemiFrame& frame);
DeviceObject& _deviceObject;
AddressTableObject& _groupAddressTable;
NetworkLayer& _networkLayer;
Platform& _platform;
};