Private
Public Access
2
0

examples: misc static code analysis fixes

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Alex Tereschenko
2017-06-05 16:53:58 +02:00
committed by Brendan Le Foll
parent bb3584fcdb
commit 32340f6819
7 changed files with 14 additions and 20 deletions

View File

@@ -27,8 +27,6 @@
//! [Interesting]
#include "uart_ow.hpp"
using namespace std;
int
main(int argc, char** argv)
{
@@ -38,21 +36,23 @@ main(int argc, char** argv)
mraa::Result rv;
if ((rv = uart->reset()) == mraa::SUCCESS) {
cout << "Reset succeeded, device(s) detected!" << endl;
std::cout << "Reset succeeded, device(s) detected!" << std::endl;
} else {
cout << "Reset failed, returned " << int(rv) << ". No devices on bus?" << endl;
std::cout << "Reset failed, returned " << int(rv) << ". No devices on bus?" << std::endl;
delete uart;
return 1;
}
cout << "Looking for devices..." << endl;
std::cout << "Looking for devices..." << std::endl;
;
uint8_t count = 0;
// start the search from scratch
string id = uart->search(true);
std::string id = uart->search(true);
if (id.empty()) {
cout << "No devices detected." << endl;
std::cout << "No devices detected." << std::endl;
delete uart;
return 1;
}
@@ -73,7 +73,7 @@ main(int argc, char** argv)
id = uart->search(false);
}
cout << "Exiting..." << endl;
std::cout << "Exiting..." << std::endl;
delete uart;