fixed EEPROM user-area space checks for FT232R and FT245R chips in ftdi_eeprom_build()
[libftdi] / examples / find_all_pp.cpp
index 4e8e824..4061cd9 100644 (file)
@@ -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;
 
     }