aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@google.com>2020-04-30 18:57:54 -0700
committerBill Richardson <wfrichar@google.com>2020-04-30 20:06:01 -0700
commited50ef80016ec5ec27fe9517109b1686c20b3172 (patch)
treebb48f081bfa03d27de47852122b0c0c50a21e91b
parent8f8d70c0f88b254a88228559b1d24e338246af55 (diff)
downloadgeneric-ed50ef80016ec5ec27fe9517109b1686c20b3172.tar.gz
Add NuggetClient constructor with const char* arg
This makes it easier to build for the Linux host, where we use environment variables to distinguish among multiple test boards. Bug: None Test: Manual Change-Id: I6576f27e864f51ebf99bf6c3ce6188e90a9e4b6d Signed-off-by: Bill Richardson <wfrichar@google.com>
-rw-r--r--libnos/NuggetClient.cpp3
-rw-r--r--libnos/include/nos/NuggetClient.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/libnos/NuggetClient.cpp b/libnos/NuggetClient.cpp
index f775756..3f4682d 100644
--- a/libnos/NuggetClient.cpp
+++ b/libnos/NuggetClient.cpp
@@ -32,6 +32,9 @@ NuggetClient::NuggetClient(const std::string& device_name)
: device_name_(device_name), open_(false) {
}
+NuggetClient::NuggetClient(const char* device_name)
+ : device_name_(device_name ? device_name : ""), open_(false) {}
+
NuggetClient::~NuggetClient() {
Close();
}
diff --git a/libnos/include/nos/NuggetClient.h b/libnos/include/nos/NuggetClient.h
index 428b0c3..f79b168 100644
--- a/libnos/include/nos/NuggetClient.h
+++ b/libnos/include/nos/NuggetClient.h
@@ -42,6 +42,7 @@ public:
* Passing an empty device name causes the default device to be selected.
*/
NuggetClient(const std::string& device_name);
+ NuggetClient(const char* device_name);
~NuggetClient() override;