I’m using the PublishQueueAsyncRK library to publish events. I’d like to check that all events in the queue have been published before sleeping the device (or reaching a timeout). The waitFor function seems like an obvious way of doing this.
Can anyone explain why the following code doesn’t compile? waitFor(publishQueue.getNumEvents()==0, 10000);
I get the following error: expression preceding parentheses of apparent call must have (pointer-to-) function type
I can achieve what I want using a while loop, but I’d like to understand why the code above doesn’t work.
Thanks ScruffR. That makes sense. Is there any simple means of rewriting that code without creating my own function that returns a bool based on the value of publishQueue.getNumEvents()?