* @param deviceList The vector to store device descriptors in.
* @param iBufSize The size of the deviceList buffer.
* @param strDevicePath Optional device path. Only adds device descriptors that match the given device path.
+ * @param bQuickScan True to do a "quick scan", which will not open a connection to the adapter. Firmware version information and the exact device type will be missing
* @return The number of devices that were found, or -1 when an error occured.
*/
- virtual int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL) = 0;
+ virtual int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL, bool bQuickScan = false) = 0;
};
};
extern DECLSPEC uint8_t cec_audio_get_status(void);
#ifdef __cplusplus
-extern DECLSPEC int8_t cec_detect_adapters(CEC::cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath);
+extern DECLSPEC int8_t cec_detect_adapters(CEC::cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath, int bQuickScan);
#else
-extern DECLSPEC int8_t cec_detect_adapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath);
+extern DECLSPEC int8_t cec_detect_adapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath, int bQuickScan);
#endif
#ifdef __cplusplus
return m_client ? m_client->AudioStatus() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN;
}
-int8_t CLibCEC::DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */)
+int8_t CLibCEC::DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */, bool bQuickScan /* = false */)
{
int8_t iAdaptersFound = CAdapterFactory(this).DetectAdapters(deviceList, iBufSize, strDevicePath);
- for (int8_t iPtr = 0; iPtr < iAdaptersFound; iPtr++)
+ if (!bQuickScan)
{
- libcec_configuration config;
- GetDeviceInformation(deviceList[iPtr].strComName, &config);
- deviceList[iPtr].iFirmwareVersion = config.iFirmwareVersion;
- deviceList[iPtr].iPhysicalAddress = config.iPhysicalAddress;
- deviceList[iPtr].iFirmwareBuildDate = config.iFirmwareBuildDate;
- deviceList[iPtr].adapterType = config.adapterType;
+ for (int8_t iPtr = 0; iPtr < iAdaptersFound; iPtr++)
+ {
+ libcec_configuration config;
+ GetDeviceInformation(deviceList[iPtr].strComName, &config);
+ deviceList[iPtr].iFirmwareVersion = config.iFirmwareVersion;
+ deviceList[iPtr].iPhysicalAddress = config.iPhysicalAddress;
+ deviceList[iPtr].iFirmwareBuildDate = config.iFirmwareBuildDate;
+ deviceList[iPtr].adapterType = config.adapterType;
+ }
}
return iAdaptersFound;
}
void Close(void);
bool EnableCallbacks(void *cbParam, ICECCallbacks *callbacks);
int8_t FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL);
- int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL);
+ int8_t DetectAdapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath = NULL, bool bQuickScan = false);
bool PingAdapter(void);
bool StartBootloader(void);
return cec_parser ? cec_parser->AudioStatus() : (uint8_t)CEC_AUDIO_VOLUME_STATUS_UNKNOWN;
}
-int8_t cec_detect_adapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */)
+int8_t cec_detect_adapters(cec_adapter_descriptor *deviceList, uint8_t iBufSize, const char *strDevicePath, int bQuickScan)
{
if (cec_parser)
- return cec_parser->DetectAdapters(deviceList, iBufSize, strDevicePath);
+ return cec_parser->DetectAdapters(deviceList, iBufSize, strDevicePath, bQuickScan);
return -1;
}
snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_RPI_VIRTUAL_COM);
deviceList[iAdaptersFound].iVendorId = RPI_ADAPTER_VID;
deviceList[iAdaptersFound].iProductId = RPI_ADAPTER_PID;
+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_RPI;
iAdaptersFound++;
}
#endif
snprintf(deviceList[iAdaptersFound].comm, sizeof(deviceList[iAdaptersFound].strComName), CEC_TDA995x_VIRTUAL_COM);
deviceList[iAdaptersFound].iVendorId = TDA995X_ADAPTER_VID;
deviceList[iAdaptersFound].iProductId = TDA995X_ADAPTER_PID;
+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_TDA995x;
iAdaptersFound++;
}
#endif
snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", bsdPath);
deviceList[iFound].iVendorId = iVendor;
deviceList[iFound].iProductId = iProduct;
+ deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type
iFound++;
}
}
snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", strComm.c_str());
deviceList[iFound].iVendorId = iVendor;
deviceList[iFound].iProductId = iProduct;
+ deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type
iFound++;
}
}
snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicedetailData->DevicePath);
deviceList[iFound].iVendorId = iVendor;
deviceList[iFound].iProductId = iProduct;
+ deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type
iFound++;
}
}
snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicedetailData->DevicePath);
deviceList[iFound].iVendorId = iVendor;
deviceList[iFound].iProductId = iProduct;
+ deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type
iFound++;
}
}
snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", devicePath);
deviceList[iFound].iVendorId = CEC_VID;
deviceList[iFound].iProductId = CEC_VID;
+ deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type
iFound++;
}
}