cec: missed 1 TODO in LibCecSharp.cpp. copy command parameters in GetNextCommand()
[deb_libcec.git] / src / LibCecSharp / LibCecSharp.cpp
index c72e0dd2d62ec04f8a817cdd387f890e81aee8fc..0aec2ff111823d8145a0883ce37e53783c03b42e 100644 (file)
@@ -411,8 +411,10 @@ public:
     cec_command command;
     if (m_libCec->GetNextCommand(&command))
     {
-      // TODO parameters
-      return gcnew CecCommand((CecLogicalAddress)command.initiator, (CecLogicalAddress)command.destination, command.ack == 1 ? true : false, command.eom == 1 ? true : false, command.opcode, command.transmit_timeout);
+      CecCommand ^ retVal = gcnew CecCommand((CecLogicalAddress)command.initiator, (CecLogicalAddress)command.destination, command.ack == 1 ? true : false, command.eom == 1 ? true : false, command.opcode, command.transmit_timeout);
+      for (uint8_t iPtr = 0; iPtr < command.parameters.size; iPtr++)
+        retVal->Parameters->PushBack(command.parameters[iPtr]);
+      return retVal;
     }
 
     return gcnew CecCommand();
@@ -421,12 +423,12 @@ public:
   bool Transmit(CecCommand ^ command)
   {
     cec_command ccommand;
-    cec_command::format(ccommand, (cec_logical_address)command->Initiator, (cec_logical_address)command->Destination, (cec_opcode)command->Opcode);
+    cec_command::Format(ccommand, (cec_logical_address)command->Initiator, (cec_logical_address)command->Destination, (cec_opcode)command->Opcode);
     ccommand.transmit_timeout = command->TransmitTimeout;
     ccommand.eom              = command->Eom;
     ccommand.ack              = command->Ack;
     for (unsigned int iPtr = 0; iPtr < command->Parameters->Size; iPtr++)
-      ccommand.parameters.push_back(command->Parameters->Data[iPtr]);
+      ccommand.parameters.PushBack(command->Parameters->Data[iPtr]);
 
     return m_libCec->Transmit(ccommand);
   }