feedback_receiver.c 500 Bytes
Newer Older
1
2
#include <string.h>
#include <unistd.h>
3
4
5
#include <defines.h>
#include <prrt/packet.h>
#include <prrt/socket.h>
6
7
8
9
10
#include "feedback_receiver.h"

void *receive_feedback_loop(void *ptr) {
    char bufin[MAX_PAYLOAD_LENGTH];

11
    PrrtSocket *sock_ptr = ptr;
12
13
14

    while(1) {
        memset(bufin, 0, MAX_PAYLOAD_LENGTH);
15
        PrrtPacket *t = PrrtSocket_recv_feedback(sock_ptr, bufin, MAX_PAYLOAD_LENGTH);
16
        if(t != NULL) {
17
            PrrtPacket_destroy(t);
18
19
20
21
        }
        usleep(1000);
    }
}