try single fgets read

pull/51/head
alanbjohnston 5 years ago committed by GitHub
parent 108d53ba28
commit 4929f557e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -139,10 +139,14 @@ struct SensorConfig config_sensor(char *bus, int address, int milliAmps) {
char command[50] = "timeout 5 i2cdetect -y ";
strcat (command, &bus[pos]);
FILE *i2cdetect = popen(command, "r");
/*
while (fgets(result, 128, i2cdetect) != NULL) {
;
// printf("result: %s", result);
}
}
*/
fgets(result, 128, i2cdetect);
int error = pclose(i2cdetect)/256;
// printf("%s error: %d \n", &command, error);
if (error != 0)

Loading…
Cancel
Save

Powered by TurnKey Linux.