Hello,
i'm trying to make a communication using 2 xbee module S2C using the library of andrewrapp in APi Mode. I have made a program base on the different examples of this lib. When i used the RX examples, there was no problems but now with the TX examples, i don't have any result. i got this message in my Arduino Compiler :
invalid cast to abstract class type 'XBeeRequest' "
This is the only line in my code that is related to this error :
XBeeRequest request = XBeeRequest(1,5);
And here is the class XBeeRequest in the library :
class XBeeRequest {
public:
/**
* Constructor
* TODO make protected
*/
XBeeRequest(uint8_t apiId, uint8_t frameId);
/**
* Sets the frame id. Must be between 1 and 255 inclusive to get a TX status response.
*/
void setFrameId(uint8_t frameId);
/**
* Returns the frame id
*/
uint8_t getFrameId();
/**
* Returns the API id
*/
uint8_t getApiId();
// setting = 0 makes this a pure virtual function, meaning the subclass must implement, like abstract in java
/**
* Starting after the frame id (pos = 0) and up to but not including the checksum
* Note: Unlike Digi's definition of the frame data, this does not start with the API ID.
* The reason for this is the API ID and Frame ID are common to all requests, whereas my definition of
* frame data is only the API specific data.
*/
virtual uint8_t getFrameData(uint8_t pos) = 0;
/**
* Returns the size of the api frame (not including frame id or api id or checksum).
*/
virtual uint8_t getFrameDataLength() = 0;
//void reset();
protected:
void setApiId(uint8_t apiId);
private:
uint8_t _apiId;
uint8_t _frameId;
};
This is kinda of driving me crazy so if somebody have any idea, i'm listening to you