adl_atCmdSend() question


#1

Hello,

Anyone could help me with this? in the code cmd function works OK but cmd_p doesn’t.
What should I do if the commands are not const. e.g. AT+CMGD=X … AT+CMGW=“XXX” …

bool cmd_Handler(adl_atResponse_t *paras)
{
if (paras->RspID == ADL_STR_OK)
TRACE((1, “OK”));
return TRUE;
}
void cmd(void)
{
adl_atCmdSend(“AT”, cmd_Handler);
}
void cmd_p(void)
{
ascii cmd[3];
strcpy(cmd, “AT”);
adl_atCmdSend(cmd, cmd_Handler);
}


#2

The same thing you’d do in any other ‘C’ program when you want to build a string at run time…


#3

It doesn’t work. Have you tried anything and it worked?

I tried it as the cmd_p() in the code but it didn’t work.


#4

somthing wrong with adl_atCmdSend().

adl_atCmdCreate() works. My problem is solved.


#5

Have a look at the prototype for adl_atCmdSend:

s8 adl_atCmdSend ( ascii * atstr, adl_atRspHandler_t rsphdl, … );

You should have:

adl_atCmdSend(cmd, cmd_Handler, "*", NULL);

in order to receive responses.