Skip to content

Instantly share code, notes, and snippets.

@amcjen
Created May 27, 2014 23:12
Show Gist options
  • Save amcjen/2218cef11d233652c4d8 to your computer and use it in GitHub Desktop.
Save amcjen/2218cef11d233652c4d8 to your computer and use it in GitHub Desktop.
static numvar meshSetKey(void) {
if (!checkArgs(1, F("usage: mesh.setkey(\"key\")"))) {
return 0;
}
char key[16] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
strncpy(key, (const char*)getstringarg(1), 16);
key[strlen((const char*)getstringarg(1))] = 0xFF; // remove null termination char
Scout.meshSetSecurityKey((const uint8_t *)key);
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment