Fixed Context::open as get_strings() closes the device before. Thanks to Chris M...
[libftdi] / examples / find_all_pp.cpp
index 4e8e824..98e5133 100644 (file)
@@ -51,8 +51,17 @@ int main(int argc, char **argv)
         std::cout << "FTDI (" << &*it << "): "
         << it->vendor() << ", "
         << it->description() << ", "
-        << it->serial()
-        << std::endl;
+        << it->serial();
+
+        // Open test
+        if(it->open())
+           std::cout << " (Open OK)";
+        else
+           std::cout << " (Open FAILED)";
+
+        it->close();
+
+        std::cout << std::endl;
 
     }