Getting IMEI number in application


#1

Hi,

i want use IMEI to cryptography in communication via GPRS.
I know how can i get IMEI using AT commands, but how i can get it from my C++ code? Checked ADL manual and didnt find anything about IMEI. Is there a way to use AT in C++? If yes how i can make it?

Greetings

P.S.

Sorry for my lame question but i’m a newbie :slight_smile:


#2

Hi yarns,

Try adl_atCmdCreate… This function lets you do any AT command from ADL. You’ll find something on how to use atCmdCreate in the ADL manual.

Best Regards,
Jan


#3

Yes, you’ll have to use adl_atCmdCreate() :frowning:

Then look-up the appropriate AT Command in the AT Commands Manual, and handle the response in your application

It would be really useful if Wavecome provided direct access to this kind of information without having to mess about with AT commands…

See: wavecom.com/modules/movie/sc … =4187#4187


#4

Still have a problem with it :frowning:

have in main:

adl_atCmdCreate("at+wimei?",
		TRUE,
		(adl_atRspHandler_t)WIMEI_Response_Handler);

and

s16 WIMEI_Response_Handler(adl_atResponse_t *paras)
{
	TRACE (( 1, paras->StrData ));
}

in traces i got message “OK”… so where is imei?

Greetings


#5

I think you need to re-read the documentation for adl_atCmdCreate - hom many parameters should it take…?


#6

Can you be more cleary? When i gives :

adl_atCmdCreate("at+wimei?",
      TRUE,
      (adl_atRspHandler_t)WIMEI_Response_Handler,NULL);

handler is not even called…

Greetings


#7

should be :

adl_atCmdCreate("at+wimei?",
      TRUE,
      (adl_atRspHandler_t)WIMEI_Response_Handler,"+WIMEI",NULL);

always Read The ******* Manual


#8

Yeah i know RTFM :slight_smile:

But i checked it in ADL User Guide and didnt find it there… adl_atCmdCreate is described in 3.2.5.1, and there is nothing about additional parameter like “+WIMEI”… and by the way… still dont work :confused:

when using:

adl_atCmdCreate("at+wimei?",
      TRUE,
      (adl_atRspHandler_t)WIMEI_Response_Handler,"+WIMEI",NULL);

event is not called, so when using:

adl_atCmdCreate("at+wimei?",
      TRUE,
      (adl_atRspHandler_t)WIMEI_Response_Handler,"+WIMEI");

event is called but getting only “OK”
I’m really confused…

Greatings


#9

Yes there is - read it again carefully.
And look at the example provided.

After the response handler, there is a list of responses to “subscribe” to, and the NULL terminates that list.


#10

:blush: Maked some stupid logic error… wondering why cant get IMEI - its normal when trying code like :

else if (paras->RspID==ADL_STR_OK)
{
 //Here send IMEI
}

Sorry for that…

Thank you all for yours help.

Greetings