X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fadapter%2FAdapterFactory.cpp;h=02b6200e1616674964f34af5459cc9955ffe6a22;hb=a5a5f6f5437c662e7f8d8e52d32e5cddacc89784;hp=9ee9cc7c664516b51782ef06fcd8b38952fb2763;hpb=29104708fa8abe6f55b83da37702b754486918af;p=deb_libcec.git diff --git a/src/lib/adapter/AdapterFactory.cpp b/src/lib/adapter/AdapterFactory.cpp index 9ee9cc7..02b6200 100644 --- a/src/lib/adapter/AdapterFactory.cpp +++ b/src/lib/adapter/AdapterFactory.cpp @@ -47,6 +47,11 @@ #include "RPi/RPiCECAdapterCommunication.h" #endif +#if defined(HAVE_TDA995X_API) +#include "TDA995x/TDA995xCECAdapterDetection.h" +#include "TDA995x/TDA995xCECAdapterCommunication.h" +#endif + using namespace std; using namespace CEC; @@ -75,7 +80,16 @@ int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, } #endif -#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) +#if defined(HAVE_TDA995X_API) + if (iAdaptersFound < iBufSize && CTDA995xCECAdapterDetection::FindAdapter() && + (!strDevicePath || !strcmp(strDevicePath, CEC_TDA995x_VIRTUAL_COM))) + { + snprintf(deviceList[iAdaptersFound].path, 1024, CEC_TDA995x_PATH); + snprintf(deviceList[iAdaptersFound++].comm, 1024, CEC_TDA995x_VIRTUAL_COM); + } +#endif + +#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration" #endif @@ -84,6 +98,11 @@ int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_t iBaudRate) { +#if defined(HAVE_TDA995X_API) + if (!strcmp(strPort, CEC_TDA995x_VIRTUAL_COM)) + return new CTDA995xCECAdapterCommunication(m_lib->m_cec); +#endif + #if defined(HAVE_RPI_API) if (!strcmp(strPort, CEC_RPI_VIRTUAL_COM)) return new CRPiCECAdapterCommunication(m_lib->m_cec); @@ -93,7 +112,7 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_ return new CUSBCECAdapterCommunication(m_lib->m_cec, strPort, iBaudRate); #endif -#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) +#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) return NULL; #endif }