- ArduinoJSON by Benoit Blanchon
- PubSubClient by Nick O’Leary
- ArduinoUniqueId by Luiz Henrique Cassettari
Use the macros described below to add remote access to regular functions.
VRPC_GLOBAL_FUNCTION(<returnType>, <functionName>[, <argTypes>])
Example:
int foo () {
// [...]
}
void bar (String& s, bool b) {
// [...]
}
VRPC_GLOBAL_FUNCTION(int, foo)
VRPC_GLOBAL_FUNCTION(void, bar, String&, bool)
The agent allows existing code to be called from remote.
Members | Descriptions |
---|---|
public inline VrpcAgent (int maxBytesPerMessage) |
Constructs an agent. |
public template<> inline void begin (T & netClient,const String & domain,const String & token) |
Initializes the object using a client class for network transport. |
public inline bool connected () |
Reports the current connectivity status. |
public inline void connect () |
Connect the agent to the broker. |
public inline void loop () |
This function will send and receive VRPC packets. |
public inline
VrpcAgent
(int maxBytesPerMessage)
Constructs an agent.
maxBytesPerMessage
[optional, default:1024
] Specifies the maximum size a single MQTT message may have
public template<typename T>
inline void
begin
(T& netClient, const String& domain, const String& token)
Initializes the object using a client class for network transport.
-
netClient
A client class following the interface as described here -
domain
[optional, default:"vrpc"
] The domain under which the agent-provided code is reachable -
token
[optional, default:""
] Access token as generated by Heisenware GmbH, or MQTT password if own broker is used -
broker
[optional, default:"vrpc.io"
] Address of the MQTT broker -
username
[optional] MQTT username (not needed when using the vrpc.io broker)
public inline bool
connected
()
Reports the current connectivity status.
true when connected, false otherwise
public inline void
connect
()
Connect the agent to the broker.
The function will try to connect forever. Inspect the serial monitor to see the connectivity progress.
public inline void
loop
()
Send and receive VRPC packets.
NOTE: This function should be called in every loop