arduino - c++: Pass pointer to object within object as argument -


the code arduino if matters...

class xbee{   public:     xbee(softwareserial *xbeeserial, softwareserial *debugprinter); };  class localxbee : public xbee{   public:     localxbee(softwareserial *xbeeserial, softwareserial *debugprinter);     void addremotexbee(remotexbee *newbee, byte index); };  class remotexbee : public xbee{   public:     remotexbee(long addresslsb, softwareserial *xbeeserial, softwareserial *debugprinter);  class xbeethermostat{   public:     xbeethermostat(long addresslsb, softwareserial *xbeeserial, softwareserial *debugprinter);     remotexbee thermobee; }; 

so how call addremotexbee function in localxbee object when remotexbee object inside xbeethermostat object?

localxbee coordinator(&xbeeserial, &debugprinter); xbeethermostat thermostat(0x40be4864, &xbeeserial, &debugprinter);  void setup(){     coordinator.addremotexbee(&xbeethermostat.thermobee,0); } 

when trying compile error message: expected primary-expression before '.' token

found obvious bug:

void setup(){     coordinator.addremotexbee(&thermostat.thermobee,0); } 

thanks guys :)


Comments