mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 06:53:34 +08:00
TransportStatsProvider
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <uavcan/node/service_server.hpp>
|
||||
#include <uavcan/util/method_binder.hpp>
|
||||
#include <uavcan/protocol/GetTransportStats.hpp>
|
||||
|
||||
namespace uavcan
|
||||
{
|
||||
|
||||
class TransportStatsProvider : Noncopyable
|
||||
{
|
||||
typedef MethodBinder<const TransportStatsProvider*,
|
||||
void (TransportStatsProvider::*)(const protocol::GetTransportStats::Request&,
|
||||
protocol::GetTransportStats::Response&) const>
|
||||
GetTransportStatsCallback;
|
||||
|
||||
ServiceServer<protocol::GetTransportStats, GetTransportStatsCallback> srv_;
|
||||
|
||||
void handleGetTransportStats(const protocol::GetTransportStats::Request&,
|
||||
protocol::GetTransportStats::Response& resp) const;
|
||||
|
||||
public:
|
||||
explicit TransportStatsProvider(INode& node)
|
||||
: srv_(node)
|
||||
{ }
|
||||
|
||||
int start();
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user