Public Types | Public Member Functions | Private Attributes | List of all members
rcdiscover::Discover Class Reference

#include <discover.h>

Public Types

typedef SocketLinux SocketType
 

Public Member Functions

void broadcastRequest ()
 Broadcasts a discovery command request. More...
 
 Discover ()
 Initializes a socket ready for broadcasting requests. More...
 
bool getResponse (std::vector< DeviceInfo > &info, int timeout_per_socket=1000)
 Returns a discovery response. More...
 
 ~Discover ()
 

Private Attributes

std::vector< std::tuple< std::uint8_t, std::uint8_t > > req_nums_
 
std::vector< SocketTypesockets_
 

Detailed Description

Definition at line 50 of file discover.h.

Member Typedef Documentation

Definition at line 56 of file discover.h.

Constructor & Destructor Documentation

rcdiscover::Discover::Discover ( )

Initializes a socket ready for broadcasting requests.

NOTE: Exceptions are thrown in case of severe network errors.

Definition at line 72 of file discover.cc.

rcdiscover::Discover::~Discover ( )

Definition at line 82 of file discover.cc.

Member Function Documentation

void rcdiscover::Discover::broadcastRequest ( )

Broadcasts a discovery command request.

Definition at line 85 of file discover.cc.

bool rcdiscover::Discover::getResponse ( std::vector< DeviceInfo > &  info,
int  timeout_per_socket = 1000 
)

Returns a discovery response.

This method should be called until there is no further response.

Parameters
infoInfo object that will be filled if there is an available response.
timeoutTimeout in Milliseconds.
Returns
True if there was a valid response. In this case, the info object contains valid information. False in case of a timeout.

Definition at line 107 of file discover.cc.

Member Data Documentation

std::vector<std::tuple<std::uint8_t, std::uint8_t> > rcdiscover::Discover::req_nums_
private

Definition at line 92 of file discover.h.

std::vector<SocketType> rcdiscover::Discover::sockets_
private

Definition at line 91 of file discover.h.


The documentation for this class was generated from the following files:


rcdiscover
Author(s): Heiko Hirschmueller , Raphael Schaller
autogenerated on Sun Apr 18 2021 02:16:32