int check, count, input = 0;
for(count = 0; input != EOF; ++count)
{
input = getchar();
check = input != EOF ? 1 : 0;
printf("%d %d\n", check, count);
}
USB has a start of frame packet or keep alive sent periodically on the bus. This prevents an idle bus from entering suspend mode in the absence of data.
•A high speed bus will have micro-frames sent every 125.0 µs ±62.5 ns.
•A full speed bus will have a frame sent down each 1.000 ms ±500 ns.