We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I tried to convert the LEDClient example project to send data to my server. But the problem I have is that I can't send more than 4 bytes.
Here's my code
case TCP_STATE_CONNECT: if (tcp_check_send (socket_tcp) == __TRUE) { //normal //sendbuf = tcp_get_buf(SENDLEN); //sendbuf[0] = BLINKLED; //sendbuf[1] = p2; //tcp_send (socket_tcp, sendbuf, SENDLEN); //changed code sendbuf = tcp_get_buf(7); sendbuf[0]=1; sendbuf[1]=20; sendbuf[2]=111; sendbuf[3]=213; sendbuf[4]=0; sendbuf[5]=88; sendbuf[6]=99; tcp_send (socket_tcp, sendbuf, 7);
Don't know why it will not send more than 4 bytes. Anyone who does know???
If this works, then I can adopt this project to work with my RTX Kernel...
The callback function, you hand over with tcp_get_socket , is called by the tcp_poll task. If you want to handle the events in a different task you should hand it over in an appropriate way, e.g. mailbox.
When the callback function isn't called, you have either a missconfigured stack or you didn't use it in the correct way. 1. tcp_get_socket 2. tcp_connect 3. tcp_send Do you check the return codes of these functions? Maybe tcp_get_socket doesn't work due to a lag of available sockets?
If the LED example is working, take this as a start and change it according your needs to learn how everything is working.
Ok, I'm a step closer now. I found out that with my own made program (which is composed out of LEDClient en HTTP RTX example) doesn't get connection with my network. My board is not recognised on the network, it gets no IP. When I load the LEDCLient and I search my network for PC's I can see my board with the IP address I gave it.
But with my project this isn't the case. So I think something goes wrong with Init_TCPNet() or with Main_TcpNet(). Stack sizes and Net_config.c file is the same as the HTTP example.
What can go wrong here? I'm just calling these functions as I should do, I think so?
It sounds like you want to assign a static IP address to your device. As far as I now, the HTTP example worked with enabled DHCP Client. Maybe that's the reason, you couldn't find it in the network.
I think you should double check all the options in Net_config.c.
Did you ever analysed the debug output from the debug version of RL Libary?
Here the link to the manual: http://www.keil.com/support/man/docs/rlarm/rlarm_tn_debug.htm