mirror of
https://github.com/szehl/ath9k-hmac.git
synced 2024-12-18 21:37:51 +00:00
Send new NL message only if it differes from last message
This commit is contained in:
parent
a36fda902c
commit
89161d05af
@ -335,6 +335,7 @@ timeout_cb(evutil_socket_t fd, short event, void *arg)
|
|||||||
struct timeval newtime, difference;
|
struct timeval newtime, difference;
|
||||||
struct event *timeout = (struct event *)arg;
|
struct event *timeout = (struct event *)arg;
|
||||||
long error = 0;
|
long error = 0;
|
||||||
|
int oldFrameNum = 0;
|
||||||
|
|
||||||
if (isRunning == 0) {
|
if (isRunning == 0) {
|
||||||
printf("Terminating ...\n");
|
printf("Terminating ...\n");
|
||||||
@ -384,8 +385,25 @@ timeout_cb(evutil_socket_t fd, short event, void *arg)
|
|||||||
|
|
||||||
event_add(timeout, &tv);
|
event_add(timeout, &tv);
|
||||||
oldtime_l = newtime_l;
|
oldtime_l = newtime_l;
|
||||||
|
if(relFrameNum == 0)
|
||||||
send_nl_msg(schedule_per_slot[relFrameNum]);
|
{
|
||||||
|
oldFrameNum = slotsPerFrame-1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
oldFrameNum = relFrameNum-1;
|
||||||
|
}
|
||||||
|
//printf("#%d: %s, ", relFrameNum, schedule_per_slot[relFrameNum].c_str());
|
||||||
|
//printf("#%d: %s, ", oldFrameNum, schedule_per_slot[oldFrameNum].c_str());
|
||||||
|
if(schedule_per_slot[relFrameNum] != schedule_per_slot[oldFrameNum])
|
||||||
|
{
|
||||||
|
//std::cout << "Sending_schedule" << std::endl;
|
||||||
|
send_nl_msg(schedule_per_slot[relFrameNum]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//std::cout << "Not sending schedule" << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user