I need to perform the following instructions into MQX. I need to get the four ip numbers into four integers(a,b,c,d).
Problem is I am receiving %2E as the "." and the "%" symbol is giving me a lot of trouble. I have tested those lines into a C compiler for PC applications and it works fine but it fails in MQX.
char ip[] = "192%2E168%2E0%2E120";
sscanf(ip, "%d%%%*[2E]%d%%%*[2E]%d%%%*[2E]%d" , &a, &b, &c, &d);
* Function Name : _io_sscanf
* Returned Value : _mqx_int
* Comments :
* This function performs similarly to the 'C' sscanf function.
* See scanline.c for comments.
* The function returns the number of input items converted and assigned}
Where do I find scanline.c file in order to see the comments?
I need to see what does the sscanf function can do in order to get this working.
Let me know if someone knows a way around this.
Thanks in advanced.
You can find the right file here:
mqx/source/fio/io_scanl.c
Sorry for bad comment.
PetrM
Sorry to say that, but there seems to be no support for '%' escaping.
Please consider input preprocessing (replace %2E with something sscanf knows).