adl_atCmdSubscribe & adl_atCmdCreate in one OAT app


#1
void ATD_Handler(adl_atCmdPreParser_t *paras) 
{ 
// here cmd operation 
}

void adl_main(adl_InitType_e adlInitType) 
{ 
adl_atCmdSubscribe("at+zzz", (adl_atCmdHandler_t)ATD_Handler, ADL_CMD_TYPE_ACT); 
//----------------
my_function();
//----------------
}

void my_function()
{
adl_atCmdCreate("at+zzz", FALSE , (adl_atRspHandler_t)_CMD_back, "*", NULL);
}

bool _CMD_back(adl_atResponse_t* params)
{
/*
//---------------------------------------------------
here (params->StrData)  all eq "ERROR"...
//---------------------------------------------------

if adl_atCmdCreate("AT+CGMR"....... or AT+WIMEI?  or more ...all OK

/

  return FALSE;
}

Why?? command not work in one app…

if execute this CMD “at+zzz” in terminal HT … ALL work ok


#2

Go to here :

http://www.wavecom.com/modules/movie/scenes/support/index.php?fuseAction=listFaqs&rootName=Open+AT%AE+OS%3A+APIs

and search question :
" Is it possible to execute a ‘custom AT command’ (new AT command created by the ‘adl_atCmdSubscribe()’ function)with adl_cmdCreate()?"

and read the answer


#3

Why would you want to do it anyway??

If you have implemented the function, then your application can just call the necessary functions directly - no need to mess about with creating an AT command, subscribing responses, and all that nonsense!


#4

Also, read the Notes about the adl_atCmdCreate in the ADL User Guide - it specifically tells you that commands sent with adl_atCmdCreate cannot be filtered by the adl_atCmdSubscribe mechanism! :unamused: