mirror of
https://github.com/thelsing/knx.git
synced 2025-08-22 13:46:21 +02:00
Remember which interface received the cemi frame
This commit is contained in:
parent
a4599f4f9d
commit
373d44d29b
@ -380,3 +380,14 @@ bool CemiFrame::valid() const
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CemiFrame::sourceInterface(uint8_t index)
|
||||||
|
{
|
||||||
|
_sourceInterfaceIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t CemiFrame::sourceInterface()
|
||||||
|
{
|
||||||
|
return _sourceInterfaceIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -57,6 +57,9 @@ class CemiFrame
|
|||||||
uint16_t destinationAddress() const;
|
uint16_t destinationAddress() const;
|
||||||
void destinationAddress(uint16_t value);
|
void destinationAddress(uint16_t value);
|
||||||
|
|
||||||
|
void sourceInterface(uint8_t index);
|
||||||
|
uint8_t sourceInterface();
|
||||||
|
|
||||||
#ifdef USE_RF
|
#ifdef USE_RF
|
||||||
// only for RF medium
|
// only for RF medium
|
||||||
uint8_t* rfSerialOrDoA() const;
|
uint8_t* rfSerialOrDoA() const;
|
||||||
@ -89,4 +92,6 @@ class CemiFrame
|
|||||||
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
|
#endif
|
||||||
};
|
|
||||||
|
uint8_t _sourceInterfaceIndex;
|
||||||
|
};
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "bits.h"
|
#include "bits.h"
|
||||||
|
|
||||||
NetworkLayer::NetworkLayer(DeviceObject &deviceObj, TransportLayer& layer) :
|
NetworkLayer::NetworkLayer(DeviceObject &deviceObj, TransportLayer& layer) :
|
||||||
_netLayerEntities {*this, *this},
|
_netLayerEntities { {*this, 0}, {*this, 1} },
|
||||||
_transportLayer(layer),
|
_transportLayer(layer),
|
||||||
_deviceObj(deviceObj)
|
_deviceObj(deviceObj)
|
||||||
{
|
{
|
||||||
|
@ -38,6 +38,7 @@ class NetworkLayer
|
|||||||
private:
|
private:
|
||||||
uint8_t _hopCount = 6;
|
uint8_t _hopCount = 6;
|
||||||
|
|
||||||
|
// Support a maximum of two physical interfaces
|
||||||
NetworkLayerEntity _netLayerEntities[2];
|
NetworkLayerEntity _netLayerEntities[2];
|
||||||
|
|
||||||
TransportLayer& _transportLayer;
|
TransportLayer& _transportLayer;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "data_link_layer.h"
|
#include "data_link_layer.h"
|
||||||
#include "bits.h"
|
#include "bits.h"
|
||||||
|
|
||||||
NetworkLayerEntity::NetworkLayerEntity(NetworkLayer &netLayer) : _netLayer(netLayer)
|
NetworkLayerEntity::NetworkLayerEntity(NetworkLayer &netLayer, uint8_t entityIndex) : _netLayer(netLayer), _entityIndex(entityIndex)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,31 +16,37 @@ void NetworkLayerEntity::dataLinkLayer(DataLinkLayer& layer)
|
|||||||
|
|
||||||
void NetworkLayerEntity::dataIndication(AckType ack, AddressType addrType, uint16_t destination, FrameFormat format, NPDU& npdu, Priority priority, uint16_t source)
|
void NetworkLayerEntity::dataIndication(AckType ack, AddressType addrType, uint16_t destination, FrameFormat format, NPDU& npdu, Priority priority, uint16_t source)
|
||||||
{
|
{
|
||||||
|
npdu.frame().sourceInterface(_entityIndex);
|
||||||
_netLayer.dataIndication(ack, addrType, destination, format, npdu, priority, source);
|
_netLayer.dataIndication(ack, addrType, destination, format, npdu, priority, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkLayerEntity::dataConfirm(AckType ack, AddressType addressType, uint16_t destination, FrameFormat format, Priority priority, uint16_t source, NPDU& npdu, bool status)
|
void NetworkLayerEntity::dataConfirm(AckType ack, AddressType addressType, uint16_t destination, FrameFormat format, Priority priority, uint16_t source, NPDU& npdu, bool status)
|
||||||
{
|
{
|
||||||
|
npdu.frame().sourceInterface(_entityIndex);
|
||||||
_netLayer.dataConfirm(ack, addressType, destination, format, priority, source, npdu, status);
|
_netLayer.dataConfirm(ack, addressType, destination, format, priority, source, npdu, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkLayerEntity::broadcastIndication(AckType ack, FrameFormat format, NPDU& npdu, Priority priority, uint16_t source)
|
void NetworkLayerEntity::broadcastIndication(AckType ack, FrameFormat format, NPDU& npdu, Priority priority, uint16_t source)
|
||||||
{
|
{
|
||||||
|
npdu.frame().sourceInterface(_entityIndex);
|
||||||
_netLayer.broadcastIndication(ack, format, npdu, priority, source);
|
_netLayer.broadcastIndication(ack, format, npdu, priority, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkLayerEntity::broadcastConfirm(AckType ack, FrameFormat format, Priority priority, uint16_t source, NPDU& npdu, bool status)
|
void NetworkLayerEntity::broadcastConfirm(AckType ack, FrameFormat format, Priority priority, uint16_t source, NPDU& npdu, bool status)
|
||||||
{
|
{
|
||||||
|
npdu.frame().sourceInterface(_entityIndex);
|
||||||
_netLayer.broadcastConfirm(ack, format, priority, source, npdu, status);
|
_netLayer.broadcastConfirm(ack, format, priority, source, npdu, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkLayerEntity::systemBroadcastIndication(AckType ack, FrameFormat format, NPDU& npdu, Priority priority, uint16_t source)
|
void NetworkLayerEntity::systemBroadcastIndication(AckType ack, FrameFormat format, NPDU& npdu, Priority priority, uint16_t source)
|
||||||
{
|
{
|
||||||
|
npdu.frame().sourceInterface(_entityIndex);
|
||||||
_netLayer.systemBroadcastIndication(ack, format, npdu, priority, source);
|
_netLayer.systemBroadcastIndication(ack, format, npdu, priority, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkLayerEntity::systemBroadcastConfirm(AckType ack, FrameFormat format, Priority priority, uint16_t source, NPDU& npdu, bool status)
|
void NetworkLayerEntity::systemBroadcastConfirm(AckType ack, FrameFormat format, Priority priority, uint16_t source, NPDU& npdu, bool status)
|
||||||
{
|
{
|
||||||
|
npdu.frame().sourceInterface(_entityIndex);
|
||||||
_netLayer.systemBroadcastConfirm(ack, format, priority, source, npdu, status);
|
_netLayer.systemBroadcastConfirm(ack, format, priority, source, npdu, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ class NetworkLayer;
|
|||||||
class NetworkLayerEntity
|
class NetworkLayerEntity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NetworkLayerEntity(NetworkLayer &netLayer);
|
NetworkLayerEntity(NetworkLayer &netLayer, uint8_t entityIndex);
|
||||||
|
|
||||||
void dataLinkLayer(DataLinkLayer& layer);
|
void dataLinkLayer(DataLinkLayer& layer);
|
||||||
|
|
||||||
@ -35,4 +35,5 @@ class NetworkLayerEntity
|
|||||||
private:
|
private:
|
||||||
DataLinkLayer* _dataLinkLayer = 0;
|
DataLinkLayer* _dataLinkLayer = 0;
|
||||||
NetworkLayer& _netLayer;
|
NetworkLayer& _netLayer;
|
||||||
|
uint8_t _entityIndex;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user