forked from Archive/PX4-Autopilot
HoTT: Less chatty
This commit is contained in:
parent
ef27225534
commit
5af710221a
|
@ -55,7 +55,7 @@ open_uart(const char *device)
|
||||||
const int uart = open(device, O_RDWR | O_NOCTTY);
|
const int uart = open(device, O_RDWR | O_NOCTTY);
|
||||||
|
|
||||||
if (uart < 0) {
|
if (uart < 0) {
|
||||||
err(1, "Error opening port: %s", device);
|
err(1, "ERR: opening %s", device);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Back up the original uart configuration to restore it after exit */
|
/* Back up the original uart configuration to restore it after exit */
|
||||||
|
@ -63,7 +63,7 @@ open_uart(const char *device)
|
||||||
struct termios uart_config_original;
|
struct termios uart_config_original;
|
||||||
if ((termios_state = tcgetattr(uart, &uart_config_original)) < 0) {
|
if ((termios_state = tcgetattr(uart, &uart_config_original)) < 0) {
|
||||||
close(uart);
|
close(uart);
|
||||||
err(1, "Error getting baudrate / termios config for %s: %d", device, termios_state);
|
err(1, "ERR: %s: %d", device, termios_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill the struct for the new configuration */
|
/* Fill the struct for the new configuration */
|
||||||
|
@ -76,13 +76,13 @@ open_uart(const char *device)
|
||||||
/* Set baud rate */
|
/* Set baud rate */
|
||||||
if (cfsetispeed(&uart_config, speed) < 0 || cfsetospeed(&uart_config, speed) < 0) {
|
if (cfsetispeed(&uart_config, speed) < 0 || cfsetospeed(&uart_config, speed) < 0) {
|
||||||
close(uart);
|
close(uart);
|
||||||
err(1, "Error setting baudrate / termios config for %s: %d (cfsetispeed, cfsetospeed)",
|
err(1, "ERR: %s: %d (cfsetispeed, cfsetospeed)",
|
||||||
device, termios_state);
|
device, termios_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((termios_state = tcsetattr(uart, TCSANOW, &uart_config)) < 0) {
|
if ((termios_state = tcsetattr(uart, TCSANOW, &uart_config)) < 0) {
|
||||||
close(uart);
|
close(uart);
|
||||||
err(1, "Error setting baudrate / termios config for %s (tcsetattr)", device);
|
err(1, "ERR: %s (tcsetattr)", device);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Activate single wire mode */
|
/* Activate single wire mode */
|
||||||
|
|
|
@ -204,7 +204,7 @@ hott_sensors_main(int argc, char *argv[])
|
||||||
if (!strcmp(argv[1], "start")) {
|
if (!strcmp(argv[1], "start")) {
|
||||||
|
|
||||||
if (thread_running) {
|
if (thread_running) {
|
||||||
warnx("deamon already running");
|
warnx("already running");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,10 +225,10 @@ hott_sensors_main(int argc, char *argv[])
|
||||||
|
|
||||||
if (!strcmp(argv[1], "status")) {
|
if (!strcmp(argv[1], "status")) {
|
||||||
if (thread_running) {
|
if (thread_running) {
|
||||||
warnx("daemon is running");
|
warnx("is running");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
warnx("daemon not started");
|
warnx("not started");
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
|
@ -230,7 +230,7 @@ hott_telemetry_main(int argc, char *argv[])
|
||||||
if (!strcmp(argv[1], "start")) {
|
if (!strcmp(argv[1], "start")) {
|
||||||
|
|
||||||
if (thread_running) {
|
if (thread_running) {
|
||||||
warnx("deamon already running");
|
warnx("already running");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,10 +251,10 @@ hott_telemetry_main(int argc, char *argv[])
|
||||||
|
|
||||||
if (!strcmp(argv[1], "status")) {
|
if (!strcmp(argv[1], "status")) {
|
||||||
if (thread_running) {
|
if (thread_running) {
|
||||||
warnx("daemon is running");
|
warnx("is running");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
warnx("daemon not started");
|
warnx("not started");
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
Loading…
Reference in New Issue