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);
}
awneil
January 9, 2013, 3:18pm
2
The same thing you’d do in any other ‘C’ program when you want to build a string at run time…
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.
somthing wrong with adl_atCmdSend().
adl_atCmdCreate() works. My problem is solved.
Have a look at the prototype for adl_atCmdSend:
s8 adl_atCmdSend ( ascii * atstr, adl_atRspHandler_t rsphdl, … );
atstr:
The string (name) of the command we want to send. Since this service only handles AT commands, this string has to begin by the “AT” characters.
rsphdl:
The response handler of the callback function associated to the command.
…:
A list of strings of the response to subscribed to. This list has to be terminated by NULL.
You should have:
adl_atCmdSend(cmd, cmd_Handler, "*", NULL);
in order to receive responses.