PDA

View Full Version : HSERIN WAIT parameter



tishri
- 9th December 2008, 04:39
Hi,

Is it possible for WAIT command in HSerin to wait for either for the string "OK" or "ERROR"?

What I want to happen is that, if Either of the String "Ok" or "Error" is received the HSERIN will start to put received buffer to variable.

Thanks

mackrackit
- 9th December 2008, 10:13
You can not WAIT for both at the same time.

Depending on you application...
Wait for one and if not received, use the TIMEOUT option to goto a wait for the other.
Or...
Take all data all the time into an array, then check the array for "OK" or "ERROR". Then process from there.

tishri
- 9th December 2008, 10:23
thank you.



hserin 1000, _WaitTimeOut, [str rbuffer\5\13]
endif

lookdown2 rbuffer, ["OK",$FF,$FF,$FF ,"ERROR","+CMTI","+CMGR"], b0
b0=b0/5