2021-09-01 08:11 PM
ip4_addr_t remote_ip;
struct netconn *clientConn;
IP4_ADDR(&remote_ip, 192, 168, 0, 11);
clientConn = netconn_new(NETCONN_TCP);
if(clientConn != NULL)
{
conn_err = netconn_connect(clientConn, &remote_ip, 8789);
if(conn_err == ERR_OK)
{
netconn_write(clientConn, message, 22, NETCONN_NOFLAG);
}
}
netconn_close(clientConn);
netconn_delete(clientConn);
osDelay(10);
Ping works, TCP/IP Server also works, but the Client returns ERR_ABRT from the netconnect function.
Since the netconn API Server code worked without any problems, I think there will be no problems with hardware and settings.
So I'm looking for an example to refer to.
I found examples of non-netconn APIs and examples of netconn API Server, but I don't think there are examples of netconn API Clients. (I've seen a few, but they look the same as the code above.)
Solved! Go to Solution.
2021-09-02 01:34 AM
This issue has been resolved. I tested it with a Hercules file associated with my PC, but it was a problem because I didn't set an inbound rule.
2021-09-01 08:11 PM
The chip I use is H743VI.
2021-09-02 01:34 AM
This issue has been resolved. I tested it with a Hercules file associated with my PC, but it was a problem because I didn't set an inbound rule.