knx
ETS configurable knx-stack
network_layer.cpp
Go to the documentation of this file.
1 #include "network_layer.h"
2 #include "device_object.h"
3 #include "data_link_layer.h"
4 #include "tpdu.h"
5 #include "cemi_frame.h"
6 #include "bits.h"
7 #include "apdu.h"
8 
10  _deviceObj(deviceObj),
11  _transportLayer(layer)
12 {
13  _hopCount = _deviceObj.defaultHopCount();
14 }
15 
16 uint8_t NetworkLayer::hopCount() const
17 {
18  return _hopCount;
19 }
20 
22 {
23  switch (apdu.type())
24  {
25  // Application Layer Services on System Broadcast communication mode
29 
30  // Open media specific Application Layer Services on System Broadcast communication mode
34  case DomainAddressRead:
37  case DomainAddressWrite:
38  return true;
39 
40  default:
41  return false;
42  }
43 
44  return false;
45 }
46 
This class represents an Application Protocol Data Unit.
Definition: apdu.h:12
ApduType type()
Get the type of the APDU.
Definition: apdu.cpp:9
uint8_t defaultHopCount()
NetworkLayer(DeviceObject &deviceObj, TransportLayer &layer)
DeviceObject & _deviceObj
Definition: network_layer.h:29
uint8_t hopCount() const
bool isApciSystemBroadcast(APDU &apdu)
@ DomainAddressSerialNumberWrite
Definition: knx_types.h:167
@ SystemNetworkParameterRead
Definition: knx_types.h:157
@ DomainAddressWrite
Definition: knx_types.h:161
@ SystemNetworkParameterWrite
Definition: knx_types.h:159
@ DomainAddressSerialNumberRead
Definition: knx_types.h:165
@ DomainAddressSelectiveRead
Definition: knx_types.h:164
@ DomainAddressResponse
Definition: knx_types.h:163
@ DomainAddressSerialNumberResponse
Definition: knx_types.h:166
@ DomainAddressRead
Definition: knx_types.h:162
@ SystemNetworkParameterResponse
Definition: knx_types.h:158