cec: fixed - report physical address sends 3 parameters, not 2. check whether the...
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index a23ba660ff79c6d0fd397bec5da2ce90a435650f..366f7dd01b5c20aee7d3fcfe204423b2adf0d639 100644 (file)
@@ -181,8 +181,6 @@ bool CCECCommandHandler::HandleDeviceCecVersion(const cec_command &command)
 
 bool CCECCommandHandler::HandleDeviceVendorCommandWithId(const cec_command &command)
 {
-  SetVendorId(command);
-
   if (m_busDevice->MyLogicalAddressContains(command.destination))
     m_busDevice->GetProcessor()->TransmitAbort(command.initiator, command.opcode, CEC_ABORT_REASON_REFUSED);
 
@@ -300,12 +298,13 @@ bool CCECCommandHandler::HandleMenuRequest(const cec_command &command)
 
 bool CCECCommandHandler::HandleReportPhysicalAddress(const cec_command &command)
 {
-  if (command.parameters.size == 2)
+  if (command.parameters.size == 3)
   {
     uint16_t iNewAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
+    cec_device_type type = (cec_device_type)command.parameters[2];
 
     CCECBusDevice *device = GetDevice(command.initiator);
-    if (device)
+    if (device && device->GetType() == type)
       device->SetPhysicalAddress(iNewAddress);
   }
   return true;