mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 09:21:12 +03:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user