Skip to content

Commit b4b2fb6

Browse files
committed
#491 some fixes for client remote
1 parent e8d7c0f commit b4b2fb6

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

xmlPlugins/core-remote/clientRemoteEthernet.xml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<ImageFile>ethernet-shield.jpg</ImageFile>
1616

1717
<Properties>
18-
<Property id="ETH_LIBRARY_TYPE" name="Ethernet library type" desc="Choose the library that supports your hardware" initial="ETHERNET_2" type="choice">
18+
<Property id="CLIP_ETH_LIBRARY_TYPE" name="Ethernet library type" desc="Choose the library that supports your hardware" initial="ETHERNET_2" type="choice">
1919
<Choices>
2020
<Choice desc="Ethernet 2">ETHERNET_2</Choice>
2121
<Choice desc="UIP Ethernet">UIP_ENC28J60</Choice>
@@ -24,26 +24,34 @@
2424
<Choice desc="ESP8266 Arduino">ESP8266_WIFI</Choice>
2525
</Choices>
2626
</Property>
27-
<Property id="REMOTE_IP_ADDRESS" name="IP Address of the server" initial="127.0.0.1" type="text"
27+
<Property id="CLIP_ADDR_TYPE" name="How to interpret the address field" initial="hardwired" type="choice"
28+
desc="The provided address can either be hardwired, a variable or compiler definition">
29+
<Choices>
30+
<Choice desc="Address is a hardwired string">hardwired</Choice>
31+
<Choice desc="Address is a variable in my code">variable</Choice>
32+
<Choice desc="Address is a compiler definition">flag</Choice>
33+
</Choices>
34+
</Property>
35+
<Property id="CLIP_REMOTE_ADDRESS" name="Address of the server" initial="127.0.0.1" type="text"
2836
desc="The IP address of the server to connect to."/>
29-
<Property id="REMOTE_PORT" name="Remote Port" initial="3333" desc="The port on which the server is listening"
37+
<Property id="CLIP_REMOTE_PORT" name="Remote Port" initial="3333" desc="The port on which the server is listening"
3038
type="int" min="0" max="65355"/>
3139
</Properties>
3240

3341
<ApplicabilityDefs>
3442
</ApplicabilityDefs>
3543

3644
<SourceFiles>
37-
<Replacement find="Ethernet.h" replace="STM32Ethernet.h" whenProperty="ETH_LIBRARY_TYPE" isValue="STM32ETHERNET"/>
38-
<Replacement find="Ethernet.h" replace="UIPEthernet.h" whenProperty="ETH_LIBRARY_TYPE" isValue="UIP_ENC28J60"/>
39-
<Replacement find="Ethernet.h" replace="WiFi.h" whenProperty="ETH_LIBRARY_TYPE" isValue="ESP32_WIFI"/>
40-
<Replacement find="Ethernet.h" replace="ESP8266WiFi.h" whenProperty="ETH_LIBRARY_TYPE" isValue="ESP8266_WIFI"/>
45+
<Replacement find="Ethernet.h" replace="STM32Ethernet.h" whenProperty="CLIP_ETH_LIBRARY_TYPE" isValue="STM32ETHERNET"/>
46+
<Replacement find="Ethernet.h" replace="UIPEthernet.h" whenProperty="CLIP_ETH_LIBRARY_TYPE" isValue="UIP_ENC28J60"/>
47+
<Replacement find="Ethernet.h" replace="WiFi.h" whenProperty="CLIP_ETH_LIBRARY_TYPE" isValue="ESP32_WIFI"/>
48+
<Replacement find="Ethernet.h" replace="ESP8266WiFi.h" whenProperty="CLIP_ETH_LIBRARY_TYPE" isValue="ESP8266_WIFI"/>
4149

42-
<Replacement find="EthernetClient" replace="UIPClient" whenProperty="ETH_LIBRARY_TYPE" isValue="UIP_ENC28J60"/>
43-
<Replacement find="EthernetServer" replace="UIPServer" whenProperty="ETH_LIBRARY_TYPE" isValue="UIP_ENC28J60"/>
50+
<Replacement find="EthernetClient" replace="UIPClient" whenProperty="CLIP_ETH_LIBRARY_TYPE" isValue="UIP_ENC28J60"/>
51+
<Replacement find="EthernetServer" replace="UIPServer" whenProperty="CLIP_ETH_LIBRARY_TYPE" isValue="UIP_ENC28J60"/>
4452

45-
<Replacement find="EthernetClient" replace="WiFiClient" whenProperty="ETH_LIBRARY_TYPE" matches="ESP.*"/>
46-
<Replacement find="EthernetServer" replace="WiFiServer" whenProperty="ETH_LIBRARY_TYPE" matches="ESP.*"/>
53+
<Replacement find="EthernetClient" replace="WiFiClient" whenProperty="CLIP_ETH_LIBRARY_TYPE" matches="ESP.*"/>
54+
<Replacement find="EthernetServer" replace="WiFiServer" whenProperty="CLIP_ETH_LIBRARY_TYPE" matches="ESP.*"/>
4755

4856
<SourceFile name="ethernetSrc/ClientEthernetTransport.cpp"/>
4957
<SourceFile name="ethernetSrc/ClientEthernetTransport.h"/>
@@ -55,10 +63,16 @@
5563
</IncludeFiles>
5664

5765
<GlobalVariables>
58-
<Variable name="clientEthInit" type="ClientEthernetInitialisation" export="true">
59-
<Param value='"${REMOTE_IP_ADDRESS}"' />
60-
<Param value="${REMOTE_PORT}" />
66+
<Variable name="${CLIP_REMOTE_ADDRESS}" type="const char*" export="only" whenProperty="CLIP_ADDR_TYPE" isValue="variable"/>
67+
<Variable name="clientEthInit" type="ClientEthernetInitialisation" export="true" whenProperty="CLIP_ADDR_TYPE" isValue="hardwired">
68+
<Param value='"${CLIP_REMOTE_ADDRESS}"' />
69+
<Param value="${CLIP_REMOTE_PORT}" />
70+
</Variable>
71+
<Variable name="clientEthInit" type="ClientEthernetInitialisation" export="true" whenProperty="CLIP_ADDR_TYPE" isNotValue="hardwired">
72+
<Param value="${CLIP_REMOTE_ADDRESS}" />
73+
<Param value="${CLIP_REMOTE_PORT}" />
6174
</Variable>
75+
6276
<Variable name="clientEthTransport" type="ClientEthernetTagValTransport" export="true"/>
6377
<Variable name="clientConnection" type="TagValueRemoteServerConnection" export="false">
6478
<Param value="clientEthTransport"/>

0 commit comments

Comments
 (0)