adl_atCmdSubscribe


#1

Hello all.

I have another little doubt. I want an AT command to get/set a SIM card PIN and some other data. The problem here is that if I do

adl_atCmdSubscribe ( “AT+T2RUSR”, Cmdt2rusr_Handler, ADL_CMD_TYPE_PARA | ADL_CMD_TYPE_TEST | ADL_CMD_TYPE_READ );

and then use the AT command as “AT+T2RUSR=1234,abc,123”, i get ERROR. I think it is because first and third parameters are numeric only (if I mix the numbers with letters, I get an OK). I put those values into “ascii var[50]” variables using

cmdStr = param->StrData;
wm_strGetParameterString ( var1, cmdStr, 1 );
wm_strGetParameterString ( var2, cmdStr, 2 );
wm_strGetParameterString ( var3, cmdStr, 3 );

Can someone help me with this? Thank you all in advance :slight_smile:


#2

I have discovered a new fact about this thing. I have one command which uses 1 parameter, an another one which uses 3. If I use a numeric value on the first one, I get an error. If I use at least one non numeric value on the second one, I get an OK. The second one is just fine, because one of the fields I want to store must have a few chars. But the first one is still a problem. Could someone help me with the adl_atCmdSubscribe and its handler? Thanks again :slight_smile:


#3

I’m the only one writing here :stuck_out_tongue:.

After a few days, i have found the answer to part of the problem. The trouble with the command using 1 parameter is solved using 0x0011 as an option. It’s subscription would be as follows:

adl_atCmdSubscribe ( “AT+T2RPIN”, Cmdt2rpin_Handler, ADL_CMD_TYPE_PARA | ADL_CMD_TYPE_TEST | ADL_CMD_TYPE_READ | 0x0011 );

The 3 parameters one is still giving some trouble. I have tried using 0x0033, but that is far from solving the problem. Instead, it does not accept any number of parameters (I have tried from 1 to 6 or 7). I have also tried to use 0x0031 and 0x0032 but the same problem appers. Anyone has an answer for this part? The subscription I’m using is like this:

adl_atCmdSubscribe ( “AT+T2RUSR”, Cmdt2rusr_Handler, ADL_CMD_TYPE_PARA | ADL_CMD_TYPE_TEST | ADL_CMD_TYPE_READ /| 0x0033/ );

Thank you all in advance. :slight_smile:


#4

You could just try with:
AT+T2RUSR=“1234”,“abc”,“123” instead.

Not sure when you actually NEED to use quotes and when it’s ok to not though.


#5

I’m afraid that doesn’t work… I have just tried and I still get an ERROR:(. Thanks anyway :slight_smile:


#6

If the AT+T2RUSR command can have 1 to 3 parameters, you need to subscribe using

adl_atCmdSubscribe ( "AT+T2RPIN", Cmdt2rpin_Handler, ADL_CMD_TYPE_PARA | ADL_CMD_TYPE_TEST | ADL_CMD_TYPE_READ | 0x0031 );

Then, if there are any non-numeric parameters, they have to be quoted:

That should do it, I hope.

I’m using the ADL_CMD_TYPE_ROOT more and more often for exactly these reasons… the quotes required around negative numbers and strings are pretty annoying, and I always forget to change subscription when adding new, optional, parameters to my AT commands.