Created
November 14, 2017 10:19
-
-
Save Girgitt/bc1f16011fdfeb9de9de947c8918d171 to your computer and use it in GitHub Desktop.
C++ char[] and String equality test function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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