knx
ETS configurable knx-stack
knx_ip_supported_service_dib.cpp
Go to the documentation of this file.
1
#include "
knx_ip_supported_service_dib.h
"
2
3
#ifdef USE_IP
4
KnxIpSupportedServiceDIB::KnxIpSupportedServiceDIB
(uint8_t* data) :
KnxIpDIB
(data)
5
{}
6
7
8
uint8_t
KnxIpSupportedServiceDIB::serviceVersion
(
ServiceFamily
family)
9
{
10
uint8_t* start =
_data
+ 2;
11
uint8_t* end =
_data
+
length
();
12
13
for
(uint8_t* it = start; it < end; it += 2)
14
{
15
if
(*it == family)
16
return
it[1];
17
}
18
19
return
0;
20
}
21
22
23
void
KnxIpSupportedServiceDIB::serviceVersion
(
ServiceFamily
family, uint8_t version)
24
{
25
uint8_t* start =
_data
+ 2;
26
uint8_t* end =
_data
+
length
();
27
28
for
(uint8_t* it = start; it < end; it += 2)
29
{
30
if
(*it == family)
31
{
32
it[1] = version;
33
break
;
34
}
35
36
if
(*it == 0)
37
{
38
*it = family;
39
it[1] = version;
40
break
;
41
}
42
}
43
}
44
#endif
KnxIpDIB
Definition:
knx_ip_dib.h:22
KnxIpDIB::length
uint8_t length() const
Definition:
knx_ip_dib.cpp:9
KnxIpDIB::_data
uint8_t * _data
Definition:
knx_ip_dib.h:32
KnxIpSupportedServiceDIB::serviceVersion
uint8_t serviceVersion(ServiceFamily family)
Definition:
knx_ip_supported_service_dib.cpp:8
KnxIpSupportedServiceDIB::KnxIpSupportedServiceDIB
KnxIpSupportedServiceDIB(uint8_t *data)
Definition:
knx_ip_supported_service_dib.cpp:4
knx_ip_supported_service_dib.h
ServiceFamily
ServiceFamily
Definition:
knx_ip_supported_service_dib.h:6
src
knx
knx_ip_supported_service_dib.cpp
Generated by
1.9.1