Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of WIZnetInterface by
Revision 31:fc14e4330419, committed 2016-11-04
- Comitter:
- jh_ndm
- Date:
- Fri Nov 04 07:38:07 2016 +0000
- Parent:
- 30:6feeaebad180
- Commit message:
- asdfwe
Changed in this revision
--- a/Socket/Endpoint.cpp Fri Nov 04 02:28:28 2016 +0000
+++ b/Socket/Endpoint.cpp Fri Nov 04 07:38:07 2016 +0000
@@ -34,14 +34,16 @@
int Endpoint::set_address(const char* host, const int port)
{
//Resolve DNS address or populate hard-coded IP address
+ Serial pc6(PA_13,PA_14);
+ pc6.printf("In set_address\r\n");
WIZnet_Chip* eth = WIZnet_Chip::getInstance();
if (eth == NULL) {
- error("Endpoint constructor error: no WIZnet chip instance available!\r\n");
+ pc6.printf("Endpoint constructor error: no WIZnet chip instance available!\r\n");
return -1;
}
uint32_t addr;
if (!eth->gethostbyname(host, &addr)) {
- error("DNS error : Cannot get url from DNS server\r\n");
+ pc6.printf("DNS error : Cannot get url from DNS server\r\n");
return -1;
}
snprintf(_ipAddress, sizeof(_ipAddress), "%d.%d.%d.%d", (addr>>24)&0xff, (addr>>16)&0xff, (addr>>8)&0xff, addr&0xff);
--- a/Socket/TCPSocketConnection.cpp Fri Nov 04 02:28:28 2016 +0000
+++ b/Socket/TCPSocketConnection.cpp Fri Nov 04 07:38:07 2016 +0000
@@ -32,34 +32,41 @@
int TCPSocketConnection::connect(const char* host, const int port)
{
Serial pc5(PA_13,PA_14);
- pc5.baud(115200);
+
pc5.printf("in connect\r\n");
if (_sock_fd < 0) {
+ pc5.printf("_sock_fd\r\n");
_sock_fd = eth->new_socket();
+ pc5.printf("_sock_fd2\r\n");
if (_sock_fd < 0) {
pc5.printf("in connect 1 return -1\r\n");
return -1;
}
}
+ pc5.printf("in2 connect\r\n");
+
if (set_address(host, port) != 0) {
pc5.printf("in connect 2 return -1\r\n");
return -1;
}
+
+ pc5.printf("in3 connect\r\n");
if (!eth->connect(_sock_fd, get_address(), port)) {//should jion the timeout
pc5.printf("in connect 3 return -1\r\n");
return -1;
}
+ pc5.printf("in4 connect\r\n");
set_blocking(false);
// add code refer from EthernetInterface.
_is_connected = true;
-
+ pc5.printf("_is_connected=true\r\n");
return 0;
}
bool TCPSocketConnection::is_connected(void)
{
Serial pc2(PA_13,PA_14);
- pc2.baud(115200);
+
pc2.printf("in is_connected()\r\n");
// force update recent state.
_is_connected = eth->is_connected(_sock_fd);
--- a/arch/int/W7500x_toe.cpp Fri Nov 04 02:28:28 2016 +0000
+++ b/arch/int/W7500x_toe.cpp Fri Nov 04 07:38:07 2016 +0000
@@ -155,7 +155,7 @@
}
*/
Serial pc4(PA_13,PA_14);
- pc4.baud(115200);
+
pc4.printf("in isconnected4\r\n");
uint8_t tmpSn_SR;
tmpSn_SR = sreg<uint8_t>(socket, Sn_SR);
