Log in

View Full Version : Arrayread and DEC modifier issue



Marcick
- 25th January 2021, 15:55
I have a buffer containing this string:


+UUSORD: 0,7

To be sure I'm not lost in space :D here is the ascii scan of the buffer, that ends with a Carriage Returns 13:


[43][85][85][83][79][82][68][58][32][48][44][55][13]

I'm using Arrayread to capture the last "7" that can be a number of also 2 or 3 digits


arrayread BufferTemp ,20,NotFound,[WAIT("+UUSORD: ",44), DEC GPRS_SocketChar]

But it does not work and the code jumps to "NotFound"

As I'm reading on the manual, "DEC will wait for a recognized character to begin conversion, and automatically end conversion when an unrecognized character is encountered" so it should capture the "7" and exit when the next char(13) is found.

Can you see where I'm wrong ?

pedja089
- 25th January 2021, 20:35
It is OK, that jumps to that label.
This sequence "+UUSORD: ",44 never arrive. All characters must be in sequence for single wait instruction.

You can do it like this
arrayread BufferTemp ,20,NotFound,[WAIT("+UUSORD: "), WAIT(44), DEC GPRS_SocketChar]

Marcick
- 26th January 2021, 07:35
Thank you Pedja, you are right !
It was a very stupid mistake.
Cheers