Pass a member function pointer to a method of a foreign class (EDB Lib)
The problem here is a common one with C++.  It basically boils down to how C++ handles member functions.

You define a member function as, say,

class myLib {
    void myFunc(int val);
};


When you call the function it's actually not defined as that - it's instead had its definition change to:

void myFunc(myLib *this, int val);


The addition of the myLib *this is an implicit parameter, and it's how C++ keeps track of its object instances when calling different functions.

So a function which expects a parameter of void (*func)(int) won't accept your method because it's actually void (*func)(myLib *, int).  Hence the error you are seeing.

There is no easy, clean, way around it that I have found as yet, I am afraid.  The closest you can do is to move the reader and writer functions outside of your class and store a global pointer to the actual class, something like:

static myLib *globalLib;
void globalConfigWriter( unsigned long address, byte data ) {
    globalLib-&gt;congigWriter(address, data);
}
byte globalConfigReader( unsigned long address ) {
    return globalLib-&gt;configReader(address);
}


Then in the constructor for your lib you can do:

myLib::myLib() {
    globalLib = this;
}


You then register the global reader and writer functions with the EDB constructor instead of the class member functions.

It does have the rather major down-side that there can only be one instance of your class since there is only one global pointer and only one pair of reader / writer functions.  There are ways of supporting a finite number of instances, but it basically involves having a reader/writer pair for each instance and allocating one to an instance when it's constructed and de-allocating it when its destructed.  Keeping track of them and knowing which object is associated with which function pair is tricky at best...