Viam C++ SDK current
Loading...
Searching...
No Matches
power_sensor_server.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <viam/api/common/v1/common.pb.h>
7#include <viam/api/component/powersensor/v1/powersensor.grpc.pb.h>
8
11#include <viam/sdk/resource/resource_server_base.hpp>
12
13using namespace viam::component::powersensor::v1;
14
15namespace viam {
16namespace sdk {
17namespace impl {
18
22class PowerSensorServer : public ResourceServer, public PowerSensorService::Service {
23 public:
25 using service_type = PowerSensorService;
26 explicit PowerSensorServer(std::shared_ptr<ResourceManager> manager);
27
28 ::grpc::Status GetVoltage(::grpc::ServerContext* context,
29 const GetVoltageRequest* request,
30 GetVoltageResponse* response) noexcept override;
31
32 ::grpc::Status GetCurrent(::grpc::ServerContext* context,
33 const GetCurrentRequest* request,
34 GetCurrentResponse* response) noexcept override;
35
36 ::grpc::Status GetPower(::grpc::ServerContext* context,
37 const GetPowerRequest* request,
38 GetPowerResponse* response) noexcept override;
39
40 ::grpc::Status GetReadings(::grpc::ServerContext* context,
41 const viam::common::v1::GetReadingsRequest* request,
42 viam::common::v1::GetReadingsResponse* response) noexcept override;
43
44 ::grpc::Status DoCommand(::grpc::ServerContext* context,
45 const viam::common::v1::DoCommandRequest* request,
46 viam::common::v1::DoCommandResponse* response) noexcept override;
47};
48
49} // namespace impl
50} // namespace sdk
51} // namespace viam
Definition power_sensor.hpp:22
Definition resource_server_base.hpp:8
gRPC server implementation of a PowerSensor component.
Definition power_sensor_server.hpp:22
Defines a PowerSensor component.
Defines a general-purpose resource manager.