X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=examples%2Ffind_all_pp.cpp;h=4061cd95e0bb7de453bb245e25e7218063d31eb0;hp=4e8e82490e371099f586b7b4635f6272b33c5fe9;hb=19f1452cde9bfe9da0e2830af128fae958ae877a;hpb=22d12cda4aed8d25fb79588a7261ca489db5ecd7 diff --git a/examples/find_all_pp.cpp b/examples/find_all_pp.cpp index 4e8e824..4061cd9 100644 --- a/examples/find_all_pp.cpp +++ b/examples/find_all_pp.cpp @@ -45,14 +45,24 @@ int main(int argc, char **argv) << std::endl << std::dec; // Print whole list - List* list = List::find_all(vid, pid); + Context context; + List* list = List::find_all(context, vid, pid); for (List::iterator it = list->begin(); it != list->end(); it++) { std::cout << "FTDI (" << &*it << "): " << it->vendor() << ", " << it->description() << ", " - << it->serial() - << std::endl; + << it->serial(); + + // Open test + if(it->open() == 0) + std::cout << " (Open OK)"; + else + std::cout << " (Open FAILED)"; + + it->close(); + + std::cout << std::endl; }