Viam C++ SDK current
Loading...
Searching...
No Matches
board_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/board/v1/board.grpc.pb.h>
8
11#include <viam/sdk/resource/resource_server_base.hpp>
12
13namespace viam {
14namespace sdk {
15namespace impl {
16
21 public viam::component::board::v1::BoardService::Service {
22 public:
23 using service_type = component::board::v1::BoardService;
24 using interface_type = Board;
25 explicit BoardServer(std::shared_ptr<ResourceManager> manager);
26
27 ::grpc::Status SetGPIO(
28 ::grpc::ServerContext* context,
29 const ::viam::component::board::v1::SetGPIORequest* request,
30 ::viam::component::board::v1::SetGPIOResponse* response) noexcept override;
31
32 ::grpc::Status GetGPIO(
33 ::grpc::ServerContext* context,
34 const ::viam::component::board::v1::GetGPIORequest* request,
35 ::viam::component::board::v1::GetGPIOResponse* response) noexcept override;
36
37 ::grpc::Status PWM(::grpc::ServerContext* context,
38 const ::viam::component::board::v1::PWMRequest* request,
39 ::viam::component::board::v1::PWMResponse* response) noexcept override;
40
41 ::grpc::Status SetPWM(::grpc::ServerContext* context,
42 const ::viam::component::board::v1::SetPWMRequest* request,
43 ::viam::component::board::v1::SetPWMResponse* response) noexcept override;
44
45 ::grpc::Status PWMFrequency(
46 ::grpc::ServerContext* context,
47 const ::viam::component::board::v1::PWMFrequencyRequest* request,
48 ::viam::component::board::v1::PWMFrequencyResponse* response) noexcept override;
49
50 ::grpc::Status SetPWMFrequency(
51 ::grpc::ServerContext* context,
52 const ::viam::component::board::v1::SetPWMFrequencyRequest* request,
53 ::viam::component::board::v1::SetPWMFrequencyResponse* response) noexcept override;
54
55 ::grpc::Status DoCommand(grpc::ServerContext* context,
56 const viam::common::v1::DoCommandRequest* request,
57 viam::common::v1::DoCommandResponse* response) noexcept override;
58
59 ::grpc::Status ReadAnalogReader(
60 ::grpc::ServerContext* context,
61 const ::viam::component::board::v1::ReadAnalogReaderRequest* request,
62 ::viam::component::board::v1::ReadAnalogReaderResponse* response) override;
63
64 ::grpc::Status WriteAnalog(::grpc::ServerContext* context,
65 const component::board::v1::WriteAnalogRequest* request,
66 component::board::v1::WriteAnalogResponse* response) override;
67
68 ::grpc::Status GetDigitalInterruptValue(
69 ::grpc::ServerContext* context,
70 const ::viam::component::board::v1::GetDigitalInterruptValueRequest* request,
71 ::viam::component::board::v1::GetDigitalInterruptValueResponse* response) override;
72
73 ::grpc::Status StreamTicks(
74 ::grpc::ServerContext* context,
75 const ::viam::component::board::v1::StreamTicksRequest* request,
76 ::grpc::ServerWriter<::viam::component::board::v1::StreamTicksResponse>* writer) noexcept
77 override;
78
79 ::grpc::Status SetPowerMode(
80 ::grpc::ServerContext* context,
81 const ::viam::component::board::v1::SetPowerModeRequest* request,
82 ::viam::component::board::v1::SetPowerModeResponse* response) noexcept override;
83
84 ::grpc::Status GetGeometries(
85 ::grpc::ServerContext* context,
86 const ::viam::common::v1::GetGeometriesRequest* request,
87 ::viam::common::v1::GetGeometriesResponse* response) noexcept override;
88};
89
90} // namespace impl
91} // namespace sdk
92} // namespace viam
Defines a Board component.
Represents a physical board with gpio pins, digital interrupts, and analog voltage reading.
Definition board.hpp:24
Definition resource_server_base.hpp:8
gRPC server implementation of a Board component.
Definition board_server.hpp:21
Defines a general-purpose resource manager.