Commit dafefe33 authored by Kai Vogelgesang's avatar Kai Vogelgesang

Refactor PrrtPacket_type and _priority into macros

parent 223addb1
Pipeline #2988 failed with stages
in 1 minute and 29 seconds
......@@ -22,14 +22,6 @@ static void *decode_redundancy_header(void *dstBuffer, const void *srcBuffer);
static void *decode_feedback_header(void *dstBuffer, const void *srcBuffer);
prrtPacketType_t PrrtPacket_type(PrrtPacket *packet_ptr) {
return (prrtPacketType_t) ((packet_ptr->type_priority >> 4) & 0x0F);
}
uint8_t PrrtPacket_priority(PrrtPacket *packet_ptr) {
return (uint8_t) (packet_ptr->type_priority & 0x0F);
}
prrtPacketLength_t PrrtPacket_size(PrrtPacket *packet_ptr) {
return (prrtPacketLength_t) (packet_ptr->payloadLength + PRRT_PACKET_ENCODED_GENERAL_HEADER_LENGTH);
}
......
......@@ -118,9 +118,10 @@ typedef struct prrtPacketFeedbackPayload {
sizeof(prrtSequenceNumber_t) + \
sizeof(prrtPacketType_t) )
prrtPacketType_t PrrtPacket_type(PrrtPacket *packet_ptr);
uint8_t PrrtPacket_priority(PrrtPacket *packet_ptr);
#define PrrtPacket_type(packet_ptr) ((prrtPacketType_t) (((packet_ptr)->type_priority >> 4) & 0x0F))
#define PrrtPacket_priority(packet_ptr) ((uint8_t) (packet_ptr->type_priority & 0x0F))
prrtPacketLength_t PrrtPacket_size(PrrtPacket *packet_ptr);
......
Markdown is supported
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