cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_IMAGE_VIEW_ON);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitStandby(const cec_logical_address iInitiator, const cec_logical_address iDestination)
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_STANDBY);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitRequestCecVersion(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse /* = true */)
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_GET_CEC_VERSION);
- return Transmit(command, bWaitForResponse, CEC_OPCODE_CEC_VERSION);
+ return Transmit(command, !bWaitForResponse);
}
bool CCECCommandHandler::TransmitRequestMenuLanguage(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse /* = true */)
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_GET_MENU_LANGUAGE);
- return Transmit(command, bWaitForResponse, CEC_OPCODE_SET_MENU_LANGUAGE);
+ return Transmit(command, !bWaitForResponse);
}
bool CCECCommandHandler::TransmitRequestOSDName(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse /* = true */)
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_GIVE_OSD_NAME);
- return Transmit(command, bWaitForResponse, CEC_OPCODE_SET_OSD_NAME);
+ return Transmit(command, !bWaitForResponse);
}
bool CCECCommandHandler::TransmitRequestPhysicalAddress(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse /* = true */)
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_GIVE_PHYSICAL_ADDRESS);
- return Transmit(command, bWaitForResponse, CEC_OPCODE_REPORT_PHYSICAL_ADDRESS);
+ return Transmit(command, !bWaitForResponse);
}
bool CCECCommandHandler::TransmitRequestPowerStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse /* = true */)
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_GIVE_DEVICE_POWER_STATUS);
- return Transmit(command, bWaitForResponse, CEC_OPCODE_REPORT_POWER_STATUS);
+ return Transmit(command, !bWaitForResponse);
}
bool CCECCommandHandler::TransmitRequestVendorId(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse /* = true */)
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
- return Transmit(command, bWaitForResponse, CEC_OPCODE_DEVICE_VENDOR_ID);
+ return Transmit(command, !bWaitForResponse);
}
bool CCECCommandHandler::TransmitActiveSource(const cec_logical_address iInitiator, uint16_t iPhysicalAddress)
command.parameters.PushBack((uint8_t) ((iPhysicalAddress >> 8) & 0xFF));
command.parameters.PushBack((uint8_t) (iPhysicalAddress & 0xFF));
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitCECVersion(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_version cecVersion)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_CEC_VERSION);
command.parameters.PushBack((uint8_t)cecVersion);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitInactiveSource(const cec_logical_address iInitiator, uint16_t iPhysicalAddress)
command.parameters.PushBack((iPhysicalAddress >> 8) & 0xFF);
command.parameters.PushBack(iPhysicalAddress & 0xFF);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitMenuState(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_menu_state menuState)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_MENU_STATUS);
command.parameters.PushBack((uint8_t)menuState);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitOSDName(const cec_logical_address iInitiator, const cec_logical_address iDestination, CStdString strDeviceName)
for (size_t iPtr = 0; iPtr < strDeviceName.length(); iPtr++)
command.parameters.PushBack(strDeviceName.at(iPtr));
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitOSDString(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_display_control duration, const char *strMessage)
for (size_t iPtr = 0; iPtr < iLen; iPtr++)
command.parameters.PushBack(strMessage[iPtr]);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitPhysicalAddress(const cec_logical_address iInitiator, uint16_t iPhysicalAddress, cec_device_type type)
command.parameters.PushBack((uint8_t) (iPhysicalAddress & 0xFF));
command.parameters.PushBack((uint8_t) (type));
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitSetMenuLanguage(const cec_logical_address iInitiator, const char lang[3])
command.parameters.PushBack((uint8_t) lang[1]);
command.parameters.PushBack((uint8_t) lang[2]);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitPoll(const cec_logical_address iInitiator, const cec_logical_address iDestination)
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_NONE);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitPowerState(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_power_status state)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_REPORT_POWER_STATUS);
command.parameters.PushBack((uint8_t) state);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitVendorID(const cec_logical_address iInitiator, uint64_t iVendorId)
command.parameters.PushBack((uint8_t) (((uint64_t)iVendorId >> 8) & 0xFF));
command.parameters.PushBack((uint8_t) ((uint64_t)iVendorId & 0xFF));
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitAudioStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint8_t state)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_REPORT_AUDIO_STATUS);
command.parameters.PushBack(state);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitSetSystemAudioMode(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_SET_SYSTEM_AUDIO_MODE);
command.parameters.PushBack((uint8_t)state);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitSetStreamPath(uint16_t iStreamPath)
command.parameters.PushBack((uint8_t) ((iStreamPath >> 8) & 0xFF));
command.parameters.PushBack((uint8_t) (iStreamPath & 0xFF));
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitSystemAudioModeStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_system_audio_status state)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS);
command.parameters.PushBack((uint8_t)state);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitDeckStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_deck_info state)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_DECK_STATUS);
command.PushBack((uint8_t)state);
- return Transmit(command, false);
+ return Transmit(command);
}
bool CCECCommandHandler::TransmitKeypress(const cec_logical_address iInitiator, const cec_logical_address iDestination, cec_user_control_code key, bool bWait /* = true */)
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_USER_CONTROL_PRESSED);
command.parameters.PushBack((uint8_t)key);
- return Transmit(command, bWait);
+ return Transmit(command, !bWait);
}
bool CCECCommandHandler::TransmitKeyRelease(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWait /* = true */)
cec_command command;
cec_command::Format(command, iInitiator, iDestination, CEC_OPCODE_USER_CONTROL_RELEASE);
- return Transmit(command, bWait);
+ return Transmit(command, !bWait);
}
-bool CCECCommandHandler::Transmit(cec_command &command, bool bExpectResponse /* = true */, cec_opcode expectedResponse /* = CEC_OPCODE_NONE */)
+bool CCECCommandHandler::Transmit(cec_command &command, bool bSuppressWait /* = false */)
{
bool bReturn(false);
+ cec_opcode expectedResponse(cec_command::GetResponseOpcode(command.opcode));
+ bool bExpectResponse(expectedResponse != CEC_OPCODE_NONE && !bSuppressWait);
command.transmit_timeout = m_iTransmitTimeout;
if (command.initiator == CECDEVICE_UNKNOWN)