![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
EthW5500+STM32
Dependencies: MQTT WIZnet_Library mbed
Fork of EthW5500 by
Diff: ETHW5500.cpp
- Revision:
- 3:54ad271708ff
- Parent:
- 2:566a6b762cdf
- Child:
- 4:10f83daba9ea
--- a/ETHW5500.cpp Thu Apr 19 13:57:24 2018 +0000 +++ b/ETHW5500.cpp Fri Apr 20 01:37:27 2018 +0000 @@ -30,14 +30,19 @@ printf("DHCP...\r\n"); wiz.connect(); printf("IP: %s\r\n", wiz.getIPAddress()); + return ret; +} +int Eth_ConnectToSer(char *URL) +{ + int ret; int timecount=1; - ret = sock.connect("tdxls-iot.xicp.net",1883); + ret = sock.connect(URL,1883); //printf("%d-th Server connetion attemp\n",timecount); while(ret!=0){ timecount++; //printf("%d-th Server connetion attemp\n",timecount); - ret = sock.connect("tdxls-iot.xicp.net",1883); + ret = sock.connect(URL,1883); if(timecount>20){ printf("failed to connet Server,Please Check out and Reset\n"); return 1; @@ -52,6 +57,7 @@ } printf("client.connect()=%d\r\n",ret); return ret; + } int Eth_Subscribe(const char* ns,const char *NODE_NAME, const char* type)