X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fadapter%2FAdapterFactory.cpp;h=42cdd0beacb7b088cd3a8935c09d9ad38d536121;hb=58691fb86d4dd7daac8b283a1bf1f125f00847a5;hp=ded3b6fc7dc5c7c9c075321b066bb989a14587dd;hpb=16f47961800432dbdd5b3ead717908f383d26d6b;p=deb_libcec.git diff --git a/src/lib/adapter/AdapterFactory.cpp b/src/lib/adapter/AdapterFactory.cpp index ded3b6f..42cdd0b 100644 --- a/src/lib/adapter/AdapterFactory.cpp +++ b/src/lib/adapter/AdapterFactory.cpp @@ -57,7 +57,7 @@ using namespace CEC; int8_t CAdapterFactory::FindAdapters(cec_adapter *deviceList, uint8_t iBufSize, const char *strDevicePath /* = NULL */) { - cec_adapter_descriptor devices[iBufSize]; + cec_adapter_descriptor devices[50]; int8_t iReturn = DetectAdapters(devices, iBufSize, strDevicePath); for (int8_t iPtr = 0; iPtr < iReturn; iPtr++) { @@ -91,6 +91,7 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 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 @@ -99,10 +100,11 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8 if (iAdaptersFound < iBufSize && CTDA995xCECAdapterDetection::FindAdapter() && (!strDevicePath || !strcmp(strDevicePath, CEC_TDA995x_VIRTUAL_COM))) { - snprintf(deviceList[iAdaptersFound].path, sizeof(deviceList[iAdaptersFound].strComPath), CEC_TDA995x_PATH); - snprintf(deviceList[iAdaptersFound].comm, sizeof(deviceList[iAdaptersFound].strComName), CEC_TDA995x_VIRTUAL_COM); + snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_TDA995x_PATH); + snprintf(deviceList[iAdaptersFound].strComName, 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