Skip to content
This repository was archived by the owner on Jan 4, 2023. It is now read-only.

Commit 0cb6904

Browse files
committed
examples: list_mfg also lists advertised service data
Signed-off-by: Petre Eftime <[email protected]>
1 parent de8304c commit 0cb6904

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

examples/list_mfg.cpp

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,28 @@ int main(int argc, char **argv)
8888

8989
auto mfg = (*it)->get_manufacturer_data();
9090

91-
if (mfg.empty())
92-
continue;
93-
94-
std::cout << "MFG" << std::endl;
95-
for(auto it: mfg) {
96-
std::cout << "\t" << it.first << " = [ ";
97-
for (auto arr_it: it.second) {
98-
std::cout << (int) arr_it << ", ";
91+
if (!mfg.empty()) {
92+
std::cout << "MFG" << std::endl;
93+
for(auto it: mfg) {
94+
std::cout << "\t" << it.first << " = [ ";
95+
for (auto arr_it: it.second) {
96+
std::cout << (int) arr_it << ", ";
97+
}
98+
std::cout << "]" << std::endl;
99+
}
100+
}
101+
102+
auto service_data = (*it)->get_service_data();
103+
104+
if (!service_data.empty()) {
105+
std::cout << "Service Data" << std::endl;
106+
for(auto it: service_data) {
107+
std::cout << "\t" << it.first << " = [ ";
108+
for (auto arr_it: it.second) {
109+
std::cout << (int) arr_it << ", ";
110+
}
111+
std::cout << "]" << std::endl;
99112
}
100-
std::cout << "]" << std::endl;
101113
}
102114

103115
}

0 commit comments

Comments
 (0)