mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 17:13:34 +08:00
libuavcan documentation
This commit is contained in:
@@ -10,15 +10,29 @@
|
||||
|
||||
namespace uavcan
|
||||
{
|
||||
|
||||
/**
|
||||
* Implement this interface in the application to support the standard node restart service.
|
||||
*/
|
||||
class UAVCAN_EXPORT IRestartRequestHandler
|
||||
{
|
||||
public:
|
||||
virtual ~IRestartRequestHandler() { }
|
||||
|
||||
/**
|
||||
* This method shall do either:
|
||||
* - restart the local node immediately;
|
||||
* - initiate the restart procedure to complete it asynchronously;
|
||||
* - reject the restart request and return false.
|
||||
*
|
||||
* If the restart requets was accepted, this method shall either return true or don't return at all.
|
||||
*/
|
||||
virtual bool handleRestartRequest(NodeID request_source) = 0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Convenience class for supporting the standard node restart service.
|
||||
* Highly recommended to use.
|
||||
*/
|
||||
class UAVCAN_EXPORT RestartRequestServer : Noncopyable
|
||||
{
|
||||
typedef MethodBinder<const RestartRequestServer*,
|
||||
@@ -37,9 +51,17 @@ public:
|
||||
, handler_(NULL)
|
||||
{ }
|
||||
|
||||
/**
|
||||
* Restart request handler configuration.
|
||||
* All restart requests will be explicitly rejected if there's no handler installed.
|
||||
*/
|
||||
IRestartRequestHandler* getHandler() const { return handler_; }
|
||||
void setHandler(IRestartRequestHandler* handler) { handler_ = handler; }
|
||||
|
||||
/**
|
||||
* Starts the server.
|
||||
* Returns negative error code.
|
||||
*/
|
||||
int start();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user