diff --git a/src/pocsag/frame.c b/src/pocsag/frame.c index 858f160..40a2fe4 100644 --- a/src/pocsag/frame.c +++ b/src/pocsag/frame.c @@ -368,16 +368,12 @@ int64_t get_codeword(pocsag_t *pocsag) default: word = CODEWORD_IDLE; /* should never happen */ } - /* if message is complete, reset index. if message is not to be repeated, remove message */ + /* if message is complete, reset index and remove message */ if (msg->data_index == msg->data_length) { pocsag->current_msg = NULL; msg->data_index = 0; - if (msg->repeat) - msg->repeat--; - else { - pocsag_msg_destroy(msg); - pocsag_msg_done(pocsag); - } + pocsag_msg_destroy(msg); + pocsag_msg_done(pocsag); } /* prevent 'use-after-free' from this point on */ msg = NULL; @@ -406,13 +402,9 @@ int64_t get_codeword(pocsag_t *pocsag) msg->data_index = 0; msg->bit_index = 0; } else { - /* if message is not to be repeated, remove message */ - if (msg->repeat) - msg->repeat--; - else { - pocsag_msg_destroy(msg); - pocsag_msg_done(pocsag); - } + /* remove message */ + pocsag_msg_destroy(msg); + pocsag_msg_done(pocsag); /* prevent 'use-after-free' from this point on */ msg = NULL; } diff --git a/src/pocsag/pocsag.c b/src/pocsag/pocsag.c index a7dd8ab..163d3da 100644 --- a/src/pocsag/pocsag.c +++ b/src/pocsag/pocsag.c @@ -225,7 +225,6 @@ static pocsag_msg_t *pocsag_msg_create(pocsag_t *pocsag, uint32_t callref, uint3 msg->callref = callref; msg->ric = ric; msg->function = function; - msg->repeat = 0; memcpy(msg->data, message, message_length); msg->data_length = message_length; msg->padding = pocsag->padding; diff --git a/src/pocsag/pocsag.h b/src/pocsag/pocsag.h index 34f9cbe..1ebcd76 100644 --- a/src/pocsag/pocsag.h +++ b/src/pocsag/pocsag.h @@ -33,7 +33,6 @@ typedef struct pocsag_msg { int data_length; /* length of message that is not 0-terminated */ int data_index; /* current character transmitting */ int bit_index; /* current bit transmitting */ - int repeat; /* how often the message is sent */ char padding; /* EOT or other padding */ } pocsag_msg_t;