mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 04:03:59 -04:00
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;
|
||||
}
|
||||
|
||||
/*
|
||||
close the file descriptor
|
||||
*/
|
||||
AP_RangeFinder_PX4::~AP_RangeFinder_PX4()
|
||||
{
|
||||
if (_fd != -1) {
|
||||
close(_fd);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
open the PX4 driver, returning the file descriptor
|
||||
*/
|
||||
|
@ -26,6 +26,9 @@ public:
|
||||
// constructor
|
||||
AP_RangeFinder_PX4(RangeFinder &ranger, uint8_t instance, RangeFinder::RangeFinder_State &_state);
|
||||
|
||||
// destructor
|
||||
~AP_RangeFinder_PX4(void);
|
||||
|
||||
// static detection function
|
||||
static bool detect(RangeFinder &ranger, uint8_t instance);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user