samsung: respond to vendor command 0x23 sent by samsung. attempt to fix bugzid: 2164
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 16 May 2013 11:32:07 +0000 (13:32 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 16 May 2013 13:03:21 +0000 (15:03 +0200)
src/lib/implementations/ANCommandHandler.cpp
src/lib/implementations/ANCommandHandler.h

index 16831a974c4680bd897b24ac54708bc4121348dc..115fa88709b261fd0f68351532fabe054a9cf33e 100644 (file)
@@ -92,3 +92,32 @@ bool CANCommandHandler::PowerOn(const cec_logical_address iInitiator, const cec_
 
   return CCECCommandHandler::PowerOn(iInitiator, iDestination);
 }
+
+int CANCommandHandler::HandleDeviceVendorCommandWithId(const cec_command &command)
+{
+  if (!m_processor->IsHandledByLibCEC(command.destination))
+    return CEC_ABORT_REASON_INVALID_OPERAND;
+
+  // samsung's vendor id
+  if (command.parameters[0] == 0x00 && command.parameters[1] == 0x00 && command.parameters[2] == 0xf0)
+  {
+    // unknown vendor command sent to devices
+    if (command.parameters[3] == 0x23)
+    {
+      cec_command response;
+      cec_command::Format(response, command.destination, command.initiator, CEC_OPCODE_VENDOR_COMMAND_WITH_ID);
+
+      // samsung vendor id
+      response.parameters.PushBack(0x00); response.parameters.PushBack(0x00); response.parameters.PushBack(0xf0);
+
+      // XXX see bugzid 2164. reply sent back by audio systems, we might have to send something different
+      response.parameters.PushBack(0x24);
+      response.parameters.PushBack(0x00);
+      response.parameters.PushBack(0x80);
+
+      Transmit(response, false, true);
+      return COMMAND_HANDLED;
+    }
+  }
+  return CEC_ABORT_REASON_INVALID_OPERAND;
+}
index bc4b921cf83f7eb4f0e8adad7116997d4f009826..ab0184a5b85968cba7d06b2ce0a6343017566fc1 100644 (file)
@@ -47,6 +47,7 @@ namespace CEC
 
     int HandleVendorRemoteButtonDown(const cec_command &command);
     int HandleVendorRemoteButtonUp(const cec_command &command);
+    int HandleDeviceVendorCommandWithId(const cec_command &command);
 
   protected:
     bool PowerOn(const cec_logical_address iInitiator, const cec_logical_address iDestination);