Hosted::Client Class Reference

#include <Client.h>

Inheritance diagram for Hosted::Client:
Collaboration diagram for Hosted::Client:

Public Types

using RemoteCommands = HashMap< String, uint8_t >
 

Public Member Functions

 Client (Stream &stream, char methodEndsWith=':')
 
template<typename... Args>
bool send (const String &functionName, Args... args)
 Method to send commands to the remote server. More...
 
template<typename R >
wait ()
 This method will block the execution until a message is detected. More...
 
int getFunctionId (String name)
 Fetches a list of commands supported on the RPC server and gives back the id of the desired command. More...
 
bool getRemoteCommands ()
 Gets list of remote command names and their ids. More...
 

Member Typedef Documentation

◆ RemoteCommands

Constructor & Destructor Documentation

◆ Client()

Hosted::Client::Client ( Stream stream,
char  methodEndsWith = ':' 
)
inline

Member Function Documentation

◆ getFunctionId()

int Hosted::Client::getFunctionId ( String  name)
inline

Fetches a list of commands supported on the RPC server and gives back the id of the desired command.

Parameters
namecommand name to query
Return values
-1if not found. Otherwise the id of the function

◆ getRemoteCommands()

bool Hosted::Client::getRemoteCommands ( )
inline

Gets list of remote command names and their ids.

Return values
trueon success, false otherwise

◆ send()

template<typename... Args>
bool Hosted::Client::send ( const String functionName,
Args...  args 
)
inline

Method to send commands to the remote server.

Parameters
functionNameEither the name or the name with the signature. Example: "digitalWrite" - will try to call the default digitalWrite function on the server

If the command is overloaded, one command name with two or more different signatures then the name has to be containing the full function signature. Example: "void digitalWrite(uint16_t, uint8_t)". The name with the signature MUST be the same as the one produced from PRETTY_FUNCTION -> https://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

Parameters
variablearguments
Return values
trueon success, false if the command is not available

◆ wait()

template<typename R >
R Hosted::Client::wait ( )
inline

This method will block the execution until a message is detected.

Return values
HostedCommand

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