Viam C++ SDK current
Loading...
Searching...
No Matches
switch_server.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <viam/api/component/switch/v1/switch.grpc.pb.h>
7#include <viam/api/component/switch/v1/switch.pb.h>
8
11#include <viam/sdk/resource/resource_server_base.hpp>
12
13namespace viam {
14namespace sdk {
15namespace impl {
16
21 public viam::component::switch_::v1::SwitchService::Service {
22 public:
23 using interface_type = Switch;
24 using service_type = component::switch_::v1::SwitchService;
25
26 explicit SwitchServer(std::shared_ptr<ResourceManager> manager);
27
28 ::grpc::Status SetPosition(
29 ::grpc::ServerContext* context,
30 const ::viam::component::switch_::v1::SetPositionRequest* request,
31 ::viam::component::switch_::v1::SetPositionResponse* response) noexcept override;
32
33 ::grpc::Status GetPosition(
34 ::grpc::ServerContext* context,
35 const ::viam::component::switch_::v1::GetPositionRequest* request,
36 ::viam::component::switch_::v1::GetPositionResponse* response) noexcept override;
37
38 ::grpc::Status GetNumberOfPositions(
39 ::grpc::ServerContext* context,
40 const ::viam::component::switch_::v1::GetNumberOfPositionsRequest* request,
41 ::viam::component::switch_::v1::GetNumberOfPositionsResponse* response) noexcept override;
42
43 ::grpc::Status DoCommand(::grpc::ServerContext* context,
44 const ::viam::common::v1::DoCommandRequest* request,
45 ::viam::common::v1::DoCommandResponse* response) noexcept override;
46};
47
48} // namespace impl
49} // namespace sdk
50} // namespace viam
Definition resource_server_base.hpp:8
A Switch represents a physical switch with multiple positions.
Definition switch.hpp:25
gRPC server implementation of a Switch component.
Definition switch_server.hpp:21
Defines a general-purpose resource manager.
Defines a Switch component.