Hello,
I am using this open source FreeRTOS+TCP library in my FreeRTOS project. I followed the porting steps, as well as configuration steps. Apart from this i have written my Network interface part. I want to create socket and send messages from that. basically i want to test the working of the APIs. socket creation is done successfully, but when i m calling FreeRTOS_bind to bind the socket, its returning error - pdFREERTOS_ERRNO_EINVAL.
This is how I m calling the function.
xRemoteAddress.sin_port = FreeRTOS_htons( 15000);
xRemoteAddress.sin_addr = FreeRTOS_inet_addr_quick( 192, 168, 0, 200 );
socklen_t xSize = sizeof( xRemoteAddress );
retv = FreeRTOS_bind( xSocket, &xRemoteAddress, xSize );
printf("\nBind val %d\n",retv); // -22 is coming
And as I debugged this value is coming from the below line in function.
if (!socketSOCKET_IS_BOUND(pxSocket)) {
xReturn = -pdFREERTOS_ERRNO_EINVAL;
}
// this is last line of the function.
Please let me know if i am doing something wrong or something I m missing.
Thanks & Regards
Priyanka