removed unused buffering in port and count dumped bytes instead of using tellp(), small fix in wait for bus after lost arbitration

This commit is contained in:
john30
2014-12-25 12:09:27 +01:00
parent 5d02119d1e
commit dd4127f57b
5 changed files with 63 additions and 145 deletions
+3 -6
View File
@@ -36,17 +36,14 @@ int main ()
int count = 0;
while (1) {
ssize_t bytes_read;
result_t result;
unsigned char byte = 0;
bytes_read = port.recv(0);
result = port.recv(0, byte);
for (int i = 0; i < bytes_read; i++)
byte = port.byte();
if (result == RESULT_OK)
cout << hex << setw(2) << setfill('0')
<< static_cast<unsigned>(byte) << endl;
bytes_read = 0;
count++;
}