cec: display a warning message if libCEC was not compiled with adapter detection...
[deb_libcec.git] / src / lib / LibCEC.cpp
index 56ece65b08d706d7275b6f04fd696ccd1482511e..8838ff4157b48591a864082c436df100e9961e96 100644 (file)
@@ -114,6 +114,12 @@ void CLibCEC::Close(void)
 
 int8_t CLibCEC::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */)
 {
+  if (!CUSBCECAdapterDetection::CanAutodetect())
+  {
+    AddLog(CEC_LOG_WARNING, "libCEC has not been compiled with adapter detection code for this target, so the path to the COM port has to be provided to libCEC");
+    return 0;
+  }
+
   return CUSBCECAdapterDetection::FindAdapters(deviceList, iBufSize, strDevicePath);
 }