Viam C++ SDK current
Loading...
Searching...
No Matches
discovery_client.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <grpcpp/channel.h>
7
8#include <viam/api/service/discovery/v1/discovery.grpc.pb.h>
9
11
12namespace viam {
13namespace sdk {
14namespace impl {
15
19class DiscoveryClient : public Discovery {
20 public:
22 DiscoveryClient(std::string name, std::shared_ptr<grpc::Channel> channel);
23
24 std::vector<ResourceConfig> discover_resources(const ProtoStruct& extra) override;
25 ProtoStruct do_command(const ProtoStruct& command) override;
26
27 private:
28 using StubType = viam::service::discovery::v1::DiscoveryService::StubInterface;
29 std::unique_ptr<StubType> stub_;
30 std::shared_ptr<grpc::Channel> channel_;
31};
32
33} // namespace impl
34} // namespace sdk
35} // namespace viam
A Discovery service is used to discover resources that are physically connected to your machine.
Definition discovery.hpp:25
virtual std::string name() const
Return the resource's name.
gRPC client implementation of a Discovery service.
Definition discovery_client.hpp:19
ProtoStruct do_command(const ProtoStruct &command) override
Do an arbitrary command.
std::vector< ResourceConfig > discover_resources(const ProtoStruct &extra) override
Discover valid viam configuration of resources that are physically connected to your machine.
Defines a Discovery service.