2012-12-18 21:13:01 -04:00
|
|
|
|
|
|
|
#ifndef __AP_HAL_SITL_UTIL_H__
|
|
|
|
#define __AP_HAL_SITL_UTIL_H__
|
|
|
|
|
2015-08-11 03:28:43 -03:00
|
|
|
#include <AP_HAL/AP_HAL.h>
|
2015-05-04 03:15:12 -03:00
|
|
|
#include "AP_HAL_SITL_Namespace.h"
|
2015-12-20 16:33:11 -04:00
|
|
|
#include "Semaphores.h"
|
2012-12-18 21:13:01 -04:00
|
|
|
|
2016-01-10 02:23:32 -04:00
|
|
|
class HALSITL::Util : public AP_HAL::Util {
|
2012-12-18 21:13:01 -04:00
|
|
|
public:
|
2016-01-10 02:23:32 -04:00
|
|
|
Util(SITL_State *_sitlState) :
|
2016-01-06 18:09:40 -04:00
|
|
|
sitlState(_sitlState) {}
|
|
|
|
|
2015-05-04 21:59:07 -03:00
|
|
|
bool run_debug_shell(AP_HAL::BetterStream *stream) {
|
|
|
|
return false;
|
|
|
|
}
|
2015-11-05 00:41:46 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
how much free memory do we have in bytes.
|
|
|
|
*/
|
|
|
|
uint32_t available_memory(void) override {
|
|
|
|
// SITL is assumed to always have plenty of memory. Return 128k for now
|
|
|
|
return 0x20000;
|
|
|
|
}
|
2015-12-20 16:33:11 -04:00
|
|
|
|
|
|
|
// create a new semaphore
|
|
|
|
AP_HAL::Semaphore *new_semaphore(void) override { return new HALSITL::Semaphore; }
|
2016-01-06 18:09:40 -04:00
|
|
|
|
|
|
|
// get path to custom defaults file for AP_Param
|
|
|
|
const char* get_custom_defaults_file() const override {
|
|
|
|
return sitlState->defaults_path;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
SITL_State *sitlState;
|
2012-12-18 21:13:01 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __AP_HAL_SITL_UTIL_H__
|