Instrument Neutral Distributed Interface INDI  2.0.2
Public Member Functions | List of all members
PrimalucaLabs::Communication Class Reference

#include <primalucacommandset.h>

Public Member Functions

 Communication (const std::string &name, int port)
 
const char * getDeviceName ()
 
bool sendRequest (const json &command, json *response=nullptr)
 
template<typename T = int32_t>
bool genericRequest (const std::string &node, const std::string &type, const json &command, T *response=nullptr)
 
template<typename T = int32_t>
bool get (NodeType type, const std::string &parameter, T &value)
 
bool getStringAsDouble (NodeType type, const std::string &parameter, double &value)
 getStringAsDouble Same as get, but it receives a string and scan it for double. More...
 
bool set (NodeType type, const json &value)
 
template<typename T = int32_t>
bool command (NodeType type, const json &jsonCommand)
 

Detailed Description

Definition at line 66 of file primalucacommandset.h.

Constructor & Destructor Documentation

◆ Communication()

PrimalucaLabs::Communication::Communication ( const std::string &  name,
int  port 
)
inlineexplicit

Definition at line 70 of file primalucacommandset.h.

Member Function Documentation

◆ command()

template<typename T >
bool PrimalucaLabs::Communication::command ( NodeType  type,
const json jsonCommand 
)

Definition at line 221 of file primalucacommandset.cpp.

◆ genericRequest()

template<typename T >
bool PrimalucaLabs::Communication::genericRequest ( const std::string &  node,
const std::string &  type,
const json command,
T *  response = nullptr 
)

Definition at line 157 of file primalucacommandset.cpp.

◆ get()

template<typename T >
bool PrimalucaLabs::Communication::get ( NodeType  type,
const std::string &  parameter,
T &  value 
)

Definition at line 117 of file primalucacommandset.cpp.

◆ getDeviceName()

const char* PrimalucaLabs::Communication::getDeviceName ( )
inline

Definition at line 71 of file primalucacommandset.h.

◆ getStringAsDouble()

bool PrimalucaLabs::Communication::getStringAsDouble ( NodeType  type,
const std::string &  parameter,
double &  value 
)

getStringAsDouble Same as get, but it receives a string and scan it for double.

Parameters
typemotor type
parameterparameter name
valuevalue to store the scanned double value.
Returns
True if successful, false otherwise.

Definition at line 106 of file primalucacommandset.cpp.

◆ sendRequest()

bool PrimalucaLabs::Communication::sendRequest ( const json command,
json response = nullptr 
)

Definition at line 56 of file primalucacommandset.cpp.

◆ set()

bool PrimalucaLabs::Communication::set ( NodeType  type,
const json value 
)

Definition at line 136 of file primalucacommandset.cpp.


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