I not understand


#1

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.


#2

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…


#3

hi colin-tfe

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

HANDLER(AT+CREG?) - CregHandler…

and

HANDLER(AT+CGATT?) - CGATTHandler…


#4

For testing purposes you could use ADL_AT_RSP instead of ADL_AT_UNS.


#5

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
}


#6

colin-tfe

I try , but result not changed

:frowning:


#7

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?”…!


#8

I understand, but this exactly so !!!

:frowning:


#9

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 …


#10

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…


#11

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.


#12

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


#13

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

???


#14

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?