gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading from the SIM-card (ef loci/cellid)


From: Florin Vancea
Subject: Re: reading from the SIM-card (ef loci/cellid)
Date: Wed, 19 Jan 2005 08:16:37 +0200

Maybe I don't understand, but shouldn't you do

cellid = ((int)(data[7]) << 8) + data[8]; // iirc, byte 8 and 9 contain the
cellid

?

In the original code data[7] is a BYTE and when shifted is shifted as a BYTE
(nothing remains), then added to data[8], resulting a BYTE, then promoted to
int.


----- Original Message ----- 
From: "m.nerurkar" <address@hidden>
To: <address@hidden>
Sent: Monday, January 17, 2005 4:44 PM
Subject: reading from the SIM-card (ef loci/cellid)


> hello,
>
> it's kind of 'off topic',
> i've been talking to pkot, but he didn't implement this part in gnokii so
he
> kind of forwarded me over here :)
> i do hope that i've got more success here, in trying to find the answer
i'm
> looking for.
>
> here is what i'm trying to do: i'm trying to read out the cell id from the
> simcard using the file EF LOCI (0x6f7e).
>
> i can successfully read the 11 bytes out of the SIM from 0x6f7e.
> but i think that i'm doing the bit shifting (MSB/LSB) wrong.
> i hope you can help me:
>
> {
> BYTE data[11]; // the 11 bytes of 0x6f7e
> int cellid;
>
> ReadBytesFromSim( &data ); // successfully reads the info
>
> cellid = (data[7] << 8) + data[8]; // iirc, byte 8 and 9 contain the
cellid
>
> return cellid;
> }
>
> but actually the result is different from what i get if i do 'AT+creg'.
> so i must be something wrong. i hope you can fix this function for me as i
don't
> know how to go on.
>
> thanks in advance,
>
> m.nerurkar
>
>
>
>
>
>
> _______________________________________________
> gnokii-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/gnokii-users
>
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]