From 9d1a342b0c1af950567d8830c0ef46d223d7fb70 Mon Sep 17 00:00:00 2001 From: Tim Niemeyer Date: Mon, 2 Apr 2018 22:11:07 +0200 Subject: [PATCH] set the prio --- macstorage.c | 34 ++++++++++++++++++++++++++++++++-- tc.c | 20 ++++++++++---------- tc.h | 4 ++-- 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/macstorage.c b/macstorage.c index e88e460..3813b47 100644 --- a/macstorage.c +++ b/macstorage.c @@ -16,12 +16,33 @@ struct Entry { uint8_t mac[6]; time_t timestamp; + uint8_t prio; } storage[MAXENTRIES]; +uint8_t usedPrio[MAXENTRIES]; + size_t count = 0; pthread_mutex_t mux; +uint8_t _getNextFreePrio() +{ + for (size_t i=0; i