Remove .vscode, improve logging

This commit is contained in:
Kevin David committed 2023-01-24 23:46:40 -05:00
1 parent 8cbaf06cde
commit 6be7ac2d14
3 files changed
+12 -26

No files matched your search

-18
View File
@@ -1,18 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceRoot}/target/debug/${workspaceRootFolderName}",
"args": ["mqtt", "--config", "target/config.toml"],
"cwd": "${workspaceRoot}",
"sourceLanguages": [
"rust"
],
"env": {
"RUST_LOG": "debug"
}
}
]}
+6 -4
View File
@@ -266,8 +266,9 @@ impl MessageHandler {
}
}
Messages::FloodlightOn => {
if self.camera.floodlight_light_set(true, 180).is_err() {
error!("Failed to turn on the floodlight light");
let res = self.camera.floodlight_light_set(true, 180);
if res.is_err() {
error!("Failed to turn on the floodlight light: {:?}", res.err());
self.abort();
"FAIL".to_string()
} else {
@@ -275,8 +276,9 @@ impl MessageHandler {
}
}
Messages::FloodlightOff => {
if self.camera.floodlight_light_set(false, 180).is_err() {
error!("Failed to turn off the floodlight light");
let res = self.camera.floodlight_light_set(false, 180);
if res.is_err() {
error!("Failed to turn off the floodlight light: {:?}", res.err());
self.abort();
"FAIL".to_string()
} else {
+6 -4
View File
@@ -152,16 +152,18 @@ fn listen_on_camera(
topic: "control/floodlight",
message: "on",
} => {
if event_cam.send_message(Messages::FloodlightOn).is_err() {
error!("Failed to set floodlight on");
let res = event_cam.send_message(Messages::FloodlightOn);
if res.is_err() {
error!("Failed to set floodlight on: {:?}", res.err());
}
}
MqttReplyRef {
topic: "control/floodlight",
message: "off",
} => {
if event_cam.send_message(Messages::FloodlightOff).is_err() {
error!("Failed to set floodlight off");
let res = event_cam.send_message(Messages::FloodlightOff);
if res.is_err() {
error!("Failed to set floodlight off: {:?}", res.err());
}
}
MqttReplyRef {