use spaces instead of tab

This commit is contained in:
john30
2017-01-14 18:01:37 +01:00
parent 917414a6f8
commit ebcb260d5f
47 changed files with 13575 additions and 13575 deletions
+29 -29
View File
@@ -24,39 +24,39 @@ using namespace std;
using namespace ebusd;
int main() {
Device* device = Device::create("/dev/ttyUSB20", true, false, false);
if (device == NULL) {
cout << "unable to create device" << endl;
return -1;
}
result_t result = device->open();
if (result != RESULT_OK) {
cout << "open failed: " << getResultCode(result) << endl;
} else {
if (!device->isValid()) {
cout << "device not available." << endl;
}
int count = 0;
Device* device = Device::create("/dev/ttyUSB20", true, false, false);
if (device == NULL) {
cout << "unable to create device" << endl;
return -1;
}
result_t result = device->open();
if (result != RESULT_OK) {
cout << "open failed: " << getResultCode(result) << endl;
} else {
if (!device->isValid()) {
cout << "device not available." << endl;
}
int count = 0;
while (1) {
unsigned char byte = 0;
result = device->recv(0, byte);
while (1) {
unsigned char byte = 0;
result = device->recv(0, byte);
if (result == RESULT_OK) {
cout << hex << setw(2) << setfill('0')
<< static_cast<unsigned>(byte) << endl;
}
count++;
}
if (result == RESULT_OK) {
cout << hex << setw(2) << setfill('0')
<< static_cast<unsigned>(byte) << endl;
}
count++;
}
device->close();
device->close();
if (!device->isValid()) {
cout << "close successful." << endl;
}
}
if (!device->isValid()) {
cout << "close successful." << endl;
}
}
delete device;
delete device;
return 0;
return 0;
}