src/main/c/Posix/PosixHelperFunctions.c [650:676]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - else { // See if the device has a registered friendly name friendlyName[0] = '\0'; sprintf(basePathEnd, "../product"); FILE *input = fopen(fileName, "rb"); if (input) { fgets(friendlyName, 256, input); friendlyName[strcspn(friendlyName, "\r\n")] = '\0'; fclose(input); } if (friendlyName[0] == '\0') assignFriendlyName(portDevPath, friendlyName); // Attempt to read the bus-reported device description interfaceDescription[0] = '\0'; sprintf(basePathEnd, "interface"); input = fopen(fileName, "rb"); if (input) { fgets(interfaceDescription, 256, input); interfaceDescription[strcspn(interfaceDescription, "\r\n")] = '\0'; fclose(input); } if (interfaceDescription[0] == '\0') strcpy(interfaceDescription, friendlyName); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - src/main/c/Posix/PosixHelperFunctions.c [704:730]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - else // Emulated serial port { // See if the device has a registered friendly name friendlyName[0] = '\0'; sprintf(basePathEnd, "../product"); FILE *input = fopen(fileName, "rb"); if (input) { fgets(friendlyName, 256, input); friendlyName[strcspn(friendlyName, "\r\n")] = '\0'; fclose(input); } if (friendlyName[0] == '\0') assignFriendlyName(portDevPath, friendlyName); // Attempt to read the bus-reported device description interfaceDescription[0] = '\0'; sprintf(basePathEnd, "interface"); input = fopen(fileName, "rb"); if (input) { fgets(interfaceDescription, 256, input); interfaceDescription[strcspn(interfaceDescription, "\r\n")] = '\0'; fclose(input); } if (interfaceDescription[0] == '\0') strcpy(interfaceDescription, friendlyName); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -