Skip to content

Instantly share code, notes, and snippets.

@Girgitt
Created November 14, 2017 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Girgitt/bc1f16011fdfeb9de9de947c8918d171 to your computer and use it in GitHub Desktop.
Save Girgitt/bc1f16011fdfeb9de9de947c8918d171 to your computer and use it in GitHub Desktop.
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