added for loop for sending 5 times first time

pull/105/head
alanbjohnston 5 years ago committed by GitHub
parent 33df7a7455
commit 3d830067db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2195,27 +2195,20 @@ void get_tlm_fox() {
// if ((mode == BPSK) && (firstTime == 1)) // only do first time // if ((mode == BPSK) && (firstTime == 1)) // only do first time
if (firstTime == 1) // only do first time if (firstTime == 1) // only do first time
{ {
start = millis(); // send frame three times for (int times = 0; times < 6; times++)
sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); {
printf("socket send 3 %d ms bytes: %d \n\n", (unsigned int)millis() - start, sock_ret); start = millis(); // send frame three times
sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0);
if (sock_ret < (ctr * 2 + 2)) { printf("socket send %d in %d ms bytes: %d \n\n",times, (unsigned int)millis() - start, sock_ret);
// printf("Not resending\n");
sleep(0.5); if (sock_ret < (ctr * 2 + 2)) {
sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); // printf("Not resending\n");
printf("socket send 4 %d ms bytes: %d \n\n", millis() - start, sock_ret); sleep(0.5);
} sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0);
start = millis(); // send frame twice printf("socket resend %d in %d ms bytes: %d \n\n",times, millis() - start, sock_ret);
sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); }
printf("socket send 5 %d ms bytes: %d \n\n", (unsigned int)millis() - start, sock_ret); }
if (sock_ret < (ctr * 2 + 2)) {
// printf("Not resending\n");
sleep(0.5);
sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0);
printf("socket send 6 %d ms bytes: %d \n\n", millis() - start, sock_ret);
}
} }
if (sock_ret == -1) { if (sock_ret == -1) {

Loading…
Cancel
Save

Powered by TurnKey Linux.