mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-30 12:45:45 +00:00
sensors: gpio command
This commit is contained in:
@@ -545,7 +545,16 @@ void SensorMesh::handleCommand(uint32_t sender_timestamp, char* command, char* r
|
||||
Serial.printf("\n");
|
||||
}
|
||||
reply[0] = 0;
|
||||
} else {
|
||||
} else if (memcmp(command, "gpio ", 4) == 0) { // gpio {value}: write, gpio: read
|
||||
if (command[4] == ' ') { // it's a write
|
||||
uint32_t val;
|
||||
sscanf(&command[5], "%x", &val);
|
||||
board.setGpio(val);
|
||||
strcpy(reply, "Ok");
|
||||
} else {
|
||||
sprintf(reply, "%x", board.getGpio());
|
||||
}
|
||||
} else{
|
||||
_cli.handleCommand(sender_timestamp, command, reply); // common CLI commands
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user