wm_strSwitch()

ascii src[]="+CMGL: 1,“REC UNREAD”,"+919686447047",“09/11/17,11:35:43+22”\r\n";

r=wm_strSwitch(src,“REC UNREAD”,NULL);

returns r=0
Dear all i try use the above function but it not giving me the expected result it is always returning zero.
What is the wrong i am doing here?

Anothre example:

ascii src[100]={“what is your name”};
r=wm_strSwitch(src,“your”,NULL);

returns r=0

Am i going out of wavecom?

Please reply for any reason.

what is wm_strSwitch supposed to do?
the funtion doesn’t seem to exist in my environment?
(OS version 6.31)

This function wm_strSwitch is given in Basic Development guide for Open AT OS v3.13 under standard library APIs

ok, foud it… (wasn’t loooking good enough.)

wow. that functionality really seems broken.

might strstr() be an option for you?

ascii src[100]={"what is your name"};
	char * pch;
	pch = strstr(src,"your");
	TRACE ((1,"r=%d",pch));

it returns a pointer to the location in the string, and NULL if no match

Realy good option i will work with this

Thankyou Madouc

That’s from the really old days when there were separate “Basic” and “ADL” APIs.

Now, it is all in the one ADL User Guide - in the section titled, “String Processing Function Set” under “Basic Features”.

i did find it when browsing around in the wm_stdio.h

I am using Q24plus on OS version AT v03.12. So i am referring Basic guide 3.13

I am getting result as below

ascii src[100]={“what is your name”};
r=wm_strSwitch(src,“your”,NULL);

returns r=0

Is it right or wrong?

As Madouc told is function broken?

the function is not responding as discribed in the documentation.

so i conclude it is broken (OS 6.31, FW 7.4a)

If wm_strSwitch does not work as you expect, You had better write a small of piece code to implement similar wm_strSwitch by yourself. c string library and wavecom string utility are very limited and do not expect Wavecom to provide everything for OAT app developers. You may have a look at source code (Match function) at codeguru.com/cpp/cpp/string/ … .php/c2807 to see whether it is good for you. Although it was written in C++, I can rewrite it in C for you if it is useful for you.

Thanks yuantuh

I will make use of strstr()

Have you notified Wavecom?

I haven’t yet.