Broadcast status period 5min → 1min

This commit is contained in:
Juhani Krekelä 2019-07-13 19:41:35 +03:00
parent fde0630217
commit 4b63854c85
1 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@
#define EM_PROTOCOL_VERSION 0
#define EM_MESSAGE_MAX_LENGTH (1500 - 2 - 2 - 2)
#define EM_STATUS_BROADCAST_TIME (5 * 60 * 1000 + 1000 * random_byte() / 64)
#define EM_STATUS_BROADCAST_TIME (60 * 1000 + 1000 * random_byte() / 64)
#define EM_RETRANSMIT_TIME (1000 + random_byte() * 2)
#define EM_MAX_RETRANSMIT 5
@ -1028,7 +1028,7 @@ void eventloop(void) {
if (status_broadcast_wait_ms == 0) {
// The time has come to send the status broadcast
send_status(broadcast_mac);
// Do next one in about 5 minutes
// Do next one in about a minute
next_status_broadcast = ms_in_future(EM_STATUS_BROADCAST_TIME);
}
@ -1142,7 +1142,7 @@ int main(int argc, char **argv) {
// Broadcast our status to the network to let them know we're here
send_status(broadcast_mac);
// Schedule next broadcast of our status about 5 min in the future
// Schedule next broadcast of our status about 1 min in the future
next_status_broadcast = ms_in_future(EM_STATUS_BROADCAST_TIME);
// Request status from everyone, so that we can get an idea of who is on the network