netzwerk
This commit is contained in:
parent
9240622aa7
commit
417dbe34cd
324
displayprodLinux/Network.share.xml
Normal file
324
displayprodLinux/Network.share.xml
Normal file
@ -0,0 +1,324 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<KNX xmlns:op="http://github.com/OpenKNX/OpenKNXproducer" xmlns="http://knx.org/xml/project/20"
|
||||||
|
CreatedBy="KNX MT" ToolVersion="5.1.255.16695">
|
||||||
|
<ManufacturerData>
|
||||||
|
<Manufacturer RefId="M-00FA">
|
||||||
|
<ApplicationPrograms>
|
||||||
|
<ApplicationProgram>
|
||||||
|
<Static>
|
||||||
|
<ParameterTypes>
|
||||||
|
<ParameterType Id="%AID%_PT-NetEnable" Name="NetEnable">
|
||||||
|
<TypeRestriction Base="Value" SizeInBit="1">
|
||||||
|
<Enumeration Text="Aus" Value="0" Id="%ENID%" />
|
||||||
|
<Enumeration Text="Ein" Value="1" Id="%ENID%" />
|
||||||
|
</TypeRestriction>
|
||||||
|
</ParameterType>
|
||||||
|
<ParameterType Id="%AID%_PT-NetMode" Name="NetMode">
|
||||||
|
<TypeRestriction Base="Value" SizeInBit="1">
|
||||||
|
<Enumeration Text="DHCP" Value="0" Id="%ENID%" />
|
||||||
|
<Enumeration Text="Statisch" Value="1" Id="%ENID%" />
|
||||||
|
</TypeRestriction>
|
||||||
|
</ParameterType>
|
||||||
|
<ParameterType Id="%AID%_PT-IpOctet" Name="IpOctet">
|
||||||
|
<TypeNumber SizeInBit="8" Type="unsignedInt" minInclusive="0" maxInclusive="255" />
|
||||||
|
</ParameterType>
|
||||||
|
</ParameterTypes>
|
||||||
|
<Parameters>
|
||||||
|
<!-- Byte 0: Flags -->
|
||||||
|
<Union SizeInBit="8">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="0" BitOffset="0" />
|
||||||
|
<Parameter Id="%AID%_P-%TT%00001" Name="pLanEnable"
|
||||||
|
ParameterType="%AID%_PT-NetEnable" Offset="0" BitOffset="0"
|
||||||
|
Text="LAN aktivieren" Value="1" />
|
||||||
|
<Parameter Id="%AID%_P-%TT%00002" Name="pLanDhcp"
|
||||||
|
ParameterType="%AID%_PT-NetMode" Offset="0" BitOffset="1"
|
||||||
|
Text="LAN Adressmodus" Value="0" />
|
||||||
|
<Parameter Id="%AID%_P-%TT%00003" Name="pWlanEnable"
|
||||||
|
ParameterType="%AID%_PT-NetEnable" Offset="0" BitOffset="2"
|
||||||
|
Text="WLAN aktivieren" Value="0" />
|
||||||
|
<Parameter Id="%AID%_P-%TT%00004" Name="pWlanDhcp"
|
||||||
|
ParameterType="%AID%_PT-NetMode" Offset="0" BitOffset="3"
|
||||||
|
Text="WLAN Adressmodus" Value="0" />
|
||||||
|
</Union>
|
||||||
|
|
||||||
|
<!-- LAN Static IP: Bytes 1-4 -->
|
||||||
|
<Parameter Id="%AID%_P-%TT%00010" Name="pLanIp1"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN IP Adresse 1. Oktett" Value="192">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="1" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00011" Name="pLanIp2"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN IP Adresse 2. Oktett" Value="168">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="2" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00012" Name="pLanIp3"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN IP Adresse 3. Oktett" Value="1">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="3" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00013" Name="pLanIp4"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN IP Adresse 4. Oktett" Value="100">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="4" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
|
||||||
|
<!-- LAN Subnet: Bytes 5-8 -->
|
||||||
|
<Parameter Id="%AID%_P-%TT%00014" Name="pLanSub1"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN Subnetzmaske 1. Oktett" Value="255">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="5" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00015" Name="pLanSub2"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN Subnetzmaske 2. Oktett" Value="255">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="6" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00016" Name="pLanSub3"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN Subnetzmaske 3. Oktett" Value="255">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="7" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00017" Name="pLanSub4"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN Subnetzmaske 4. Oktett" Value="0">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="8" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
|
||||||
|
<!-- LAN Gateway: Bytes 9-12 -->
|
||||||
|
<Parameter Id="%AID%_P-%TT%00018" Name="pLanGw1"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN Gateway 1. Oktett" Value="192">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="9" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00019" Name="pLanGw2"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN Gateway 2. Oktett" Value="168">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="10" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00020" Name="pLanGw3"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN Gateway 3. Oktett" Value="1">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="11" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00021" Name="pLanGw4"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN Gateway 4. Oktett" Value="1">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="12" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
|
||||||
|
<!-- LAN DNS: Bytes 13-16 -->
|
||||||
|
<Parameter Id="%AID%_P-%TT%00022" Name="pLanDns1"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN DNS 1. Oktett" Value="192">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="13" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00023" Name="pLanDns2"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN DNS 2. Oktett" Value="168">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="14" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00024" Name="pLanDns3"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN DNS 3. Oktett" Value="1">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="15" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00025" Name="pLanDns4"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="LAN DNS 4. Oktett" Value="1">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="16" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
|
||||||
|
<!-- WLAN Static IP: Bytes 17-20 -->
|
||||||
|
<Parameter Id="%AID%_P-%TT%00030" Name="pWlanIp1"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN IP Adresse 1. Oktett" Value="192">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="17" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00031" Name="pWlanIp2"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN IP Adresse 2. Oktett" Value="168">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="18" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00032" Name="pWlanIp3"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN IP Adresse 3. Oktett" Value="1">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="19" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00033" Name="pWlanIp4"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN IP Adresse 4. Oktett" Value="200">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="20" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
|
||||||
|
<!-- WLAN Subnet: Bytes 21-24 -->
|
||||||
|
<Parameter Id="%AID%_P-%TT%00034" Name="pWlanSub1"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN Subnetzmaske 1. Oktett" Value="255">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="21" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00035" Name="pWlanSub2"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN Subnetzmaske 2. Oktett" Value="255">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="22" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00036" Name="pWlanSub3"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN Subnetzmaske 3. Oktett" Value="255">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="23" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00037" Name="pWlanSub4"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN Subnetzmaske 4. Oktett" Value="0">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="24" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
|
||||||
|
<!-- WLAN Gateway: Bytes 25-28 -->
|
||||||
|
<Parameter Id="%AID%_P-%TT%00038" Name="pWlanGw1"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN Gateway 1. Oktett" Value="192">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="25" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00039" Name="pWlanGw2"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN Gateway 2. Oktett" Value="168">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="26" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00040" Name="pWlanGw3"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN Gateway 3. Oktett" Value="1">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="27" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00041" Name="pWlanGw4"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN Gateway 4. Oktett" Value="1">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="28" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
|
||||||
|
<!-- WLAN DNS: Bytes 29-32 -->
|
||||||
|
<Parameter Id="%AID%_P-%TT%00042" Name="pWlanDns1"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN DNS 1. Oktett" Value="192">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="29" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00043" Name="pWlanDns2"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN DNS 2. Oktett" Value="168">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="30" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00044" Name="pWlanDns3"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN DNS 3. Oktett" Value="1">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="31" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Id="%AID%_P-%TT%00045" Name="pWlanDns4"
|
||||||
|
ParameterType="%AID%_PT-IpOctet" Text="WLAN DNS 4. Oktett" Value="1">
|
||||||
|
<Memory CodeSegment="%AID%_RS-04-00000" Offset="32" BitOffset="0" />
|
||||||
|
</Parameter>
|
||||||
|
</Parameters>
|
||||||
|
<ParameterRefs>
|
||||||
|
<!-- Flags -->
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00001_R-%TT%0000101" RefId="%AID%_P-%TT%00001" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00002_R-%TT%0000201" RefId="%AID%_P-%TT%00002" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00003_R-%TT%0000301" RefId="%AID%_P-%TT%00003" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00004_R-%TT%0000401" RefId="%AID%_P-%TT%00004" />
|
||||||
|
<!-- LAN IP -->
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00010_R-%TT%0001001" RefId="%AID%_P-%TT%00010" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00011_R-%TT%0001101" RefId="%AID%_P-%TT%00011" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00012_R-%TT%0001201" RefId="%AID%_P-%TT%00012" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00013_R-%TT%0001301" RefId="%AID%_P-%TT%00013" />
|
||||||
|
<!-- LAN Subnet -->
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00014_R-%TT%0001401" RefId="%AID%_P-%TT%00014" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00015_R-%TT%0001501" RefId="%AID%_P-%TT%00015" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00016_R-%TT%0001601" RefId="%AID%_P-%TT%00016" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00017_R-%TT%0001701" RefId="%AID%_P-%TT%00017" />
|
||||||
|
<!-- LAN Gateway -->
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00018_R-%TT%0001801" RefId="%AID%_P-%TT%00018" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00019_R-%TT%0001901" RefId="%AID%_P-%TT%00019" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00020_R-%TT%0002001" RefId="%AID%_P-%TT%00020" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00021_R-%TT%0002101" RefId="%AID%_P-%TT%00021" />
|
||||||
|
<!-- LAN DNS -->
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00022_R-%TT%0002201" RefId="%AID%_P-%TT%00022" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00023_R-%TT%0002301" RefId="%AID%_P-%TT%00023" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00024_R-%TT%0002401" RefId="%AID%_P-%TT%00024" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00025_R-%TT%0002501" RefId="%AID%_P-%TT%00025" />
|
||||||
|
<!-- WLAN IP -->
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00030_R-%TT%0003001" RefId="%AID%_P-%TT%00030" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00031_R-%TT%0003101" RefId="%AID%_P-%TT%00031" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00032_R-%TT%0003201" RefId="%AID%_P-%TT%00032" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00033_R-%TT%0003301" RefId="%AID%_P-%TT%00033" />
|
||||||
|
<!-- WLAN Subnet -->
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00034_R-%TT%0003401" RefId="%AID%_P-%TT%00034" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00035_R-%TT%0003501" RefId="%AID%_P-%TT%00035" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00036_R-%TT%0003601" RefId="%AID%_P-%TT%00036" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00037_R-%TT%0003701" RefId="%AID%_P-%TT%00037" />
|
||||||
|
<!-- WLAN Gateway -->
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00038_R-%TT%0003801" RefId="%AID%_P-%TT%00038" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00039_R-%TT%0003901" RefId="%AID%_P-%TT%00039" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00040_R-%TT%0004001" RefId="%AID%_P-%TT%00040" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00041_R-%TT%0004101" RefId="%AID%_P-%TT%00041" />
|
||||||
|
<!-- WLAN DNS -->
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00042_R-%TT%0004201" RefId="%AID%_P-%TT%00042" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00043_R-%TT%0004301" RefId="%AID%_P-%TT%00043" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00044_R-%TT%0004401" RefId="%AID%_P-%TT%00044" />
|
||||||
|
<ParameterRef Id="%AID%_P-%TT%00045_R-%TT%0004501" RefId="%AID%_P-%TT%00045" />
|
||||||
|
</ParameterRefs>
|
||||||
|
<ComObjectTable />
|
||||||
|
<ComObjectRefs />
|
||||||
|
</Static>
|
||||||
|
<Dynamic>
|
||||||
|
<Channel Id="%AID%_CH-%PREFIX%" Number="%PREFIX%" Name="Network" Text="Netzwerk"
|
||||||
|
Icon="ethernet">
|
||||||
|
|
||||||
|
<!-- ===== LAN ===== -->
|
||||||
|
<ParameterBlock Id="%AID%_PB-nnn" Name="LAN" Text="LAN Einstellungen"
|
||||||
|
ShowInComObjectTree="false">
|
||||||
|
<ParameterSeparator Id="%AID%_PS-nnn" Text="LAN" UIHint="Headline" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00001_R-%TT%0000101" IndentLevel="1" />
|
||||||
|
|
||||||
|
<choose ParamRefId="%AID%_P-%TT%00001_R-%TT%0000101">
|
||||||
|
<when test="1">
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00002_R-%TT%0000201" IndentLevel="1" />
|
||||||
|
|
||||||
|
<choose ParamRefId="%AID%_P-%TT%00002_R-%TT%0000201">
|
||||||
|
<when test="1">
|
||||||
|
<ParameterSeparator Id="%AID%_PS-nnn" Text="LAN IP Adresse" UIHint="Headline" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00010_R-%TT%0001001" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00011_R-%TT%0001101" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00012_R-%TT%0001201" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00013_R-%TT%0001301" IndentLevel="2" />
|
||||||
|
<ParameterSeparator Id="%AID%_PS-nnn" Text="LAN Subnetzmaske" UIHint="Headline" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00014_R-%TT%0001401" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00015_R-%TT%0001501" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00016_R-%TT%0001601" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00017_R-%TT%0001701" IndentLevel="2" />
|
||||||
|
<ParameterSeparator Id="%AID%_PS-nnn" Text="LAN Gateway" UIHint="Headline" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00018_R-%TT%0001801" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00019_R-%TT%0001901" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00020_R-%TT%0002001" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00021_R-%TT%0002101" IndentLevel="2" />
|
||||||
|
<ParameterSeparator Id="%AID%_PS-nnn" Text="LAN DNS" UIHint="Headline" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00022_R-%TT%0002201" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00023_R-%TT%0002301" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00024_R-%TT%0002401" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00025_R-%TT%0002501" IndentLevel="2" />
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</ParameterBlock>
|
||||||
|
|
||||||
|
<!-- ===== WLAN ===== -->
|
||||||
|
<ParameterBlock Id="%AID%_PB-nnn" Name="WLAN" Text="WLAN Einstellungen"
|
||||||
|
ShowInComObjectTree="false">
|
||||||
|
<ParameterSeparator Id="%AID%_PS-nnn" Text="WLAN" UIHint="Headline" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00003_R-%TT%0000301" IndentLevel="1" />
|
||||||
|
|
||||||
|
<choose ParamRefId="%AID%_P-%TT%00003_R-%TT%0000301">
|
||||||
|
<when test="1">
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00004_R-%TT%0000401" IndentLevel="1" />
|
||||||
|
|
||||||
|
<choose ParamRefId="%AID%_P-%TT%00004_R-%TT%0000401">
|
||||||
|
<when test="1">
|
||||||
|
<ParameterSeparator Id="%AID%_PS-nnn" Text="WLAN IP Adresse" UIHint="Headline" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00030_R-%TT%0003001" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00031_R-%TT%0003101" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00032_R-%TT%0003201" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00033_R-%TT%0003301" IndentLevel="2" />
|
||||||
|
<ParameterSeparator Id="%AID%_PS-nnn" Text="WLAN Subnetzmaske" UIHint="Headline" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00034_R-%TT%0003401" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00035_R-%TT%0003501" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00036_R-%TT%0003601" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00037_R-%TT%0003701" IndentLevel="2" />
|
||||||
|
<ParameterSeparator Id="%AID%_PS-nnn" Text="WLAN Gateway" UIHint="Headline" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00038_R-%TT%0003801" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00039_R-%TT%0003901" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00040_R-%TT%0004001" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00041_R-%TT%0004101" IndentLevel="2" />
|
||||||
|
<ParameterSeparator Id="%AID%_PS-nnn" Text="WLAN DNS" UIHint="Headline" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00042_R-%TT%0004201" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00043_R-%TT%0004301" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00044_R-%TT%0004401" IndentLevel="2" />
|
||||||
|
<ParameterRefRef RefId="%AID%_P-%TT%00045_R-%TT%0004501" IndentLevel="2" />
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</ParameterBlock>
|
||||||
|
|
||||||
|
</Channel>
|
||||||
|
</Dynamic>
|
||||||
|
</ApplicationProgram>
|
||||||
|
</ApplicationPrograms>
|
||||||
|
</Manufacturer>
|
||||||
|
</ManufacturerData>
|
||||||
|
</KNX>
|
||||||
@ -25,6 +25,11 @@
|
|||||||
<!-- <op:verify File="../lib/OGM-Common/library.json" ModuleVersion="%BASE_VerifyVersion%" />-->
|
<!-- <op:verify File="../lib/OGM-Common/library.json" ModuleVersion="%BASE_VerifyVersion%" />-->
|
||||||
</op:define>
|
</op:define>
|
||||||
|
|
||||||
|
<op:define prefix="NW"
|
||||||
|
share="Network.share.xml"
|
||||||
|
ModuleType="10">
|
||||||
|
<!-- <op:verify File="../lib/OGM-Common/library.json" ModuleVersion="%BASE_VerifyVersion%" />-->
|
||||||
|
</op:define>
|
||||||
|
|
||||||
<op:define prefix="SC"
|
<op:define prefix="SC"
|
||||||
share="Section.share.xml"
|
share="Section.share.xml"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
idf_component_register(SRCS "HistoryStore.cpp" "KnxWorker.cpp" "Nvs.cpp" "main.cpp" "Display.cpp" "Touch.cpp" "Gui.cpp" "Wifi.cpp" "LvglIdle.c" "Hardware/Eth.cpp" "WidgetManager.cpp" "WidgetConfig.cpp" "SdCard.cpp" "Fonts.cpp"
|
idf_component_register(SRCS "HistoryStore.cpp" "KnxWorker.cpp" "Nvs.cpp" "main.cpp" "Display.cpp" "Touch.cpp" "Gui.cpp" "Wifi.cpp" "LvglIdle.c" "Hardware/Eth.cpp" "NetworkConfig.cpp" "WidgetManager.cpp" "WidgetConfig.cpp" "SdCard.cpp" "Fonts.cpp"
|
||||||
"widgets/Widget.cpp"
|
"widgets/Widget.cpp"
|
||||||
"widgets/LabelWidget.cpp"
|
"widgets/LabelWidget.cpp"
|
||||||
"widgets/ButtonWidget.cpp"
|
"widgets/ButtonWidget.cpp"
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
#include "esp_netif.h"
|
#include "esp_netif.h"
|
||||||
#include "esp_eth.h"
|
#include "esp_eth.h"
|
||||||
#include "ethernet_init.h"
|
#include "ethernet_init.h"
|
||||||
|
#include "lwip/ip4_addr.h"
|
||||||
|
|
||||||
|
|
||||||
static const char* TAG = "Ethernet";
|
static const char* TAG = "Ethernet";
|
||||||
@ -86,6 +87,7 @@ void Eth::init() {
|
|||||||
// default esp-netif configuration parameters.
|
// default esp-netif configuration parameters.
|
||||||
esp_netif_config_t cfg = ESP_NETIF_DEFAULT_ETH();
|
esp_netif_config_t cfg = ESP_NETIF_DEFAULT_ETH();
|
||||||
eth_netifs[0] = esp_netif_new(&cfg);
|
eth_netifs[0] = esp_netif_new(&cfg);
|
||||||
|
netif_ = eth_netifs[0];
|
||||||
eth_netif_glues[0] = esp_eth_new_netif_glue(eth_handles[0]);
|
eth_netif_glues[0] = esp_eth_new_netif_glue(eth_handles[0]);
|
||||||
// Attach Ethernet driver to TCP/IP stack
|
// Attach Ethernet driver to TCP/IP stack
|
||||||
ESP_ERROR_CHECK(esp_netif_attach(eth_netifs[0], eth_netif_glues[0]));
|
ESP_ERROR_CHECK(esp_netif_attach(eth_netifs[0], eth_netif_glues[0]));
|
||||||
@ -98,4 +100,45 @@ void Eth::init() {
|
|||||||
for (int i = 0; i < eth_port_cnt; i++) {
|
for (int i = 0; i < eth_port_cnt; i++) {
|
||||||
ESP_ERROR_CHECK(esp_eth_start(eth_handles[i]));
|
ESP_ERROR_CHECK(esp_eth_start(eth_handles[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initialized_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Eth::applyStaticIp(const StaticIpConfig& cfg) {
|
||||||
|
if (!netif_) {
|
||||||
|
ESP_LOGW(TAG, "applyStaticIp: no netif");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_netif_dhcpc_stop(netif_);
|
||||||
|
|
||||||
|
esp_netif_ip_info_t ip_info = {};
|
||||||
|
IP4_ADDR(&ip_info.ip, cfg.ip[0], cfg.ip[1], cfg.ip[2], cfg.ip[3]);
|
||||||
|
IP4_ADDR(&ip_info.netmask, cfg.subnet[0], cfg.subnet[1], cfg.subnet[2], cfg.subnet[3]);
|
||||||
|
IP4_ADDR(&ip_info.gw, cfg.gateway[0], cfg.gateway[1], cfg.gateway[2], cfg.gateway[3]);
|
||||||
|
|
||||||
|
esp_err_t err = esp_netif_set_ip_info(netif_, &ip_info);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
ESP_LOGE(TAG, "Failed to set static IP: %s", esp_err_to_name(err));
|
||||||
|
esp_netif_dhcpc_start(netif_);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_netif_dns_info_t dns_info = {};
|
||||||
|
IP4_ADDR(&dns_info.ip.u_addr.ip4, cfg.dns[0], cfg.dns[1], cfg.dns[2], cfg.dns[3]);
|
||||||
|
dns_info.ip.type = ESP_IPADDR_TYPE_V4;
|
||||||
|
esp_netif_set_dns_info(netif_, ESP_NETIF_DNS_MAIN, &dns_info);
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "Static IP set: %d.%d.%d.%d", cfg.ip[0], cfg.ip[1], cfg.ip[2], cfg.ip[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Eth::getIPAddress() {
|
||||||
|
if (!netif_) return "";
|
||||||
|
esp_netif_ip_info_t ip_info;
|
||||||
|
if (esp_netif_get_ip_info(netif_, &ip_info) == ESP_OK) {
|
||||||
|
char buf[16];
|
||||||
|
snprintf(buf, sizeof(buf), IPSTR, IP2STR(&ip_info.ip));
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
@ -3,15 +3,25 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include "esp_event.h"
|
#include "esp_event.h"
|
||||||
|
#include "esp_netif.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/event_groups.h"
|
#include "freertos/event_groups.h"
|
||||||
|
|
||||||
|
struct StaticIpConfig {
|
||||||
|
uint8_t ip[4];
|
||||||
|
uint8_t subnet[4];
|
||||||
|
uint8_t gateway[4];
|
||||||
|
uint8_t dns[4];
|
||||||
|
};
|
||||||
|
|
||||||
class Eth {
|
class Eth {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Eth& instance();
|
static Eth& instance();
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
void applyStaticIp(const StaticIpConfig& cfg);
|
||||||
|
std::string getIPAddress();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Eth() = default;
|
Eth() = default;
|
||||||
@ -25,4 +35,5 @@ private:
|
|||||||
|
|
||||||
bool initialized_ = false;
|
bool initialized_ = false;
|
||||||
EventGroupHandle_t ethEventGroup_ = nullptr;
|
EventGroupHandle_t ethEventGroup_ = nullptr;
|
||||||
|
esp_netif_t* netif_ = nullptr;
|
||||||
};
|
};
|
||||||
96
main/NetworkConfig.cpp
Normal file
96
main/NetworkConfig.cpp
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
#include "NetworkConfig.hpp"
|
||||||
|
#include "Hardware/Eth.hpp"
|
||||||
|
#include "Wifi.hpp"
|
||||||
|
#include "knx_facade.h"
|
||||||
|
#include "esp_log.h"
|
||||||
|
|
||||||
|
static const char* TAG = "NetworkConfig";
|
||||||
|
|
||||||
|
// Parameter offsets within the NW module's parameter block.
|
||||||
|
// These must match the offsets generated by OpenKNXproducer for the NW module.
|
||||||
|
// The producer assigns a base offset; these are relative offsets within Network.share.xml.
|
||||||
|
// After running the producer, update NW_PARAM_BASE to the assigned base offset.
|
||||||
|
|
||||||
|
static constexpr uint16_t NW_PARAM_BASE = 0; // Will be set by producer
|
||||||
|
|
||||||
|
// Byte 0: Flags
|
||||||
|
static constexpr uint16_t NW_FLAGS = NW_PARAM_BASE + 0;
|
||||||
|
static constexpr uint8_t NW_LAN_ENABLE_MASK = 0x80; // Bit 7
|
||||||
|
static constexpr uint8_t NW_LAN_STATIC_MASK = 0x40; // Bit 6
|
||||||
|
static constexpr uint8_t NW_WLAN_ENABLE_MASK = 0x20; // Bit 5
|
||||||
|
static constexpr uint8_t NW_WLAN_STATIC_MASK = 0x10; // Bit 4
|
||||||
|
|
||||||
|
// LAN IP config: bytes 1-16
|
||||||
|
static constexpr uint16_t NW_LAN_IP = NW_PARAM_BASE + 1;
|
||||||
|
static constexpr uint16_t NW_LAN_SUBNET = NW_PARAM_BASE + 5;
|
||||||
|
static constexpr uint16_t NW_LAN_GATEWAY = NW_PARAM_BASE + 9;
|
||||||
|
static constexpr uint16_t NW_LAN_DNS = NW_PARAM_BASE + 13;
|
||||||
|
|
||||||
|
// WLAN IP config: bytes 17-32
|
||||||
|
static constexpr uint16_t NW_WLAN_IP = NW_PARAM_BASE + 17;
|
||||||
|
static constexpr uint16_t NW_WLAN_SUBNET = NW_PARAM_BASE + 21;
|
||||||
|
static constexpr uint16_t NW_WLAN_GATEWAY = NW_PARAM_BASE + 25;
|
||||||
|
static constexpr uint16_t NW_WLAN_DNS = NW_PARAM_BASE + 29;
|
||||||
|
|
||||||
|
extern KnxFacade<Esp32IdfPlatform, Bau07B0> knx;
|
||||||
|
|
||||||
|
static void readIpOctets(uint16_t offset, uint8_t out[4]) {
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
out[i] = knx.paramByte(offset + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void NetworkConfig::applyFromKnx() {
|
||||||
|
if (!knx.configured()) {
|
||||||
|
ESP_LOGW(TAG, "KNX not configured, using default network settings");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t flags = knx.paramByte(NW_FLAGS);
|
||||||
|
bool lanEnabled = (flags & NW_LAN_ENABLE_MASK) != 0;
|
||||||
|
bool lanStatic = (flags & NW_LAN_STATIC_MASK) != 0;
|
||||||
|
bool wlanEnabled = (flags & NW_WLAN_ENABLE_MASK) != 0;
|
||||||
|
bool wlanStatic = (flags & NW_WLAN_STATIC_MASK) != 0;
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "Network config: LAN=%s(%s) WLAN=%s(%s)",
|
||||||
|
lanEnabled ? "on" : "off", lanStatic ? "static" : "dhcp",
|
||||||
|
wlanEnabled ? "on" : "off", wlanStatic ? "static" : "dhcp");
|
||||||
|
|
||||||
|
// Apply LAN static IP if configured
|
||||||
|
if (lanEnabled && lanStatic) {
|
||||||
|
StaticIpConfig cfg = {};
|
||||||
|
readIpOctets(NW_LAN_IP, cfg.ip);
|
||||||
|
readIpOctets(NW_LAN_SUBNET, cfg.subnet);
|
||||||
|
readIpOctets(NW_LAN_GATEWAY, cfg.gateway);
|
||||||
|
readIpOctets(NW_LAN_DNS, cfg.dns);
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "LAN static: %d.%d.%d.%d/%d.%d.%d.%d gw %d.%d.%d.%d dns %d.%d.%d.%d",
|
||||||
|
cfg.ip[0], cfg.ip[1], cfg.ip[2], cfg.ip[3],
|
||||||
|
cfg.subnet[0], cfg.subnet[1], cfg.subnet[2], cfg.subnet[3],
|
||||||
|
cfg.gateway[0], cfg.gateway[1], cfg.gateway[2], cfg.gateway[3],
|
||||||
|
cfg.dns[0], cfg.dns[1], cfg.dns[2], cfg.dns[3]);
|
||||||
|
|
||||||
|
Eth::instance().applyStaticIp(cfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize WLAN if enabled
|
||||||
|
if (wlanEnabled) {
|
||||||
|
Wifi::instance().init();
|
||||||
|
|
||||||
|
if (wlanStatic) {
|
||||||
|
StaticIpConfig cfg = {};
|
||||||
|
readIpOctets(NW_WLAN_IP, cfg.ip);
|
||||||
|
readIpOctets(NW_WLAN_SUBNET, cfg.subnet);
|
||||||
|
readIpOctets(NW_WLAN_GATEWAY, cfg.gateway);
|
||||||
|
readIpOctets(NW_WLAN_DNS, cfg.dns);
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "WLAN static: %d.%d.%d.%d/%d.%d.%d.%d gw %d.%d.%d.%d dns %d.%d.%d.%d",
|
||||||
|
cfg.ip[0], cfg.ip[1], cfg.ip[2], cfg.ip[3],
|
||||||
|
cfg.subnet[0], cfg.subnet[1], cfg.subnet[2], cfg.subnet[3],
|
||||||
|
cfg.gateway[0], cfg.gateway[1], cfg.gateway[2], cfg.gateway[3],
|
||||||
|
cfg.dns[0], cfg.dns[1], cfg.dns[2], cfg.dns[3]);
|
||||||
|
|
||||||
|
Wifi::instance().applyStaticIp(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
main/NetworkConfig.hpp
Normal file
8
main/NetworkConfig.hpp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
class NetworkConfig {
|
||||||
|
public:
|
||||||
|
static void applyFromKnx();
|
||||||
|
};
|
||||||
@ -1,9 +1,11 @@
|
|||||||
#include "Wifi.hpp"
|
#include "Wifi.hpp"
|
||||||
|
#include "Hardware/Eth.hpp"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_netif.h"
|
#include "esp_netif.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
#include "nvs.h"
|
#include "nvs.h"
|
||||||
|
#include "lwip/ip4_addr.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -61,9 +63,8 @@ void Wifi::init() {
|
|||||||
|
|
||||||
wifiEventGroup_ = xEventGroupCreate();
|
wifiEventGroup_ = xEventGroupCreate();
|
||||||
|
|
||||||
ESP_ERROR_CHECK(esp_netif_init());
|
// esp_netif_init() and esp_event_loop_create_default() are already called by Eth::init()
|
||||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
netif_ = esp_netif_create_default_wifi_sta();
|
||||||
esp_netif_create_default_wifi_sta();
|
|
||||||
|
|
||||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||||
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
|
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
|
||||||
@ -323,3 +324,42 @@ bool Wifi::getSavedPassword(const char* ssid, std::string& password) {
|
|||||||
nvs_close(handle);
|
nvs_close(handle);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Wifi::applyStaticIp(const StaticIpConfig& cfg) {
|
||||||
|
if (!netif_) {
|
||||||
|
ESP_LOGW(TAG, "applyStaticIp: no netif");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_netif_dhcpc_stop(netif_);
|
||||||
|
|
||||||
|
esp_netif_ip_info_t ip_info = {};
|
||||||
|
IP4_ADDR(&ip_info.ip, cfg.ip[0], cfg.ip[1], cfg.ip[2], cfg.ip[3]);
|
||||||
|
IP4_ADDR(&ip_info.netmask, cfg.subnet[0], cfg.subnet[1], cfg.subnet[2], cfg.subnet[3]);
|
||||||
|
IP4_ADDR(&ip_info.gw, cfg.gateway[0], cfg.gateway[1], cfg.gateway[2], cfg.gateway[3]);
|
||||||
|
|
||||||
|
esp_err_t err = esp_netif_set_ip_info(netif_, &ip_info);
|
||||||
|
if (err != ESP_OK) {
|
||||||
|
ESP_LOGE(TAG, "Failed to set static IP: %s", esp_err_to_name(err));
|
||||||
|
esp_netif_dhcpc_start(netif_);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_netif_dns_info_t dns_info = {};
|
||||||
|
IP4_ADDR(&dns_info.ip.u_addr.ip4, cfg.dns[0], cfg.dns[1], cfg.dns[2], cfg.dns[3]);
|
||||||
|
dns_info.ip.type = ESP_IPADDR_TYPE_V4;
|
||||||
|
esp_netif_set_dns_info(netif_, ESP_NETIF_DNS_MAIN, &dns_info);
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "WiFi static IP set: %d.%d.%d.%d", cfg.ip[0], cfg.ip[1], cfg.ip[2], cfg.ip[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Wifi::getIPAddress() {
|
||||||
|
if (!netif_) return "";
|
||||||
|
esp_netif_ip_info_t ip_info;
|
||||||
|
if (esp_netif_get_ip_info(netif_, &ip_info) == ESP_OK) {
|
||||||
|
char buf[16];
|
||||||
|
snprintf(buf, sizeof(buf), IPSTR, IP2STR(&ip_info.ip));
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|||||||
@ -5,14 +5,18 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include "esp_wifi.h"
|
#include "esp_wifi.h"
|
||||||
#include "esp_event.h"
|
#include "esp_event.h"
|
||||||
|
#include "esp_netif.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/event_groups.h"
|
#include "freertos/event_groups.h"
|
||||||
|
|
||||||
|
struct StaticIpConfig;
|
||||||
|
|
||||||
class Wifi {
|
class Wifi {
|
||||||
public:
|
public:
|
||||||
static Wifi& instance();
|
static Wifi& instance();
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
void applyStaticIp(const StaticIpConfig& cfg);
|
||||||
void scan(std::function<void(std::vector<wifi_ap_record_t>&)> callback);
|
void scan(std::function<void(std::vector<wifi_ap_record_t>&)> callback);
|
||||||
void connect(const char* ssid, const char* password);
|
void connect(const char* ssid, const char* password);
|
||||||
void disconnect();
|
void disconnect();
|
||||||
@ -52,4 +56,6 @@ private:
|
|||||||
|
|
||||||
static constexpr const char* NVS_NAMESPACE = "wifi_creds";
|
static constexpr const char* NVS_NAMESPACE = "wifi_creds";
|
||||||
static constexpr int MAX_SAVED_NETWORKS = 10;
|
static constexpr int MAX_SAVED_NETWORKS = 10;
|
||||||
|
|
||||||
|
esp_netif_t* netif_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
#include "KnxWorker.hpp"
|
#include "KnxWorker.hpp"
|
||||||
#include "Wifi.hpp"
|
#include "Wifi.hpp"
|
||||||
#include "Hardware/Eth.hpp"
|
#include "Hardware/Eth.hpp"
|
||||||
|
#include "NetworkConfig.hpp"
|
||||||
#include "WebServer.hpp"
|
#include "WebServer.hpp"
|
||||||
#include "SdCard.hpp"
|
#include "SdCard.hpp"
|
||||||
#include "Fonts.hpp"
|
#include "Fonts.hpp"
|
||||||
@ -22,6 +23,10 @@
|
|||||||
static void knx_task(void* arg) {
|
static void knx_task(void* arg) {
|
||||||
KnxWorker* worker = static_cast<KnxWorker*>(arg);
|
KnxWorker* worker = static_cast<KnxWorker*>(arg);
|
||||||
worker->init();
|
worker->init();
|
||||||
|
|
||||||
|
// Apply network config from KNX parameters after KNX is initialized
|
||||||
|
NetworkConfig::applyFromKnx();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
worker->loop();
|
worker->loop();
|
||||||
vTaskDelay(pdMS_TO_TICKS(10));
|
vTaskDelay(pdMS_TO_TICKS(10));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user