Browse Source

* companion: new CMD_SET_FLOOD_SCOPE (54)

pull/1068/head
Scott Powell 7 months ago
parent
commit
937865c8fd
  1. 8
      examples/companion_radio/MyMesh.cpp

8
examples/companion_radio/MyMesh.cpp

@ -50,6 +50,7 @@
#define CMD_SEND_BINARY_REQ 50
#define CMD_FACTORY_RESET 51
#define CMD_SEND_PATH_DISCOVERY_REQ 52
#define CMD_SET_FLOOD_SCOPE 54
#define RESP_CODE_OK 0
#define RESP_CODE_ERR 1
@ -1515,6 +1516,13 @@ void MyMesh::handleCmdFrame(size_t len) {
} else {
writeErrFrame(ERR_CODE_FILE_IO_ERROR);
}
} else if (cmd_frame[0] == CMD_SET_FLOOD_SCOPE && len >= 2 && cmd_frame[1] == 0) {
if (len >= 2 + 16) {
memcpy(send_scope.key, &cmd_frame[2], sizeof(send_scope.key)); // set curr scope TransportKey
} else {
memset(send_scope.key, 0, sizeof(send_scope.key)); // set scope to null
}
writeOKFrame();
} else {
writeErrFrame(ERR_CODE_UNSUPPORTED_CMD);
MESH_DEBUG_PRINTLN("ERROR: unknown command: %02X", cmd_frame[0]);

Loading…
Cancel
Save