PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <fcntl.h>
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/defines.h>
#include <px4_platform_common/tasks.h>
#include <poll.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <systemlib/err.h>
#include "../comms.h"
#include "../messages.h"
Go to the source code of this file.
Macros | |
#define | DEFAULT_UART "/dev/ttyS0"; |
USART1. More... | |
Functions | |
__EXPORT int | hott_sensors_main (int argc, char *argv[]) |
Deamon management function. More... | |
int | hott_sensors_thread_main (int argc, char *argv[]) |
Mainloop of daemon. More... | |
static int | recv_data (int uart, uint8_t *buffer, size_t *size, uint8_t *id) |
static int | send_poll (int uart, uint8_t *buffer, size_t size) |
Variables | |
static int | thread_should_exit = false |
Deamon exit flag. More... | |
static int | thread_running = false |
Deamon status flag. More... | |
static int | deamon_task |
Handle of deamon task / thread. More... | |
static const char | daemon_name [] = "hott_sensors" |
static const char | commandline_usage [] = "usage: hott_sensors start|status|stop [-d <device>]" |
#define DEFAULT_UART "/dev/ttyS0"; |
int hott_sensors_main | ( | int | argc, |
char * | argv[] | ||
) |
Deamon management function.
Process command line arguments and start the daemon.
Definition at line 200 of file hott_sensors.cpp.
References commandline_usage, daemon_name, deamon_task, errx, hott_sensors_thread_main(), thread_running, thread_should_exit, and warnx.
int hott_sensors_thread_main | ( | int | argc, |
char * | argv[] | ||
) |
Mainloop of daemon.
Definition at line 135 of file hott_sensors.cpp.
References build_gam_request(), commandline_usage, DEFAULT_UART, errx, GAM_SENSOR_ID, init_pub_messages(), MAX_MESSAGE_BUFFER_SIZE, open_uart(), publish_gam_message(), recv_data(), send_poll(), thread_running, thread_should_exit, and warnx.
Referenced by hott_sensors_main().
|
static |
Definition at line 99 of file hott_sensors.cpp.
References OK, read(), STOP_BYTE, and timeout_ms.
Referenced by i2cdetect::detect(), and hott_sensors_thread_main().
|
static |
Definition at line 81 of file hott_sensors.cpp.
References OK, POST_WRITE_DELAY_IN_USECS, read(), and write().
Referenced by hott_sensors_thread_main().
Definition at line 65 of file hott_sensors.cpp.
Referenced by hott_sensors_main(), and hott_sensors_thread_main().
|
static |
Definition at line 64 of file hott_sensors.cpp.
Referenced by hott_sensors_main().
|
static |
Handle of deamon task / thread.
Definition at line 63 of file hott_sensors.cpp.
Referenced by hott_sensors_main().
|
static |
Deamon status flag.
Definition at line 62 of file hott_sensors.cpp.
Referenced by hott_sensors_main(), and hott_sensors_thread_main().
|
static |
Deamon exit flag.
Definition at line 61 of file hott_sensors.cpp.
Referenced by hott_sensors_main(), and hott_sensors_thread_main().