cec: add a Close() method to the interface
[deb_libcec.git] / src / lib / CECParserC.cpp
index a4841a0a69b0dec55860b17e65bd3e496338c6d3..b21f1c0b461a3d17358983e3dfdda9afd8ec4821 100644 (file)
@@ -47,13 +47,6 @@ bool cec_init(const char *strDeviceName, cec_logical_address iLogicalAddress /*
   return (cec_parser != NULL);
 }
 
-bool cec_close(void)
-{
-  delete cec_parser;
-  cec_parser = NULL;
-  return true;
-}
-
 bool cec_open(const char *strPort, int iTimeout)
 {
   if (cec_parser)
@@ -61,6 +54,17 @@ bool cec_open(const char *strPort, int iTimeout)
   return false;
 }
 
+bool cec_close(int iTimeout)
+{
+  bool bReturn = false;
+  if (cec_parser)
+    bReturn = cec_parser->Close(iTimeout);
+
+  delete cec_parser;
+  cec_parser = NULL;
+  return bReturn;
+}
+
 bool cec_ping(void)
 {
   if (cec_parser)