Discussion:
[BitPim-devel] PM-8200
Dustin Marquess
2006-04-11 03:51:09 UTC
Permalink
All,

I tried figured this out myself, but I can't seem to nail it down.
I'm trying to add code to pull the current network time (either GSM or
UTC) from the phone. The phone I'm testing with right now is a
PM-8200. I'm pretty sure this is something that's easy to do, I'm
just not sure how. I looked at the various p_sanyo*.p files, and
p_brew.p, since I have a feeling it's BREW related.

Can anybody point me in the right direction?

Thanks!
-Dustin
Simon C
2006-04-13 06:12:37 UTC
Permalink
Post by Dustin Marquess
I tried figured this out myself, but I can't seem to nail it down.
I'm trying to add code to pull the current network time (either GSM or
UTC) from the phone. The phone I'm testing with right now is
a PM-8200. I'm pretty sure this is something that's easy to
do, I'm just not sure how. I looked at the various
p_sanyo*.p files, and p_brew.p, since I have a feeling it's
BREW related.
This brew command returns an incrementing counter on the verizon vx8100.
Maybe it is related to network time.

PACKET req_29:
1 UINT { 'default': 29, 'constant': 29 } +command

PACKET resp_29:
1 UINT { 'constant': 29 } command
4 UINT int1
4 UINT int2


Simon
Dustin Marquess
2006-04-14 06:59:13 UTC
Permalink
Yep! In fact, if I walk all of the commands that I can find, that's
the only one that seems to consistently change.

The only problem is try as I might, I just can't get the numbers to
jive w/ anything :(

-Dustin
Post by Simon C
Post by Dustin Marquess
I tried figured this out myself, but I can't seem to nail it down.
I'm trying to add code to pull the current network time (either GSM or
UTC) from the phone. The phone I'm testing with right now is
a PM-8200. I'm pretty sure this is something that's easy to
do, I'm just not sure how. I looked at the various
p_sanyo*.p files, and p_brew.p, since I have a feeling it's
BREW related.
This brew command returns an incrementing counter on the verizon vx8100.
Maybe it is related to network time.
1 UINT { 'default': 29, 'constant': 29 } +command
1 UINT { 'constant': 29 } command
4 UINT int1
4 UINT int2
Simon
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Stephen Wood
2006-04-14 12:46:45 UTC
Permalink
Can you post some examples (from the protocol log) of what you get in
response to 29?

Thanks, Stephen
Simon C
2006-04-14 14:51:32 UTC
Permalink
Post by Stephen Wood
Can you post some examples (from the protocol log) of what
you get in response to 29?
Try to get them a fixed time apart, say 1 second, 10 seconds, 1 minute, 10
minutes. (include the timestamp) Does it change by the same amount over a
fixed time interval?

Simon
Dustin Marquess
2006-04-15 00:16:31 UTC
Permalink
Okay. I wrote a small app to do the test, since I couldn't figure out
an easy way to script BitPim to do it. The timestamps should be UTC
time. My laptop is synched against my local stratum 3 NTP server, so
it should be somewhat correct. The timestamp is grabbed and printed
right after the request to the phone and right before the response is
read, as I figured that should be the closest.

It's printing out the 8 bytes after the first byte in the response
packet, and before the final 3 bytes (the CRC & terminator).

Let me know if I need to do anything else. I appreciate your help!

-Dustin

============
= 1 second =
============
Got [2006-04-14 22:22:11.395]: CC CC C4 C9 05 6E 9A 00
Got [2006-04-14 22:22:12.442]: 66 66 FE CC 05 6E 9A 00
Got [2006-04-14 22:22:13.473]: C0 6B 3D D0 05 6E 9A 00
Got [2006-04-14 22:22:14.505]: 66 66 72 D3 05 6E 9A 00
Got [2006-04-14 22:22:15.536]: 00 00 AC D6 05 6E 9A 00
Got [2006-04-14 22:22:16.567]: 99 99 E5 D9 05 6E 9A 00
Got [2006-04-14 22:22:17.598]: 66 66 1E DD 05 6E 9A 00
Got [2006-04-14 22:22:18.630]: C0 43 58 E0 05 6E 9A 00
Got [2006-04-14 22:22:19.661]: 33 33 8F E3 05 6E 9A 00
Got [2006-04-14 22:22:20.692]: CC CC CC E6 05 6E 9A 00

==============
= 10 seconds =
==============
Got [2006-04-14 22:23:20.426]: 66 66 82 A1 06 6E 9A 00
Got [2006-04-14 22:23:30.458]: 99 99 D1 C0 06 6E 9A 00
Got [2006-04-14 22:23:40.489]: 66 66 2A E0 06 6E 9A 00
Got [2006-04-14 22:23:50.520]: 66 66 82 FF 06 6E 9A 00
Got [2006-04-14 22:24:00.551]: 99 99 DD 1E 07 6E 9A 00
Got [2006-04-14 22:24:10.583]: 66 66 36 3E 07 6E 9A 00
Got [2006-04-14 22:24:20.614]: CC CC 9C 5D 07 6E 9A 00
Got [2006-04-14 22:24:30.645]: 99 99 F1 7C 07 6E 9A 00
Got [2006-04-14 22:24:40.676]: 99 99 49 9C 07 6E 9A 00
Got [2006-04-14 22:24:50.708]: CC CC A4 BB 07 6E 9A 00

============
= 1 minute =
============
Got [2006-04-14 22:26:16.051]: 99 99 61 C6 08 6E 9A 00
Got [2006-04-14 22:27:16.083]: 99 99 F9 81 09 6E 9A 00
Got [2006-04-14 22:28:16.114]: 00 00 8C 3D 0A 6E 9A 00
Got [2006-04-14 22:29:16.161]: CC CC 38 F9 0A 6E 9A 00
Got [2006-04-14 22:30:16.192]: 66 66 D2 B4 0B 6E 9A 00
Got [2006-04-14 22:31:16.223]: 00 7B 6D 70 0C 6E 9A 00
Got [2006-04-14 22:32:16.255]: 33 33 0B 2C 0D 6E 9A 00
Got [2006-04-14 22:33:16.286]: 00 00 A8 E7 0D 6E 9A 00
Got [2006-04-14 22:34:16.317]: 66 66 3A A3 0E 6E 9A 00
Got [2006-04-14 22:35:16.348]: CC CC D4 5E 0F 6E 9A 00

==============
= 10 minutes =
==============
Got [2006-04-14 22:38:54.067]: 00 00 4C 07 12 6E 9A 00
Got [2006-04-14 22:48:54.114]: 33 33 73 5A 19 6E 9A 00
Got [2006-04-14 22:58:54.145]: 66 66 A6 AD 20 6E 9A 00
Got [2006-04-14 23:08:54.161]: C0 21 D4 00 28 6E 9A 00
Got [2006-04-14 23:18:54.192]: CC CC F8 53 2F 6E 9A 00
Got [2006-04-14 23:28:54.223]: 99 99 21 A7 36 6E 9A 00
Got [2006-04-14 23:38:54.255]: 66 66 46 FA 3D 6E 9A 00
Got [2006-04-14 23:48:54.286]: 00 00 78 4D 45 6E 9A 00
Got [2006-04-14 23:58:54.317]: 66 66 A2 A0 4C 6E 9A 00
Got [2006-04-15 00:08:54.348]: 33 33 C7 F3 53 6E 9A 00
Post by Simon C
Post by Stephen Wood
Can you post some examples (from the protocol log) of what
you get in response to 29?
Try to get them a fixed time apart, say 1 second, 10 seconds, 1 minute, 10
minutes. (include the timestamp) Does it change by the same amount over a
fixed time interval?
Simon
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Stephen Wood
2006-04-15 01:05:36 UTC
Permalink
Post by Dustin Marquess
...
Got [2006-04-14 22:22:11.395]: CC CC C4 C9 05 6E 9A 00
I looks like a little endian 8 byte number:

009A6E05C9C4CCCC -> 43468117552450764

The counter increments every 19.073 ns, a frequency of 52.43 MhZ. Does that
frequency mean anything to anyone?

I didn't calculate it exactly, but the counter started counting in the first
few days of 1980. Perhaps it is the same date, Jan 6, 1980, that the second
counter used in many phones calendars starts.

What time zone are you in? I'll see if I can connect your numbers to
numbers on my Sanyo or other phones.

Stephen
Dustin Marquess
2006-04-15 01:29:22 UTC
Permalink
I'm in Texas, so currently CDT.

This started out as an idea to add a time sync option to BitPim
(similar to the new 'TimeSync' app on the PPC-6700 to since the WinCE
time to the network).

I'll see what I can figure out. Thanks again!

-Dustin
Post by Dustin Marquess
...
Got [2006-04-14 22:22:11.395]: CC CC C4 C9 05 6E 9A 00
009A6E05C9C4CCCC -> 43468117552450764
The counter increments every 19.073 ns, a frequency of 52.43 MhZ. Does that
frequency mean anything to anyone?
I didn't calculate it exactly, but the counter started counting in the first
few days of 1980. Perhaps it is the same date, Jan 6, 1980, that the second
counter used in many phones calendars starts.
What time zone are you in? I'll see if I can connect your numbers to
numbers on my Sanyo or other phones.
Stephen
Simon C
2006-04-15 01:30:33 UTC
Permalink
Post by Dustin Marquess
...
Got [2006-04-14 22:22:11.395]: CC CC C4 C9 05 6E 9A 00
009A6E05C9C4CCCC -> 43468117552450764
The counter increments every 19.073 ns, a frequency of 52.43
MhZ. Does that frequency mean anything to anyone?
I didn't calculate it exactly, but the counter started
counting in the first few days of 1980. Perhaps it is the
same date, Jan 6, 1980, that the second counter used in many
phones calendars starts.
It could be GSM time, which I think is the cellphone network clock, the
number may be the raw timestamp from the network.

Simon
Dustin Marquess
2006-04-15 05:40:28 UTC
Permalink
I think I have it working..

Took the long number, divided it by 52428800.0 (if I rig the program
to request every second exactly, it hits that # the most). If I take
the result and add 315964784 and then my GMT offset (currently 18000
seconds), I get a number that matches the UTC value my machine
currently has.

The 315964784 number confuses me, since if I'm doing the math right,
it should be 315964814.

315964800 to conver the GPS->Unix epoch differences, and 14 to cover
the leap second offset. Maybe Sprint is off 30 seconds? If I can
find a way to force the phone to lock onto Verizon, I'll see if it
changes.

-Dustin
Post by Simon C
Post by Dustin Marquess
...
Got [2006-04-14 22:22:11.395]: CC CC C4 C9 05 6E 9A 00
009A6E05C9C4CCCC -> 43468117552450764
The counter increments every 19.073 ns, a frequency of 52.43
MhZ. Does that frequency mean anything to anyone?
I didn't calculate it exactly, but the counter started
counting in the first few days of 1980. Perhaps it is the
same date, Jan 6, 1980, that the second counter used in many
phones calendars starts.
It could be GSM time, which I think is the cellphone network clock, the
number may be the raw timestamp from the network.
Simon
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Simon C
2006-04-15 06:12:16 UTC
Permalink
Post by Dustin Marquess
I think I have it working..
Took the long number, divided it by 52428800.0 (if I rig the
program to request every second exactly, it hits that # the
most). If I take the result and add 315964784 and then my
GMT offset (currently 18000 seconds), I get a number that
matches the UTC value my machine currently has.
The 315964784 number confuses me, since if I'm doing the math
right, it should be 315964814.
315964800 to conver the GPS->Unix epoch differences, and 14
to cover the leap second offset. Maybe Sprint is off 30
seconds? If I can find a way to force the phone to lock onto
Verizon, I'll see if it changes.
If you have code I can try it on verizon.

What do you see if you compare your PC time with your cell phone time are
they in sync?

This site http://wiki.tcl.tk/552 contains some interesting code about the
conversion.
It suggests that there are a few more leap seconds and shows how to query
new leap seconds dynamically.


Simon
Simon C
2006-04-15 06:15:51 UTC
Permalink
Post by Dustin Marquess
This started out as an idea to add a time sync option to
BitPim (similar to the new 'TimeSync' app on the PPC-6700 to
since the WinCE time to the network).
This would be a nice feature to add I think.
Could be programmed to run periodically, a checkbox on the calendar autosync
to sync the PC time as well as the calendar.

Simon
Roger Binns
2006-04-15 07:53:33 UTC
Permalink
Post by Simon C
to sync the PC time
That requires priviledged operation on Windows, Linux and Mac.
Also all three operating systems default to doing time
synchronization (NTP) anyway.

Roger

Loading...