Commit 14890c0d authored by Claes Sjofors's avatar Claes Sjofors

IO Arduino sketch, size message check added

parent 8a6f5f81
...@@ -47,7 +47,7 @@ int aoCnt; ...@@ -47,7 +47,7 @@ int aoCnt;
byte msgType; byte msgType;
byte msgId; byte msgId;
byte msgSize; byte msgSize;
byte msgData[100]; byte msgData[128];
byte rmsg[40]; byte rmsg[40];
int sizeErrorCnt = 0; int sizeErrorCnt = 0;
int noMessageCnt = 0; int noMessageCnt = 0;
...@@ -151,9 +151,11 @@ int serialRead() ...@@ -151,9 +151,11 @@ int serialRead()
msgType = Serial.read(); msgType = Serial.read();
msgSize -= 3; msgSize -= 3;
for ( int i = 0; i < msgSize; i++) for ( int i = 0; i < msgSize; i++) {
if ( i >= 128)
break;
msgData[i] = Serial.read(); msgData[i] = Serial.read();
}
csum = check_checksum( msgSize + 3, msgId, msgType, msgData); csum = check_checksum( msgSize + 3, msgId, msgType, msgData);
if ( debug) { if ( debug) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment