timeout parameter removed from Close()/cec_close(). return type changed to void....
[deb_libcec.git] / src / lib / CECParserC.cpp
index 4b6a1efa7bb5414f7df00b64016c5c137284ccfb..5d7bf61223d952afa496d6346439e584dfb8591a 100644 (file)
@@ -47,11 +47,11 @@ bool cec_init(const char *strDeviceName, cec_logical_address iLogicalAddress /*
   return (cec_parser != NULL);
 }
 
-bool cec_close(void)
+void cec_destroy(void)
 {
+  cec_close();
   delete cec_parser;
   cec_parser = NULL;
-  return true;
 }
 
 bool cec_open(const char *strPort, int iTimeout)
@@ -61,6 +61,12 @@ bool cec_open(const char *strPort, int iTimeout)
   return false;
 }
 
+void cec_close(void)
+{
+  if (cec_parser)
+    cec_parser->Close();
+}
+
 bool cec_ping(void)
 {
   if (cec_parser)
@@ -124,10 +130,17 @@ bool cec_get_next_keypress(cec_keypress *key)
   return false;
 }
 
-bool cec_transmit(const CEC::cec_frame &data, bool bWaitForAck /* = true */, int64_t iTimeout /* = 2000 */)
+bool cec_get_next_command(cec_command *command)
+{
+  if (cec_parser)
+    return cec_parser->GetNextCommand(command);
+  return false;
+}
+
+bool cec_transmit(const CEC::cec_frame &data, bool bWaitForAck /* = true */)
 {
   if (cec_parser)
-    return cec_parser->Transmit(data, bWaitForAck, iTimeout);
+    return cec_parser->Transmit(data, bWaitForAck);
   return false;
 }