#include "USBCECAdapterCommands.h"
#include "USBCECAdapterMessageQueue.h"
#include "USBCECAdapterMessage.h"
+#include "USBCECAdapterDetection.h"
#include "lib/platform/sockets/serialport.h"
#include "lib/platform/util/timeutils.h"
#include "lib/platform/util/util.h"
#define CEC_LATEST_ADAPTER_FW_DATE 0x501a4b0c
#define CEC_FW_DATE_EXTENDED_RESPONSE 0x501a4b0c
+#define CEC_FW_DATE_DESCRIPTOR2 0x5045dbf5
#define LIB_CEC m_callback->GetLib()
}
/* TODO sleep 5 ms so other threads can get a lock */
- Sleep(5);
+ if (!IsStopped())
+ Sleep(5);
}
m_adapterMessageQueue->Clear();
return iBuildDate >= CEC_FW_DATE_EXTENDED_RESPONSE;
}
+uint16_t CUSBCECAdapterCommunication::GetAdapterVendorId(void) const
+{
+ return CEC_VID;
+}
+
+uint16_t CUSBCECAdapterCommunication::GetAdapterProductId(void) const
+{
+ uint32_t iBuildDate(0);
+ if (m_commands)
+ iBuildDate = m_commands->GetPersistedBuildDate();
+
+ return iBuildDate >= CEC_FW_DATE_DESCRIPTOR2 ? CEC_PID2 : CEC_PID;
+}
+
bool CUSBCECAdapterCommunication::IsRunningLatestFirmware(void)
{
return GetFirmwareBuildDate() >= CEC_LATEST_ADAPTER_FW_DATE &&
CLockObject lock(m_mutex);
if (m_iScheduleEepromWrite > 0)
m_com->LIB_CEC->AddLog(CEC_LOG_WARNING, "write thread stopped while a write was queued");
+ m_bWrite = true;
m_condition.Signal();
}
StopThread();
if ((m_iScheduleEepromWrite > 0 && m_iScheduleEepromWrite < GetTimeMs()) ||
m_condition.Wait(m_mutex, m_bWrite, 100))
{
+ if (IsStopped())
+ break;
m_bWrite = false;
if (m_com->m_commands->WriteEEPROM())
{