|
|
|
|
@ -143,9 +143,10 @@ struct SensorConfig config_sensor(char *bus, int address, int milliAmps) {
|
|
|
|
|
// printf("2\n");
|
|
|
|
|
// i2cdetect = popen("echo $?", "r");
|
|
|
|
|
// printf("getc i2cdetect 1 output: %d\n", getc(i2cdetect));
|
|
|
|
|
while (fgets(buf, BUFSIZE, i2cdetect) != NULL) {
|
|
|
|
|
/* while (fgets(buf, BUFSIZE, i2cdetect) != NULL) {
|
|
|
|
|
printf("OUTPUT: %s", buf);
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
int error = pclose(i2cdetect)/256;
|
|
|
|
|
printf("%s error: %d \n", &command, error);
|
|
|
|
|
|
|
|
|
|
@ -156,9 +157,10 @@ struct SensorConfig config_sensor(char *bus, int address, int milliAmps) {
|
|
|
|
|
// printf("2\n");
|
|
|
|
|
// i2cdetect = popen("echo $?", "r");
|
|
|
|
|
// printf("getc echo output: %d\n", getc(i2cdetect));
|
|
|
|
|
while (fgets(buf, BUFSIZE, i2cdetect2) != NULL) {
|
|
|
|
|
/* while (fgets(buf, BUFSIZE, i2cdetect2) != NULL) {
|
|
|
|
|
printf("OUTPUT: %s", buf);
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
error = pclose(i2cdetect2)/256;
|
|
|
|
|
printf("%s error: %d \n", &command, error);
|
|
|
|
|
|
|
|
|
|
|