nx_tcp_client_socket_connect failure

Hi,

I am trying to connect to a TCP server as follows,

status = nx_tcp_client_socket_connect(&net->my_socket, SERVER_IP_ADDRESS  , SOC_SERVER_PORT , NX_WAIT_FOREVER);

where, 

#define SERVER_IP_ADDRESS  (IP_ADDRESS(85,119,83,194))

and 

#define SOC_SERVER_PORT 1883

But the API is returning the value 33. Where i will get the error code definition of the API?

What may be the issue?

Thank you,

  • Hi,

    Try the User's manual: www.rtos.com/.../NetX_User_Guide.pdf

    Search for your API call nx_tcp_client_socket_connect. You will find the return value. hex(33) = 0x21 Implying: Invalid server IP address.

    Also, please move this topic out of the Bluetooth forum (if applicable).

  • In reply to O. R.:

    Hi O.R.

    Thanks for the valuable reply.

    I have a client running with the ip address : 192.168.3.127 and it is trying to connect 85.119.83.194 as specified before.

    Following are the scenarios which i tried,

    1)Cross connection to PC with static ip (85.119.83.194) and Board (85.119.83.195). In this case, board is able to connect and speak with the server. ARP request is going followed by TCP connect request. Result Success.

    2)Connection to global network, and connect request to some other cloud (85.119.83.194) with Board ip (192.168.3.127). Result Failure.

    In the scenario 2, I am not able to see any packets in the wireshark. Before the actual connect packet, i think DNS request must go from the Board, which is not Happening in my case.

    Can you please suggest regarding this? Do i need to enable something on board side?

    Thank you.