Update telem.c

pull/51/head
alanbjohnston 6 years ago committed by GitHub
parent 943c6b693d
commit d4955ed370
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -126,24 +126,24 @@ struct SensorData read_sensor_data(struct SensorConfig sensor) {
struct SensorConfig config_sensor(char *bus, int address, int milliAmps) {
struct SensorConfig data;
printf("Bus size %d Bu[0] size: %d \n", strlen(bus), sizeof(bus[0]) ); // atoi(bus[(strlen(bus)/sizeof(bus[0])) - 1]));
printf("Bus lencth %d \n", atoi(bus[(strlen(bus)/sizeof(bus[0])) - 1]));
FILE *i2cdetect = popen("timeout --preserve-status 5 i2cdetect -y 0", "r");
printf("1\n");
// printf("1\n");
pclose(i2cdetect);
printf("2\n");
// printf("2\n");
i2cdetect = popen("echo $?", "r");
// printf("i2cdetect 0 output: %d\n", getc(i2cdetect));
printf("i2cdetect 0 output: %d\n", getc(i2cdetect));
int error = pclose(i2cdetect);
printf("i2cdetect 0 error: %d \n", error);
printf("3\n");
i2cdetect = popen("timeout --preserve-status 5 i2cdetect -y 1", "r");
printf("4\n");
// printf("4\n");
pclose(i2cdetect);
printf("5\n");
// printf("5\n");
i2cdetect = popen("echo $?", "r");
// printf("i2cdetect 1 output: %d\n", getc(i2cdetect));
printf("i2cdetect 1 output: %d\n", getc(i2cdetect));
error = pclose(i2cdetect)/256;
printf("i2cdetect 1 error: %d \n", error);

Loading…
Cancel
Save

Powered by TurnKey Linux.