Skip to content

Commit 8257add

Browse files
committed
fix searchResponseExtended DHCP, prints, length
1 parent 80c79e9 commit 8257add

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/knx/ip_data_link_layer.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ void IpDataLinkLayer::loopHandleSearchRequestExtended(uint8_t* buffer, uint16_t
460460

461461
if(searchRequest.srpRequestDIBs)
462462
{
463-
println("srpRequestDIBs");
463+
//println("srpRequestDIBs");
464464
if(searchRequest.requestedDIB(IP_CONFIG))
465465
dibLength += LEN_IP_CONFIG_DIB; //16
466466

@@ -510,9 +510,9 @@ void IpDataLinkLayer::loopHandleSearchRequestExtended(uint8_t* buffer, uint16_t
510510
searchResponse.setTunnelingInfo(_ipParameters, _deviceObject, tunnels);
511511
}
512512

513-
if(searchResponse.totalLength() > 150)
513+
if(searchResponse.totalLength() > 500)
514514
{
515-
println("skipped response cause length is not plausible");
515+
printf("skipped response length > 500. Length: %d bytes\n", searchResponse.totalLength());
516516
return;
517517
}
518518

src/knx/knx_ip_search_response_extended.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ KnxIpSearchResponseExtended::KnxIpSearchResponseExtended(IpParameterObject& para
3434

3535
void KnxIpSearchResponseExtended::setDeviceInfo(IpParameterObject& parameters, DeviceObject& deviceObject)
3636
{
37-
println("setDeviceInfo");
37+
//setDeviceInfo");
3838
KnxIpDeviceInformationDIB _deviceInfo(_data + currentPos);
3939
_deviceInfo.length(LEN_DEVICE_INFORMATION_DIB);
4040
_deviceInfo.code(DEVICE_INFO);
@@ -65,7 +65,7 @@ void KnxIpSearchResponseExtended::setDeviceInfo(IpParameterObject& parameters, D
6565

6666
void KnxIpSearchResponseExtended::setSupportedServices()
6767
{
68-
println("setSupportedServices");
68+
//println("setSupportedServices");
6969
KnxIpSupportedServiceDIB _supportedServices(_data + currentPos);
7070
_supportedServices.length(LEN_SERVICE_DIB);
7171
_supportedServices.code(SUPP_SVC_FAMILIES);
@@ -82,7 +82,7 @@ void KnxIpSearchResponseExtended::setSupportedServices()
8282

8383
void KnxIpSearchResponseExtended::setIpConfig(IpParameterObject& parameters)
8484
{
85-
println("setIpConfig");
85+
//println("setIpConfig");
8686
KnxIpConfigDIB _ipConfig(_data + currentPos);
8787
_ipConfig.length(LEN_IP_CONFIG_DIB);
8888
_ipConfig.code(IP_CONFIG);
@@ -97,14 +97,14 @@ void KnxIpSearchResponseExtended::setIpConfig(IpParameterObject& parameters)
9797

9898
void KnxIpSearchResponseExtended::setIpCurrentConfig(IpParameterObject& parameters)
9999
{
100-
println("setIpCurrentConfig");
100+
//println("setIpCurrentConfig");
101101
KnxIpConfigDIB _ipCurConfig(_data + currentPos, true);
102102
_ipCurConfig.length(LEN_IP_CURRENT_CONFIG_DIB);
103103
_ipCurConfig.code(IP_CUR_CONFIG);
104104
_ipCurConfig.address(parameters.propertyValue<uint32_t>(PID_CURRENT_IP_ADDRESS));
105105
_ipCurConfig.subnet(parameters.propertyValue<uint32_t>(PID_CURRENT_SUBNET_MASK));
106106
_ipCurConfig.gateway(parameters.propertyValue<uint32_t>(PID_CURRENT_DEFAULT_GATEWAY));
107-
_ipCurConfig.dhcp(parameters.propertyValue<uint32_t>(PID_DHCP_BOOTP_SERVER));
107+
_ipCurConfig.dhcp(0);
108108
_ipCurConfig.info1(parameters.propertyValue<uint8_t>(PID_CURRENT_IP_ASSIGNMENT_METHOD));
109109
_ipCurConfig.info2(0x00); //Reserved
110110

@@ -113,7 +113,7 @@ void KnxIpSearchResponseExtended::setIpCurrentConfig(IpParameterObject& paramete
113113

114114
void KnxIpSearchResponseExtended::setKnxAddresses(IpParameterObject& parameters, DeviceObject& deviceObject)
115115
{
116-
println("setKnxAddresses");
116+
//println("setKnxAddresses");
117117
KnxIpKnxAddressesDIB _knxAddresses(_data + currentPos);
118118
_knxAddresses.length(4); //minimum
119119
_knxAddresses.code(KNX_ADDRESSES);
@@ -136,7 +136,7 @@ void KnxIpSearchResponseExtended::setKnxAddresses(IpParameterObject& parameters,
136136

137137
void KnxIpSearchResponseExtended::setTunnelingInfo(IpParameterObject& parameters, DeviceObject& deviceObject, KnxIpTunnelConnection tunnels[])
138138
{
139-
println("setTunnelingInfo");
139+
//println("setTunnelingInfo");
140140
KnxIpTunnelingInfoDIB _tunnelInfo(_data + currentPos);
141141
_tunnelInfo.length(4); //minlength
142142
_tunnelInfo.code(TUNNELING_INFO);
@@ -196,7 +196,7 @@ void KnxIpSearchResponseExtended::setTunnelingInfo(IpParameterObject& parameters
196196

197197
void KnxIpSearchResponseExtended::setExtendedDeviceInfo()
198198
{
199-
println("setExtendedDeviceInfo");
199+
//println("setExtendedDeviceInfo");
200200
KnxIpExtendedDeviceInformationDIB _extended(_data + currentPos);
201201
_extended.length(LEN_EXTENDED_DEVICE_INFORMATION_DIB);
202202
_extended.code(EXTENDED_DEVICE_INFO);

0 commit comments

Comments
 (0)