The below code works perfectly on my ubuntu desktop but fails on BBB ubuntu! In the code I'm reading from usb GPS device /dev/ttyUSB0. Loop breaks when device is unplugged and waits 90 seconds to reopen the device and start reading. On BBB when GPS device is unplugged CPU is 100% used void main(){ opendevice: FILE *f = fopen("/dev/ttyUSBS0", "r"); c = (char) getc(f); while (c != EOF) { if (c == '@') { i = 0; c = getc(f); while (c != '#') { if (c == EOF) { break; } buf[i] = c; i++; c = getc(f); } buf[i] = '\0'; printf("%s\n",buf); } else if (c == -1) { break; } c = (char) getc(f); } sleep(90); goto opendevice; } I'm speculating that getc function is not returning correct EOF character on device unplug.
-- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.