Hello,
I try to call the function adl_atCmdSendExt with a Context. I need to pass an argument to the callback and I think that the context should be the right way to do that. It seems that the Context is something different than what I thought, because it’s always reinitializated to a value I don’t understand.
The documentation is not very clear, in this case, and I don’t find anything related in the forum. Am I missing something?
The following snippet prints a lcontext different than the value I passed as a Context.
(BTW, ATI3 gives the following line: R71a01gg.Q2686H 2076692 052808 20:08 )
s16 atResp ( adl_atResponse_t *param )
{
if( param->Contxt != NULL )
{
TRACE((1, "VALID CONTEXT"));
u32 lContext= (u32)param->Contxt;
TRACE((1, "lcontext: %d", lContext));
}
else
TRACE((1, "NULL CONTEXT "));
return FALSE;
}
void adl_main ( adl_InitType_e InitType )
{
u32 iContext=12345;
adl_atCmdSendExt("ati3", ADL_PORT_NONE, 0,(void*)iContext, (adl_atRspHandler_t)atResp, "R", NULL);
}
I wonder if there’s a clean way to pass an argument to the atResp callback. I don’t think that using globals is a good solution.
Is there someone that could help me?
Thank you very much in advance.