8 years, 5 months ago.  This question has been closed. Reason: Off Topic

mbed Serial.attach Class member function

Hello! I am trying to use the mbed Serial.attach function with a Class member function. As we can see in the documentation:

void attach ( T * tptr, void(T::*)(void) mptr, IrqType type = RxIrq )

Attach a member function to call whenever a serial interrupt is generated.

Parameters: tptr pointer to the object to call the member function on, mptr pointer to the member function to be called, type Which serial interrupt to attach the member function to (Seriall::RxIrq for receive, TxIrq for transmit buffer empty)

I have made a Class for use with the ESP8266 wifi module. So in my program i have an object esp of Class ESP8266. I want to attach the non-static function of this object esp.receiveIT() so i call: serial.attach(&esp,&ESP8266::receiveIT,RxIrq); where serial is a Serial object. I am getting an error that there is no matching member function. I would be gratefull if someone could help. Thanks in advance.

Ok needed to use Serial::RxIrq. Please delete this question.

posted by Manos Kav 22 Jul 2016