zfm20: Use mraa::Uart instead of tty

Updated the ZFM20 class to use UART functionality provided through the
mraa::Uart class instead of using the UART directly.

    * Switch to mraa::Uart
    * Added raw uart string constructor, closes #621
    * Updated examples
    * Added a common.i to minimize interface duplication
    * Removed pointers from C++ functions where references are
      preferable
    * Removed dependency on termios
    * Added typedefs to handle pass-by-reference
    * Removed flushes
    * Removed code after throws

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck
2017-08-07 16:15:41 -07:00
parent 74b5ec00dc
commit 680649ba6f
8 changed files with 76 additions and 240 deletions

View File

@ -38,7 +38,7 @@ main(int argc, char** argv)
upm::ZFM20 fp(0);
// make sure port is initialized properly. 57600 baud is the default.
if (!fp.setupTty(B57600)) {
if (!fp.setupTty(57600)) {
cerr << "Failed to setup tty port parameters" << endl;
return 1;
}
@ -83,7 +83,7 @@ main(int argc, char** argv)
// we search for a print matching slot 1, where we shored our last
// converted fingerprint
if ((rv = fp.search(1, &id, &score)) != ZFM20::ERR_OK) {
if ((rv = fp.search(1, id, score)) != ZFM20::ERR_OK) {
if (rv == ZFM20::ERR_FP_NOTFOUND) {
cout << "Finger Print not found" << endl;
return 0;