Waits string.
waitrecv <sub-string> <len> <pos>
Pauses until a string, which satisfies a condition, is received from the host, or until the timeout occurs.
The condition is:
The length of the string is <len>, and the string contains the <sub-string> beginning at the <pos>th character.
For example, if <sub-string> is "def" and <len> is 9 and <pos> is 4, the string "abcdefghi" satisfies the condition.
If such a string is received, it is saved in the system variable "inputstr".
If the system variable "timeout" or "mtimeout" is greater than zero, the timeout occurs when <timeout>.<mtimeout> seconds have passed. If the timeout is less than or equal to zero, the timeout never occurs.
These commands return one of the following values in the system variable "result":
Value | Meaning |
---|---|
-1 | A string, which contains the <sub-string> beginning at the <pos>th character, has been received, and saved in the "inputstr", but its length is less than <len> because of the timeout. |
0 | Timeout. No string, which satisfies the condition, has been received. |
1 | A string, which satisfies the condition, has been received, and saved in the "inputstr". |