How to use MyMessage .setDestination ??
-
Hello,
I would like to use the MyMessage set on the fly functions.
Here is a dummy sketch that cannot compile.#include <MyMessage.h> MyMessage msgOut(); void setup() { msgOut.setDestination(10); } void loop() { }here is the error I got :
error: request for member 'setDestination' in 'msgOut', which is of non-class type 'MyMessage()'
What it is wrong in the way I use this function ?
Thanks -
Hum some news :
There are two constructors for MyMessage
one is MyMessage::MyMessage()
the other one is MyMessage::MyMessage(uint8_t _sensor, uint8_t _type)if I modify my dummy sketch like this :
#include <MyMessage.h> MyMessage msgOut(); MyMessage msgIn(1, V_TRIPPED); void setup() { msgIn.isAck(); msgOut.isAck(); msgOut.setDestination(10); msgIn.setDestination(10); } void loop() { }I get the following errors :
In function 'void setup()':
error: request for member 'isAck' in 'msgOut', which is of non-class type 'MyMessage()'
error: request for member 'setDestination' in 'msgOut', which is of non-class type 'MyMessage()'The errors are only for msgOut that uses the first constructor.
msgIn uses the second constructor and it works.Looks wierd to me. Can you explain why the simplest constructor gives errors ?
Thanks again
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login