sendMessage method
- Message message, {
- bool checkVersion = true,
Sends a command over the network or over Serial.
Implementation
void sendMessage(Message message, {bool checkVersion = true}) {
final shouldCheck = checkVersion && models.settings.dashboard.versionChecking;
if (shouldCheck && !models.rover.metrics.isSupportedVersion(message)) {
if (models.rover.isConnected) {
models.home.setMessage(severity: Severity.error, text: "Rover has the wrong ${message.messageName} version!");
}
return;
}
models.serial.sendMessage(message);
models.sockets.data.sendMessage(message);
}