summaryrefslogtreecommitdiff
path: root/lora_pkt_fwd/src/jitqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'lora_pkt_fwd/src/jitqueue.c')
-rw-r--r--lora_pkt_fwd/src/jitqueue.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lora_pkt_fwd/src/jitqueue.c b/lora_pkt_fwd/src/jitqueue.c
index dbde8d2..f1b547b 100644
--- a/lora_pkt_fwd/src/jitqueue.c
+++ b/lora_pkt_fwd/src/jitqueue.c
@@ -37,6 +37,7 @@ Maintainer: Michael Coracin
#define TX_MARGIN_DELAY 1000 /* Packet overlap margin in microseconds */
/* TODO: How much margin should we take? */
#define TX_JIT_DELAY 30000 /* Pre-delay to program packet for TX in microseconds */
+#define TX_PEEK_DELAY 60000 /* Look ahead time for TX in microseconds */
#define TX_MAX_ADVANCE_DELAY ((JIT_NUM_BEACON_IN_QUEUE + 1) * 128 * 1E6) /* Maximum advance delay accepted for a TX packet, compared to current time */
#define BEACON_GUARD 3000000 /* Interval where no ping slot can be placed,
@@ -352,12 +353,12 @@ enum jit_error_e jit_dequeue(struct jit_queue_s *queue, int index, struct lgw_pk
memset(&(queue->nodes[queue->num_pkt]), 0, sizeof(struct jit_node_s));
/* Sort queue in ascending order of packet timestamp */
- jit_sort_queue(queue);
+ // jit_sort_queue(queue);
/* Done */
pthread_mutex_unlock(&mx_jit_queue);
- jit_print_queue(queue, false, DEBUG_JIT);
+ // jit_print_queue(queue, false, DEBUG_JIT);
MSG_DEBUG(DEBUG_JIT, "dequeued packet with count_us=%u from index %d\n", packet->count_us, index);
@@ -427,7 +428,7 @@ enum jit_error_e jit_peek(struct jit_queue_s *queue, struct timeval *time, int *
* Warning: unsigned arithmetic (handle roll-over)
* t_packet < t_current + TX_JIT_DELAY
*/
- if ((queue->nodes[idx_highest_priority].pkt.count_us - time_us) < TX_JIT_DELAY) {
+ if ((queue->nodes[idx_highest_priority].pkt.count_us - time_us) < TX_PEEK_DELAY) {
*pkt_idx = idx_highest_priority;
MSG_DEBUG(DEBUG_JIT, "peek packet with count_us=%u at index %d\n",
queue->nodes[idx_highest_priority].pkt.count_us, idx_highest_priority);