Browse Source

fixed communication

develop
Robin Thoni 8 years ago
parent
commit
e734a85b23
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      src/DataAccess/ArduinoSerial.cpp
  2. 1
    1
      src/main.cpp

+ 1
- 1
src/DataAccess/ArduinoSerial.cpp View File

180
     if (!res) {
180
     if (!res) {
181
         return res;
181
         return res;
182
     }
182
     }
183
-    return writeBytes((const char*)&data, length);
183
+    return writeBytes(data, length);
184
 }
184
 }
185
 
185
 
186
 BResult ArduinoSerial::writeBytes(const char *data, size_t length)
186
 BResult ArduinoSerial::writeBytes(const char *data, size_t length)

+ 1
- 1
src/main.cpp View File

46
         std::cout << (int) data.getData().first << " " << hexStr(data.getData().second)
46
         std::cout << (int) data.getData().first << " " << hexStr(data.getData().second)
47
         << " " << data.getData().second << std::endl;
47
         << " " << data.getData().second << std::endl;
48
         if (data.getData().first == PACKET_SELF_TEST) {
48
         if (data.getData().first == PACKET_SELF_TEST) {
49
-            SERIAL_PACKET_TYPE_INT status = 42;
49
+            SERIAL_PACKET_TYPE_INT status = ERROR_NONE;
50
             arduinoSerial.write((const char*)&status, sizeof(status));
50
             arduinoSerial.write((const char*)&status, sizeof(status));
51
         }
51
         }
52
     }
52
     }

Loading…
Cancel
Save