mirror of
https://github.com/thelsing/knx.git
synced 2025-08-22 13:46:21 +02:00
save work
This commit is contained in:
parent
3595e53aab
commit
68b38feaea
@ -3,6 +3,7 @@
|
||||
#include "tpdu.h"
|
||||
#include "cemi_frame.h"
|
||||
#include "bits.h"
|
||||
#include "apdu.h"
|
||||
|
||||
NetworkLayer::NetworkLayer(DeviceObject &deviceObj, TransportLayer& layer) :
|
||||
_deviceObj(deviceObj),
|
||||
@ -28,6 +29,25 @@ uint8_t NetworkLayer::hopCount() const
|
||||
return _hopCount;
|
||||
}
|
||||
|
||||
bool NetworkLayer::isApciSystemBroadcast(APDU& apdu)
|
||||
{
|
||||
switch (apdu.type())
|
||||
{
|
||||
// Application Layer Services on System Broadcast communication mode
|
||||
case SystemNetworkParameterRead:
|
||||
case SystemNetworkParameterResponse:
|
||||
case SystemNetworkParameterWrite:
|
||||
// Open media specific Application Layer Services on System Broadcast communication mode
|
||||
case DomainAddressSerialNumberRead:
|
||||
case DomainAddressSerialNumberResponse:
|
||||
case DomainAddressSerialNumberWrite:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void NetworkLayer::dataIndication(AckType ack, AddressType addrType, uint16_t destination, FrameFormat format, NPDU& npdu, Priority priority, uint16_t source)
|
||||
{
|
||||
HopCountType hopType = npdu.hopCount() == 7 ? UnlimitedRouting : NetworkLayerParameter;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "network_layer_entity.h"
|
||||
|
||||
class DeviceObject;
|
||||
class APDU;
|
||||
|
||||
class NetworkLayer
|
||||
{
|
||||
@ -18,6 +19,7 @@ class NetworkLayer
|
||||
virtual NetworkLayerEntity& getEntity(uint8_t interfaceIndex) = 0;
|
||||
|
||||
uint8_t hopCount() const;
|
||||
bool isApciSystemBroadcast(APDU& apdu);
|
||||
|
||||
// from transport layer
|
||||
virtual void dataIndividualRequest(AckType ack, uint16_t destination, HopCountType hopType, Priority priority, TPDU& tpdu) = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user