eclipse / mraa

Linux Library for low speed IO Communication in C with bindings for C++, Python, Node.js & Java. Supports generic io platforms, as well as Intel Edison, Intel Joule, Raspberry Pi and many more.
http://mraa.io
MIT License
1.36k stars 613 forks source link

mraa C++ bindings: printError() needs to be prefixed #1057

Open mwallnoefer opened 3 years ago

mwallnoefer commented 3 years ago

In contradiction to the example here http://iotdk.intel.com/docs/master/mraa/classmraa_1_1_led.html and the others under https://github.com/eclipse/mraa/tree/master/examples/c%2B%2B the printError() function needs to be prefixed with mraa:: -> mraa::printError().

Please fix the examples, thanks a lot!

mwallnoefer commented 3 years ago

Moreover the usleep() function had been deprecated for quite a lot of time and should be substituted by nanosleep(). Please find here the respective indication in the Linux manpages:

CONFORMING TO 4.3BSD, POSIX.1-2001. POSIX.1-2001 declares this function obsolete; use nanosleep(2) instead. POSIX.1-2008 removes the specification of usleep().

The most easy substitution in the leds example could be:

    /* sleep for 5 seconds */
    ::sleep(5);
mwallnoefer commented 5 months ago

Any news on this?