Go Down

Topic: How do I use xbeewithcallbacks inside class (Read 168 times) previous topic - next topic

donaldB

 I am trying to figure out how to use XbeeWithCallbacks inside of a class.
 I am a very experanced programmer, but for the life of me I can not get this working.
 I am using Xbee.h.
 
 Example in .ini code
 
// Object that handles the xbee objects
XBeeWithCallbacks Xbee;

void setup()
{
   // setting of your Xbee.
   SerialXbee.begin(9600);
   // Start up the xbee
   Xbee.begin(SerialXbee);
}

 Then:
 Class foo
{
 public:
 foo(XBeeWithCallbacks vXbee);
 XBeeWithCallbacks Xbee;
 test();
}

Foo:Foo(XBeeWithCallbacks vXbee)
{
    Xbee = vXbee;
}
Foo::test()
{
   Xbee.sendAtCommand(Command);
}

The test function is complete and long so I did not post everything here.
 It basically says the radio is not connecting.
 I can get this to work no problem on the .ino file.
 Any help would be appreciated thanks,
 Donald Boissonneault

PaulS

Quote
The test function is complete and long so I did not post everything here.
The amount of help you will get is commensurate with the amount of code you post.

Quote
but for the life of me I can not get this working.
The code does something which you are keeping secret.
You expect the code to do something which you are keeping a secret.

I'll keep the solution a secret, too, then.
The art of getting good answers lies in asking good questions.

Go Up