Allow any instance of Client to be passed in.
Added new example for publishing in callback.
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
/*
|
||||
Basic MQTT example
|
||||
Basic MQTT example with Authentication
|
||||
|
||||
- connects to an MQTT server
|
||||
- connects to an MQTT server, providing username
|
||||
and password
|
||||
- publishes "hello world" to the topic "outTopic"
|
||||
- subscribes to the topic "inTopic"
|
||||
*/
|
||||
@ -19,7 +20,8 @@ void callback(char* topic, byte* payload, unsigned int length) {
|
||||
// handle message arrived
|
||||
}
|
||||
|
||||
PubSubClient client(server, 1883, callback);
|
||||
EthernetClient ethClient;
|
||||
PubSubClient client(server, 1883, callback, ethClient);
|
||||
|
||||
void setup()
|
||||
{
|
Reference in New Issue
Block a user