void data_transfer(void) { //A TCP connection is already active at this point. unsigned long Data16 = 2147483647; for(cch = 0; cch < (1440)/2; cch++)
//1440 bytes of maximum transfers on the cc3000, Data16 has the size of 2 byte. { Storage[cch] = Data16; } Int_Data = (unsigned long *)&Storage; DataLength = 1440; for(c = 0; c<500; c++) //Transfer 500 packages with the total size of 720Kb { send(SOCKETClientTCP, (unsigned long*)Int_Data, DataLength, 0); } // CLEAR THE MEM BUFFERT memset(Storage, 0x00, sizeof(Storage)); memset(Int_Data, 0x00, sizeof(Int_Data)); free(Storage); free(Int_Data); //It is possible to run this function one time but on the second time it hangs up after a total of 769 transfers. //I can also change the amount of packages to 100 and it will then hang up on the 8th iteration. //The program stops in the function get_socket_active_status(long Sd) in evnt_handler.c every time. }
Am I missing a step when it comes to clearing a internal buffer in the CC3000 some how?