Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
C++ char[] and String equality test function
static bool payload_str_equality(const uint8_t *n_one, String cmp_str, uint16_t length) {
char cmd_check[length + 1];
cmp_str.toCharArray(cmd_check, length + 1);
for (uint8_t i = 0; i < length; i++)
if (n_one[i] != cmd_check[i])
return false;
return true;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment