add ignore_incoming to user preferences, for automated testing of DSR topologies

This commit is contained in:
geeksville
2020-05-23 10:01:36 -07:00
parent c9cb293bf2
commit 16812c3ee4
5 changed files with 39 additions and 8 deletions

View File

@@ -25,3 +25,13 @@ bool readcb(pb_istream_t *stream, uint8_t *buf, size_t count);
/// Write to an arduino file
bool writecb(pb_ostream_t *stream, const uint8_t *buf, size_t count);
/** is_in_repeated is a macro/function that returns true if a specified word appears in a repeated protobuf array.
* It relies on the following naming conventions from nanopb:
*
* pb_size_t ignore_incoming_count;
* uint32_t ignore_incoming[3];
*/
bool is_in_helper(uint32_t n, const uint32_t *array, pb_size_t count);
#define is_in_repeated(name, n) is_in_helper(n, name, name##_count)