//char stringToCompare="comm=1,comm=2";
char *token;
token = strtok(SmsText,",");
while (token != NULL)
{
TRACE((1, "The token is: "));
TRACE((1, token));
token = strtok(NULL,",");
}
If (token == "comm=1")
{
TRACE ((1,"comm1=comm1"));
}
else if (token == "comm=2")
{
TRACE ((1,"comm2=comm2"));
}
else{
TRACE ((1,"not equal"));
}
The result
The token is:
comm=1
The token is:
comm=2
but there is no comparation.
I know that this is the wrong approach but this is the only that i can think of
@SunilRao
I tryed with wm_strGetParameterString but without success.
wm_strGetParameterString ( dst, smsText, 1 )
{
TRACE ((1,“compare”));
TRACE ((1,dst));
}
The result, “compare” and dst are not in the trace.
Note that the ‘==’ operator in ‘C’ does not work for seeing if two strings contain the same text!
For that, you need the strcmp or strncmp standard library function.
See your ‘C’ textbook.
Your approach here needs to be: 1. Isolate the components (tokens) of the message; 2. Determine the content of each component.
I can’t remember if you said these commands were to be typed manually by people?
If they are, they will be a lot easier to use if they are notcase-sensitive…