if (!IsOpen())
return false;
- iBytesRead = m_port->Read(buff, sizeof(uint8_t) * iSize, iTimeout);
+ do {
+ /* retry Read() if it was interrupted */
+ iBytesRead = m_port->Read(buff, sizeof(uint8_t) * iSize, iTimeout);
+ } while(m_port->GetErrorNumber() == EINTR);
+
if (m_port->GetErrorNumber())
{
else
bReturn = true;
- /* try to read the build date */
- m_commands->RequestBuildDate();
+ if (m_commands->GetFirmwareVersion() >= 2)
+ {
+ /* try to read the build date */
+ m_commands->RequestBuildDate();
+
+ /* try to read the adapter type */
+ m_commands->RequestAdapterType();
+ }
SetInitialised(bReturn);
return bReturn;
return iBuildDate;
}
+cec_adapter_type CUSBCECAdapterCommunication::GetAdapterType(void)
+{
+ cec_adapter_type type(ADAPTERTYPE_UNKNOWN);
+ if (m_commands)
+ type = (cec_adapter_type)m_commands->GetPersistedAdapterType();
+ if (type == ADAPTERTYPE_UNKNOWN && IsOpen())
+ type = (cec_adapter_type)m_commands->RequestAdapterType();
+
+ return type;
+}
+
bool CUSBCECAdapterCommunication::ProvidesExtendedResponse(void)
{
uint32_t iBuildDate(0);