But i keep getting this error message:
working.ino: In function ‘void setup()’:
working:24: error: invalid conversion from ‘void (*)(const String&)’ to ‘void (*)(const String&, const String&)’
working:24: error: initializing argument 2 of ‘void PusherClient::bind(const String&, void (*)(const String&, const String&))’
The error simply states that your handleMyEvent function should have two arguments of type const String&, while your has only one.
So try to replace it with the following:
void handleMyEvent(const String& name, const String& data){
Serial.println(“Data mottatt:”);
Serial.println(data);
}
I modified the delegate function to have two parameters. Maybe I did not fix some readme in the library.
Hi Marco!
I just downloaded and tested your ArduinoPusher library. Awesome work!!
Finally a library who got the private channel authorization working.
But I ran into problems trying to bind a channel to a function.
Just tried a very simple example. Used your private channel example code and added:
PusherClient client;
client.bind(“my-event”, handleMyEvent);
void handleMyEvent(String data){
Serial.println(“Data mottatt:”);
Serial.println(data);
}
But i keep getting this error message:
working.ino: In function ‘void setup()’:
working:24: error: invalid conversion from ‘void (*)(const String&)’ to ‘void (*)(const String&, const String&)’
working:24: error: initializing argument 2 of ‘void PusherClient::bind(const String&, void (*)(const String&, const String&))’
Do you have any idea what it could be?
Thanks again for some awesome piece of code 🙂
Regards Kjetil
The error simply states that your handleMyEvent function should have two arguments of type const String&, while your has only one.
So try to replace it with the following:
void handleMyEvent(const String& name, const String& data){
Serial.println(“Data mottatt:”);
Serial.println(data);
}
I modified the delegate function to have two parameters. Maybe I did not fix some readme in the library.
I fixed the readme.
That did the trick! Thanks for your help 🙂
Time to take over the world 😉