mirror of https://github.com/ArduPilot/ardupilot
AP_RangeFinder_PX4: Added the destructor to close the file descriptor
This commit is contained in:
parent
1083a89b0f
commit
b08e3d0ee4
|
@ -62,6 +62,16 @@ AP_RangeFinder_PX4::AP_RangeFinder_PX4(RangeFinder &_ranger, uint8_t instance, R
|
||||||
state.healthy = true;
|
state.healthy = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
close the file descriptor
|
||||||
|
*/
|
||||||
|
AP_RangeFinder_PX4::~AP_RangeFinder_PX4()
|
||||||
|
{
|
||||||
|
if (_fd != -1) {
|
||||||
|
close(_fd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
open the PX4 driver, returning the file descriptor
|
open the PX4 driver, returning the file descriptor
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -26,6 +26,9 @@ public:
|
||||||
// constructor
|
// constructor
|
||||||
AP_RangeFinder_PX4(RangeFinder &ranger, uint8_t instance, RangeFinder::RangeFinder_State &_state);
|
AP_RangeFinder_PX4(RangeFinder &ranger, uint8_t instance, RangeFinder::RangeFinder_State &_state);
|
||||||
|
|
||||||
|
// destructor
|
||||||
|
~AP_RangeFinder_PX4(void);
|
||||||
|
|
||||||
// static detection function
|
// static detection function
|
||||||
static bool detect(RangeFinder &ranger, uint8_t instance);
|
static bool detect(RangeFinder &ranger, uint8_t instance);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue