Commit 8af874a3 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Fix short feedback packets.

parent 1ba2975b
......@@ -14,7 +14,7 @@ uint8_t packet_priority(prrt_packet *packet_ptr) {
}
uint16_t packet_size(prrt_packet *packet_ptr) {
return (uint16_t) (packet_ptr->payload_len + PRRT_PACKET_GENERAL_HEADER_SIZE); // 4 = 4bit type + 4bit priority + 8 bit index + 16bit seqno
return (uint16_t) (packet_ptr->payload_len + PRRT_PACKET_GENERAL_HEADER_SIZE);
}
int print_packet(prrt_packet *packet_ptr) {
......@@ -164,7 +164,7 @@ prrt_packet *create_packet_feedback(uint8_t priority, uint8_t index, uint16_t se
payload->buffer_feedback = buffer_feedback;
packet_ptr->payload = (void*) payload;
packet_ptr->payload_len = (uint32_t) (sizeof(prrt_packet_source_payload));
packet_ptr->payload_len = (uint32_t) (sizeof(prrt_packet_feedback_payload));
return packet_ptr;
}
\ No newline at end of file
......@@ -126,7 +126,6 @@ prrt_packet *prrt_recv(prrt_socket *sock_ptr) {
uint32_t addr = get_ip_from_socket(sock_ptr->fd_data);
printf("%d\n");
prrt_packet* feedback_pkt_ptr = create_packet_feedback(0, 19, 4715, addr, 5, 0, 50, 0, 0, 0, 0, 5, 1);
uint8_t buf[MAX_PAYLOAD_LENGTH];
uint32_t length = packet_size(feedback_pkt_ptr);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment