65 uint8_t serial_instance) :
70 if (
uart !=
nullptr) {
87 if (
uart ==
nullptr) {
95 while (nbytes-- > 0) {
104 float read_value = (float)atof(
linebuf);
105 if (read_value > 0) {
110 }
else if (isalnum(c) || c ==
'.' || c ==
'-') {
128 reading_cm = 100 * sum /
count;
134 #define COMMAND_BUFFER_LEN 15 192 if (command[0] != 0) {
193 uart->
write((uint8_t *)command, strlen(command));
203 if (strncmp(
linebuf,
"LBE", 3) == 0) {
208 if (strncmp(
linebuf,
"FMT", 3) == 0) {
213 if (strncmp(
linebuf,
"FRQ", 3) == 0) {
218 if (strncmp(
linebuf,
"GO", 2) == 0) {
223 if (strncmp(
linebuf,
"AUT", 3) == 0) {
228 if (strncmp(
linebuf,
"THR", 3) == 0) {
233 if (strncmp(
linebuf,
"MAVG", 4) == 0) {
238 if (strncmp(
linebuf,
"MEDF", 4) == 0) {
243 if (strncmp(
linebuf,
"AVG", 3) == 0) {
248 if (strncmp(
linebuf,
"AUV", 3) == 0) {
wasp_configuration_stage configuration_state
static AP_SerialManager serial_manager
virtual bool tx_pending()=0
int16_t constrain_int16(const int16_t amt, const int16_t low, const int16_t high)
virtual void begin(uint32_t baud)=0
void update(void) override
#define AP_GROUPINFO(name, idx, clazz, element, def)
bool get_reading(uint16_t &reading_cm)
virtual size_t write(uint8_t)=0
AP_HAL::UARTDriver * uart
static const struct AP_Param::GroupInfo var_info[]
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#define COMMAND_BUFFER_LEN
AP_RangeFinder_Wasp(RangeFinder::RangeFinder_State &_state, AP_SerialManager &serial_manager, uint8_t serial_instance)
virtual uint32_t available()=0
int snprintf(char *str, size_t size, const char *format,...)
const struct AP_Param::GroupInfo * var_info
static bool detect(AP_SerialManager &serial_manager, uint8_t serial_instance)
void set_status(RangeFinder::RangeFinder_Status status)
void parse_response(void)
RangeFinder::RangeFinder_State & state
AP_HAL::UARTDriver * find_serial(enum SerialProtocol protocol, uint8_t instance) const
static void setup_object_defaults(const void *object_pointer, const struct GroupInfo *group_info)