Concatenated custom AT command

Hi everybody,

I subscribed to two custom at commands: at#cmd and at#othercmd
They work without problem

Now, I would like to concatenate them as for native commands, i.e.

at#cmd=param1,param2;#othercmd=param

The first command is executed, the second no.
Moreover, after that the parser is blocked so any command (including the simple AT command) returns ERROR.

Does anyone suggest what could be the problem?

I verify that a native command followed by a custom command works, for example

at+creg?;#cmd=param1,param2

but the opposite doesn’t work.

That’s my settings:

“DWL”,“V08b13”,"",“Sierra Wireless”,55344,“111611 18:03”,“dda36757”,“00010000”
“FW”,“FW_SRC_747_8_F4_3.Q2687G”,“R7.47.4.201208311102.Q26CL702”,“Sierra Wireless”,2221264,“083112 11:02”,“6aa633a2”,“00020000”
“OAT”,“01.00.20130826143913”,“XXXXXX”,“YYYYY”,301488,“082613 14:39”,“60c60613”,“00260000”
-“Developer Studio”,“2.3.1.201305211601-R11859”
-“Open AT Application Framework package”,“2.37.4.201209061149”
-“Open AT OS Package”,“6.37.0.201202060950”
-“Firmware Package”,“7.47.4.201208311102”
-“ExtendedATApplication Library Package”,“1.11.0.201209041207”
-“Internet Library Package”,“5.43.1.201206250935”
-“Security Plug-in Package”,“1.5.0.201108111447”
“ROM”,“800000”
“RAM”,“200000”
“DWLNAME”,“Q26CL702”

Best Regards.

Hi,

What’s the return of your custom command?

One suspect is that the first command is not exit properly so ADL consider an error thus 2nd command was not executed.

Please refer to ADL user guide, section 3.3.4 Incoming AT Commands, “Important note about incoming concatenated command”.

Hope it helps.
Thx

Dear lotam,

thanks for reply.

I read the section you specify but I didn’t understand how to answer with a single terminal response.

When I subscribe to a command using atCmdSubscribe, I define a cmdHandler which prototype is typedef void (*) adl_atCmdHandler_t (adl_atCmdPreParser_t *Params)
without any return parameter.
Inside the cmdHandler I don’t send any command to modem but I do other stuff.

So, how to answer with ADL_STR_OK?
Should I use adl_atSendStdResponse?

Thank you.

Best Regards.

Update:

I tried to put a adl_atSendStdResponse( ADL_AT_RSP, ADL_STR_OK )

command at the end of the cmdHandler and now I’m able to send two concatenated command

However, I receive an OK on the serial port which is not good for my application.

How to avoid this problem?

Thanks for support.

Davide

Hi Davide,

Not sure what kind of external application is in your design, but for OpenAT, exit with “OK” response is the right way especially for concatenated command. (not big deal when sending custom AT one by one without “OK” in non-concatenated mode)

Still, I think there are few ways to workaround that:

  1. combine both code in two custom AT command into one custom command
  2. if the sequence of concatenated command is always fixed (e.g. AT+abc;+def), we may add “OK” for first custom command but not the last custom command to avoid sending “OK” at the end of process.

In my test, 2nd option prevents the “OK”. e.g.

AT+abc

abc

OK
AT+def

def
at+abc;+def

abc

def
at
OK

But please use with caution, the custom command without “OK” response must be the last command in the concatenated mode. Otherwise port may stay in concatenated mode and unable to handle new commands…

Hope it helps.
Thx

Hi lotam,

thank you very much for explanation and suggestion. I finally understand the principle
about concatenated custom command.

The second solution you propose could be fine.

Thank you again.

Regards,
Davide