Hi, I am trying to develop a BLE project with two boards communicating. I am looking at the examples available and I have seen several times “as_cb( )” like in the following example:
ble_error_t error = characteristic.read( 0, as_cb(&Self::when_characteristic_read) );
The problem is that I get a compilation error “as_cb” was not defined in this scope.
I have searched many headers and I don’t find the definition of “as_cb”.
Does anybody know where it is ?
usually is good to share a link to the example what you are talking about.
It is not in any header it seems to be a template function
The example is probably older version of example what I posted above.
main() function is on line 559. The code above is a class
as_cb(...) is its private method
FunctionPointerWithContext<ContextType> as_cb(void (Self::*member)(ContextType context) )
return makeFunctionPointer(this, member);
I tried to compile this code for Nucleo-F401 and after correcting line 446 (change from
NULL) the compilation was OK with few warnings.
Thank you very much for your help, I was using the example as a guide but missed that part of the code where it was defined, I was getting mad trying to find it in the header files.
I thought something like that.
You are welcome and good luck.