mirror of
https://github.com/espressif/openthread.git
synced 2026-09-03 15:50:06 +00:00
[code-utils] adding helper macro OT_ARRAY_LENGTH() (#2743)
This commit adds helper macro `OT_ARRAY_LENGTH()` to get the number of elements in an array.
This commit is contained in:
committed by
Jonathan Hui
parent
ae7984d3a7
commit
2abd7a2822
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <openthread/openthread.h>
|
||||
|
||||
#include "common/code_utils.hpp"
|
||||
#include "common/debug.hpp"
|
||||
#include "mac/mac.hpp"
|
||||
#include "mac/mac_frame.hpp"
|
||||
@@ -68,7 +69,7 @@ void TestMacHeader(void)
|
||||
Mac::Frame::kSecMic32 | Mac::Frame::kKeyIdMode2, 19},
|
||||
};
|
||||
|
||||
for (unsigned i = 0; i < sizeof(tests) / sizeof(tests[0]); i++)
|
||||
for (unsigned i = 0; i < OT_ARRAY_LENGTH(tests); i++)
|
||||
{
|
||||
uint8_t psdu[Mac::Frame::kMTU];
|
||||
Mac::Frame frame;
|
||||
|
||||
Reference in New Issue
Block a user