LCOV - code coverage report
Current view: top level - AP_RangeFinder - AP_RangeFinder_TeraRanger_Serial.h (source / functions) Hit Total Coverage
Test: lcov.info Lines: 4 4 100.0 %
Date: 2026-09-09 11:02:08 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include "AP_RangeFinder_config.h"
       4             : 
       5             : #if AP_RANGEFINDER_TERARANGER_SERIAL_ENABLED
       6             : 
       7             : #include "AP_RangeFinder.h"
       8             : #include "AP_RangeFinder_Backend_Serial.h"
       9             : 
      10             : class AP_RangeFinder_TeraRanger_Serial : public AP_RangeFinder_Backend_Serial
      11             : {
      12             : 
      13             : public:
      14             : 
      15           1 :     static AP_RangeFinder_Backend_Serial *create(
      16             :         RangeFinder::RangeFinder_State &_state,
      17             :         AP_RangeFinder_Params &_params) {
      18           1 :         return NEW_NOTHROW AP_RangeFinder_TeraRanger_Serial(_state, _params);
      19             :     }
      20             : 
      21             : protected:
      22             : 
      23             :     using AP_RangeFinder_Backend_Serial::AP_RangeFinder_Backend_Serial;
      24             : 
      25         336 :     MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
      26         336 :         return MAV_DISTANCE_SENSOR_LASER;
      27             :     }
      28             : 
      29             : private:
      30             : 
      31             :     // get a reading
      32             :     // distance returned in reading_m
      33             :     bool get_reading(float &reading_m) override;
      34             : 
      35             :     uint8_t linebuf[10];
      36             :     uint8_t linebuf_len;
      37             : };
      38             : #endif  // AP_RANGEFINDER_TERARANGER_SERIAL_ENABLED

Generated by: LCOV version 1.14