if (byte >= MSGESC && byte != MSGSTART)
{
push_back(MSGESC);
- push_back(byte - ESCOFFSET);
+ push_back((uint8_t) (byte - ESCOFFSET));
}
else
- push_back(byte);
+ push_back((uint8_t) byte);
}
CAdapterCommunication::CAdapterCommunication(CLibCEC *controller) :
uint8_t buf = 0;
if (!m_inBuffer.Pop(buf))
{
- if (!m_rcvCondition.Wait(&m_mutex, iTarget - iNow))
+ if (!m_rcvCondition.Wait(&m_mutex, (uint32_t) (iTarget - iNow)))
return false;
}
bool CCECProcessor::GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language)
{
*language = m_busDevices[iAddress]->GetMenuLanguage();
- return (strcmp(language->language, "???"));
+ return (strcmp(language->language, "???") == 0);
}
uint64_t CCECProcessor::GetDeviceVendorId(cec_logical_address iAddress)
{
cec_menu_language language;
language.device = command.initiator;
- for (unsigned int iPtr = 0; iPtr < 4; iPtr++)
+ for (uint8_t iPtr = 0; iPtr < 4; iPtr++)
language.language[iPtr] = command.parameters[iPtr];
language.language[3] = 0;
device->SetMenuLanguage(language);
}
}
-int8_t CSerialPort::Write(const CCECAdapterMessage &data)
+int8_t CSerialPort::Write(CCECAdapterMessagePtr data)
{
CLockObject lock(&m_mutex);
DWORD iBytesWritten = 0;
if (!m_bIsOpen)
return -1;
- if (!WriteFile(m_handle, data.packet.data, data.size(), &iBytesWritten, NULL))
+ if (!WriteFile(m_handle, data->packet.data, data->size(), &iBytesWritten, NULL))
{
m_error = "Error while writing to COM port";
FormatWindowsError(GetLastError(), m_error);