diff --git a/branches/follower/wiz810mj/src/demo/WizDemo3/WizDemo3.pde b/branches/follower/wiz810mj/src/demo/WizDemo3/WizDemo3.pde index 7637177..fd1a2f0 100644 --- a/branches/follower/wiz810mj/src/demo/WizDemo3/WizDemo3.pde +++ b/branches/follower/wiz810mj/src/demo/WizDemo3/WizDemo3.pde @@ -201,12 +201,27 @@ uint8_t readByte() { int readMatch(char *stringToMatch) { + /* + + Routine to read and match bytes received. + + (Essentially strcmp replacement without requiring a large receive buffer.) + + NOTE: Failed matches drop all bytes read so far. (i.e. you can't check for + a bunch of possible matches from the same starting position). + TODO: Fix this. + + Note: This blocks if there isn't enough data in the rx buffer. + + */ while (getSn_RX_RSR(testSocket) < strlen(stringToMatch)) { // block // TODO: Return error or wait or "too short"? } + // TODO: Do fancy string-matching techniques to avoid reading the whole string + // on non-matches. :-) for (int currCharIdx = 0; currCharIdx < strlen(stringToMatch); currCharIdx++) { if (readByte() != stringToMatch[currCharIdx]) { return 0;