Hello
I am using stm32 discovery board and trying to implement a TCP Client application.In the following code, I am using netIP_aton function to convert the network address in binary.But the function fails to convert it and returns a false value.Can anyone please help me out? Here is the main code
int main (void) { uint8_t ip_addr[NET_ADDR_IP4_LEN]; NET_ADDR addr = { NET_ADDR_IP4,1000,192,168,0,100}; netStatus status; MPU_Config(); CPU_CACHE_Enable(); HAL_Init(); SystemClock_Config(); status= netInitialize(); printf("Connected\n"); netIP_aton(buffer, NET_ADDR_IP6, &ip_addr[0]); tcp_sock = netTCP_GetSocket (tcp_cb_client); if(tcp_sock<0) { printf("socket get failed\n"); } else if(tcp_sock>0) { printf("socket number = %d\n",tcp_sock); } netIP_aton(buffer, NET_ADDR_IP4, &ip_addr[0]); osDelay(10); if(x==true) printf("conversion successfull"); else if(x==false) printf("conversion failed"); printf("The ip address in binary form is %d.%d.%d.%d",ip_addr[0],ip_addr[1],ip_addr[2],ip_addr[3]); netTCP_Connect (tcp_sock, (NET_ADDR*)&addr, 0); osDelay(500); printf("connecting to socket"); for(;;) { switch(netTCP_GetState(tcp_sock)){ case netTCP_StateCLOSED: case netTCP_StateUNUSED: // Failed to connect to TCP socket server printf("connection not made yet\n"); return 0; case netTCP_StateESTABLISHED: // Connected, socket is ready to send data printf("connection has been made successfully"); break; } osDelay(10); } }