My Plurk, see what I am thinking now!

2012年1月31日星期二

NITZ - Network Identity and Time Zone (時區計算)

因為最近要用儀器來測試NITZ這個東西,所以研究了一下。
NITZ對手機來說是很方便的功能,大部分都是有支援的,不過網路端就不太一定。
印象中台灣大哥大還是遠傳就不支援NITZ這個功能

在 MM information 裡會存在一個數值叫 "TP-Service-Centre-Time-Stamp (TP-SCTS)"
從這邊手機可以得知網路現在給你的正確時間

這個地方我覺得最重要的就是解析Time Zone!
3GPP的文件上是寫著
In the first of the two semi-octets, the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field) represents the algebraic sign of this difference (0: positive, 1: negative).

但看完這段英文根本不知道怎麼辦,後來查網路+問人後才知道!看案例最快了

1. 十進位轉十六進位(通常收到都是十六進位)
2. 十六進位前後分開轉成二進位
3. 第二個Octets的bit3,也就是右邊數過來第四格表示 Positive(+) or Negative(-)
4. 把第二個Octets的bit3去掉,轉回原來的十六進位後前後轉置 (Reverse Way)
5. 把轉置完後的數字除以四,再配合step3的+-得出時區


Ex1:
1. 105(DEC) = 0x69(HEX)
2. 0110 1001
3. bit3 = 1, so it means Negative.
4. 0110 001 -> 61 -> 16
5. 16/4 = 4, so the Time Zone is -4.

Ex2:
1. 99(DEC) = 0x63(HEX)
2. 0110 0011
3. bit3 = 0, so it means Positive.
4. 0110 011 -> 63 -> 36
5. 36/4 = 9, so the Time Zone is +9.



P.S.
MM information 通常會在 LAU 的時候由網路送到手機上




Wiki
http://en.wikipedia.org/wiki/NITZ

Reference :
http://winnielee0204.blogspot.com/2008/06/korea-2008_09.html#TZ
3GPP 23040

0 意見:

canvas