Skip to content

Commit

Permalink
send frame 3 times
Browse files Browse the repository at this point in the history
  • Loading branch information
alanbjohnston authored Jun 18, 2021
1 parent 9e9cf30 commit 33df7a7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion afsk/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,7 @@ void get_tlm_fox() {
// if ((mode == BPSK) && (firstTime == 1)) // only do first time
if (firstTime == 1) // only do first time
{
start = millis(); // send frame twice
start = millis(); // send frame three 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);

Expand All @@ -2206,6 +2206,16 @@ void get_tlm_fox() {
sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0);
printf("socket send 4 %d ms bytes: %d \n\n", millis() - start, sock_ret);
}
start = millis(); // send frame twice
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) {
Expand Down

0 comments on commit 33df7a7

Please sign in to comment.