gnrc_gomach: add sender ID number limit in beacon packet.
This commit is contained in:
parent
0454491e58
commit
cebc995ec3
@ -276,6 +276,19 @@ extern "C" {
|
|||||||
#define GNRC_GOMACH_MAX_ALLOC_SLOTS_NUM (25U)
|
#define GNRC_GOMACH_MAX_ALLOC_SLOTS_NUM (25U)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Maximum number of senders allowed to be allocated slots in one cycle.
|
||||||
|
*
|
||||||
|
* Exclude the static GoMacH MAC header payload in the beacon, which is 20 bytes,
|
||||||
|
* we have 107 bytes left for constructing the sender-ID list and the related slots-number
|
||||||
|
* list. A combined slots allocation information pair (sender ID with its corresponded
|
||||||
|
* allocate slots number) will cost 9 (8+1) bytes, thus we can hold a maximum of 11
|
||||||
|
* i.e., ((127 - 20) / 9), sender IDs in the beacon.
|
||||||
|
*/
|
||||||
|
#ifndef GNRC_GOMACH_MAX_ALLOC_SENDER_NUM
|
||||||
|
#define GNRC_GOMACH_MAX_ALLOC_SENDER_NUM (11U)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Maximum t2k attempts before going to t2u in GoMacH.
|
* @brief Maximum t2k attempts before going to t2u in GoMacH.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -488,7 +488,13 @@ int gnrc_gomach_send_beacon(gnrc_netif_t *netif)
|
|||||||
total_tdma_slot_num -= redueced_slots_num;
|
total_tdma_slot_num -= redueced_slots_num;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
|
|
||||||
|
/* If reach the maximum sender ID number limit, stop. */
|
||||||
|
if (total_tdma_node_num >= GNRC_GOMACH_MAX_ALLOC_SENDER_NUM) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user