Hello all,
I am attempting to get my CC300 to send a small bit of data to a linux box. I know my CC3000 is connected to my AP because I can ping it. I also know that it is opening up a connection with the linux box because I can see it do so with python and socket. For some reason, my code is hanging up on send(). I am running this code in the main() of the basic wifi example. Am I doing something wrong?
...
int s = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(s != -1)
{
turnLedOn(1);
}
tRemoteAddr.sa_family = AF_INET;
tRemoteAddr.sa_data[0] = (port & 0xFF00) >> 8;
tRemoteAddr.sa_data[1] = (port & 0x00FF);
tRemoteAddr.sa_data[2] = 192;
tRemoteAddr.sa_data[3] = 168;
tRemoteAddr.sa_data[4] = 3;
tRemoteAddr.sa_data[5] = 24;
res = connect(s, &tRemoteAddr, sizeof(tRemoteAddr));
if(res == 0)
{
turnLedOn(2);
}
char buf[150];
memset(buf, 0, 150);
memcpy(buf, "hello test", sizeof("hello test"));
__delay_cycles(2000);
send(s, buf, sizeof(buf), 0);
turnLedOn(3);
__delay_cycles(8000);
closesocket(s);
turnLedOn(4);
I appreciate any advice. Thanks!