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 <viam/api/service/discovery/v1/discovery.grpc.pb.h>
7
8#include <viam/sdk/rpc/dial.hpp>
10
11namespace viam {
12namespace sdk {
13namespace impl {
14
18class DiscoveryClient : public Discovery {
19 public:
21 DiscoveryClient(std::string name, const ViamChannel& channel);
22
23 const ViamChannel& channel() const {
24 return *channel_;
25 }
26
27 std::vector<ResourceConfig> discover_resources(const ProtoStruct& extra) override;
28 ProtoStruct do_command(const ProtoStruct& command) override;
29
30 private:
31 using StubType = viam::service::discovery::v1::DiscoveryService::StubInterface;
32 std::unique_ptr<StubType> stub_;
33 const ViamChannel* channel_;
34};
35
36} // namespace impl
37} // namespace sdk
38} // 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.
Definition dial.hpp:25
gRPC client implementation of a Discovery service.
Definition discovery_client.hpp:18
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.