I not understand

Hi.

RUN AT COMMAND============================================
StrReturn = adl_atCmdCreate( “AT+CGATT?”, FALSE, (adl_atRspHandler_t) CGATT_Handler ,"*",NULL );

Handler===============================================
bool CGATT_Handler( adl_atUnsolicited_t * CGATT_paras )
{
adl_atSendResponse ( ADL_AT_UNS, CGATT_paras->StrData);
return True
}

I see in terminal : +CREG: 2,1,“43ED”,“254F”

Why comes not correct answer???

Beforehand grateful.

Hi alex !

Do you send AT+CREG command in your application ? Using the same handler ?

You maybe should post your code here to see if we can find something…

hi colin-tfe

adl_atCmdCreate( “AT+CREG?”, FALSE, (adl_atRspHandler_t) CregHandler ,"*",NULL );

HANDLER(AT+CREG?) - CregHandler…

and

HANDLER(AT+CGATT?) - CGATTHandler…

For testing purposes you could use ADL_AT_RSP instead of ADL_AT_UNS.

So maybe "+CREG: 2,1,“43ED”,“254F” " comes from CREG response Handler !

To be sure, do someting like this :

Handler===============================================
bool CGATT_Handler( adl_atUnsolicited_t * CGATT_paras )
{
adl_atSendResponse ( ADL_AT_UNS, "CGATT Response : ");
adl_atSendResponse ( ADL_AT_UNS, CGATT_paras->StrData);
return True
}

Handler===============================================
bool CREG_Handler( adl_atUnsolicited_t * CREG_paras )
{
adl_atSendResponse ( ADL_AT_UNS, "CREG Response : ");
adl_atSendResponse ( ADL_AT_UNS, CREG _paras->StrData);
return True
}

colin-tfe

I try , but result not changed

:frowning:

But does really “+CREG: 2,1,“43ED”,“254F”” come from CGATT response handler ???

Or does “+CREG: 2,1,“43ED”,“254F”” come from CREG response handler and maybe nothing comes from CGATT response handler…?

There is no reason for receiving “+CREG” response afer sending command “AT+CGATT?”…!

I understand, but this exactly so !!!

:frowning:

CGATT Response :
+CREG: 2,1,“1E37”,“4EE2”

Cgatt answer … +

Cgatt answer … C

Cgatt answer … R

Cgatt answer … E

Cgatt answer … G

Cgatt answer … :

Cgatt answer …

Cgatt answer … 2

Cgatt answer … ,

Cgatt answer … 1

Cgatt answer … ,
CGATT Response :
OK

Cgatt answer … O

Cgatt answer … K

Cgatt answer …

Unless it’s an Unsolicited response…

The general form of a +CREG: response is:

+CREG: , [,,]

So +CREG: 2,1,“1E37”,“4EE2” has =2 - which means that unsolicited +CREG: responses are enabled! 8)

See the AT+CREG command for details of how to control unsolicited +CREG: responses…

And CREG_Handler is never called ??? Are you sure you’re not sending the CREG command with the CGATT_Handler ??

Well, there is a possibility to do what you want, but this wont explain why you receive “+CREG” response after “CGATT?” command.

So, when you send a command using adl_atCmdCreate() function, you define a response handler. But you specify which response(s) you want to handle too… then :

For CGATT :

StrReturn = adl_atCmdCreate( "AT+CGATT?", FALSE, (adl_atRspHandler_t) CGATT_Handler ,"+CGATT",NULL );

CGATT_Handler will only be called if +CGATT response is received after sending the command.

For CREG :

StrReturn = adl_atCmdCreate( "AT+CREG?", FALSE, (adl_atRspHandler_t) CREG_Handler ,"+CREG",NULL );

CREG_Handler will only be called if +CREG response is received after sending the command.

I think you’ll need to post what module and what version of the firmware and OpenAT that is being used.

if I run AT+CREG? in tenminal , I response answer +CREG:0,1

???

I used:
1- CREG
2- CGATT (after CREG and reseive answer from CREGHandler)
3- And in this time I take call.
4- OS- 655

But can be this because of that that I take call in this time?