开发者

IOServiceAddMatchingNotification issue

开发者 https://www.devze.com 2022-12-11 11:20 出处:网络
void functions::start() { io_iterator_t enumerator; ...some code... result = IOServiceAddMatchingNotification(

void functions::start() {

io_iterator_t enumerator;

...some code...

result = IOServiceAddMatchingNotification(
            mNotifyPort,
                                        kIOMatchedNotification,
                                        IOServiceMatching( "IOFireWireLocalNode" ),
                                        serviceMatchingCallback, 
                                        (void *)0x1234,
                                        &enumerator  );    <=====
}

functions.cpp:83: error: argument of type 'void (functions::)(void*, io_iterator_t)' does not match 'void ()(void, io_iterator_t)'


does anyone know what this error mean? I am calling start() from main() through an object of functions ( eg, f->start(); )

i am using 开发者_如何学Cxcode and it highlights the line where the arrow points.

Thank you.


What is serviceMatchingCallback? Judging by the error, it seems to be a member function. You can't pass a member function as a callback in this manner. See this recent discussion on calling a class member function from a callback.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号