diff options
author | Petre Eftime <[email protected]> | 2017-08-07 21:49:33 +0300 |
---|---|---|
committer | Petre Eftime <[email protected]> | 2017-08-07 21:49:33 +0300 |
commit | 0cb6904ad9ea1846176598dfca7afd1aeb42a50f (patch) | |
tree | 0dc503fc6444c53ba15f518456a2c972764fe537 /examples | |
parent | de8304c6083ff8c7653365ac6bb15d58ab49688f (diff) |
examples: list_mfg also lists advertised service data
Signed-off-by: Petre Eftime <[email protected]>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/list_mfg.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/examples/list_mfg.cpp b/examples/list_mfg.cpp index b554f7cb..5f298ffb 100644 --- a/examples/list_mfg.cpp +++ b/examples/list_mfg.cpp @@ -88,16 +88,28 @@ int main(int argc, char **argv) auto mfg = (*it)->get_manufacturer_data(); - if (mfg.empty()) - continue; - - std::cout << "MFG" << std::endl; - for(auto it: mfg) { - std::cout << "\t" << it.first << " = [ "; - for (auto arr_it: it.second) { - std::cout << (int) arr_it << ", "; + if (!mfg.empty()) { + std::cout << "MFG" << std::endl; + for(auto it: mfg) { + std::cout << "\t" << it.first << " = [ "; + for (auto arr_it: it.second) { + std::cout << (int) arr_it << ", "; + } + std::cout << "]" << std::endl; + } + } + + auto service_data = (*it)->get_service_data(); + + if (!service_data.empty()) { + std::cout << "Service Data" << std::endl; + for(auto it: service_data) { + std::cout << "\t" << it.first << " = [ "; + for (auto arr_it: it.second) { + std::cout << (int) arr_it << ", "; + } + std::cout << "]" << std::endl; } - std::cout << "]" << std::endl; } } |