Discussion:
[Bitpim-devel] Samsung Phone USB ids
Stephen Wood
2004-10-27 11:18:36 UTC
Permalink
Could the Samsung owners (A310, A650, A670) check what the USB ids for
your phones are? The A620 is 0x04e8, 0x6601. It is possible that this
same id is used for some or all Samsung phones.

I put the USB id in com_samsung. It will need to be put in the phone
specific Profile class of any phones that use a different ID.

Stephen
Vic Heintz
2004-10-27 12:09:33 UTC
Permalink
Post by Stephen Wood
Could the Samsung owners (A310, A650, A670) check what the USB ids for
your phones are? The A620 is 0x04e8, 0x6601. It is possible that this
same id is used for some or all Samsung phones.
I put the USB id in com_samsung. It will need to be put in the phone
specific Profile class of any phones that use a different ID.
Happy to. Exactly how do I check?

Vic
Stephen Wood
2004-10-27 12:47:03 UTC
Permalink
I believe that BitPim can give the information in the port browser.

Click Browse next to Com Port in the settings dialog. If your phone has
the same ID as mine (most likely the case), then you will probably see a
line that says

USB Device - Vendor Samsung Electronics Co., Ltd Product Z100 Mobile
Phone (Interface ????)

If you see that, all I need is the interface number. If you don't see
that line, then click the "save" button and send me the file that it
writes.

Stephen
Post by Vic Heintz
Post by Stephen Wood
Could the Samsung owners (A310, A650, A670) check what the USB ids for
your phones are? The A620 is 0x04e8, 0x6601. It is possible that this
same id is used for some or all Samsung phones.
...
Post by Vic Heintz
Happy to. Exactly how do I check?
Vic Heintz
2004-10-27 13:32:25 UTC
Permalink
Post by Stephen Wood
Click Browse next to Com Port in the settings dialog. If your phone
has
the same ID as mine (most likely the case), then you will probably see
a
line that says
USB Device - Vendor Samsung Electronics Co., Ltd Product Z100 Mobile
Phone (Interface ????)
I seem to recall seeing something like that using earlier versions of
bitpim but now all I see is
"(*) Modem (/dev/cu.usbmodem )"

(Mac OS strangely names this port with an unprintable \r char as part
of the name. An "ls /dev" produces "/dev/cu.usbmodem?". I am perhaps
the only Mac user with a Samsung phone on this list but I was curious
if anyone else has seen this.)

Vic
Vic Heintz
2004-10-27 15:06:49 UTC
Permalink
Post by Stephen Wood
USB Device - Vendor Samsung Electronics Co., Ltd Product Z100 Mobile
Phone (Interface ????)
I fired up Bitpim 0.7.13 and I see exactly what you have indicated
where in my case
???? = #01

Vic
Vic Heintz
2004-10-27 14:19:25 UTC
Permalink
When I first borrowed Joe's A650 code, it was working with my A670.
After using bitpim to import some phonebook entries from a vCard file
and send them to my phone, I have run into problems. At issue is this
routine:
def _get_phone_num_count(self):

s=self._send_at_cmd("#PCBIT?")
if s==self.__OK_str or s==self.__Error_str:
return 0
c=atoi(split(split(split(s, ": ")[1], "\r\n")[0], ",")[7])-30
if c>len(self.__phone_entries_range):
# count out of whack
c=0
return c

Somehow the 7th (or is it 8th?) field of what is returned from the AT
command is used for the count. There is an unexplained subtraction of
30 from this number. For a while this worked. Suddenly this number
jumped to 97 for me and I only have 40 pb entries. I edited the code to
change the 30 to 57 and things work again. For now.

I personally have no clue what the output from PCBIT means but I have
confirmed that this particular field is indeed incremented when a new
pb entry is made. I am extremely nervous though that this is an
unreliable number if there is an unexplained offset that suddenly jumps
from 30 to 57.

Can't we simply start at 1 and count the successful returns from
AT#PBOKR until we hit an empty string? Or will that be slow? Is there a
scheme where we don't need the count in advance?

Vic
Stephen Wood
2004-10-27 15:53:27 UTC
Permalink
When I save an entry on my phone, the phone displays a number of entries
that is much greater than the number of names in the phonebook. I
believe that it is showing the number of phone numbers in the phone, not
the number of names. Perhaps this is the same with PCBIT and 30 just
happens to be the difference between the number of numbers and names in
Joes phone.

It looks like the entry count is used to stop reading when all the
entries have been found to avoid sending PBOKR to a lot of blank slots
when only a few are used. Probably we just need to read through all
valid slots instead looking for which have entries.

Stephen
Post by Vic Heintz
There is an unexplained subtraction of
30 from this number.
Vic Heintz
2004-10-27 15:56:13 UTC
Permalink
Post by Vic Heintz
I personally have no clue what the output from PCBIT means but I have
confirmed that this particular field is indeed incremented when a new
pb entry is made. I am extremely nervous though that this is an
unreliable number if there is an unexplained offset that suddenly
jumps from 30 to 57.
Now I'm confused and I don't want to mislead people by my last note. I
just looked back and found this in examples/samsungnotes.txt:

AT#PCBIT?
#PCBIT: 1005,1,0,8,5,500,500,75,1,13,48,22,32,0

Note the 75 in the 8th field. I ran this test before ever trying Joe's
stuff and I know I never had 45 phone entries, so I am puzzled as to
how Joe's code could have ever worked with its subtraction of 30. On
the other hand I can't believe I only had 18 entries at that time in
which case 57 would not be the proper offset for me. This only adds to
my mistrust of this number as anything meaningful. Does anyone have a
documented explanation of what PCBIT is returning here? Or is this all
just guesswork?

Vic
d***@netzero.com
2004-10-27 17:06:17 UTC
Permalink
It was all guesswork from my part. For Samsung phones, each number, alias, and email entry takes a memory slot out MAX available slots (500 for the A650). So if you have a phonebook entry with 5 numbers, an alias, and an email, that'd take up 7 slots. For the A650, there seems to be 30 slots pre-reserved for things like calendar, alarms, etc. If this does not seem portable, I can try reading through all the entries and see how much slower it gets.

Thanks Stephen for pointing out the parsing oversight. I still haven't figured out how to send back an escape " or escape {. Unless someone figures out how to do that, I guess that's a limitation for now.

I'll post some updates to fix those issues.

Thanks,

-Joe Pham
Post by Vic Heintz
I personally have no clue what the output from PCBIT means but I have
confirmed that this particular field is indeed incremented when a new
pb entry is made. I am extremely nervous though that this is an
unreliable number if there is an unexplained offset that suddenly
jumps from 30 to 57.
Now I'm confused and I don't want to mislead people by my last note. I
just looked back and found this in examples/samsungnotes.txt:

AT#PCBIT?
#PCBIT: 1005,1,0,8,5,500,500,75,1,13,48,22,32,0

Note the 75 in the 8th field. I ran this test before ever trying Joe's
stuff and I know I never had 45 phone entries, so I am puzzled as to
how Joe's code could have ever worked with its subtraction of 30. On
the other hand I can't believe I only had 18 entries at that time in
which case 57 would not be the proper offset for me. This only adds to
my mistrust of this number as anything meaningful. Does anyone have a
documented explanation of what PCBIT is returning here? Or is this all
just guesswork?

Vic



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Bitpim-devel mailing list
Bitpim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel


________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up today!
Vic Heintz
2004-10-27 18:13:15 UTC
Permalink
Post by Stephen Wood
When I save an entry on my phone, the phone displays a number of
entries
that is much greater than the number of names in the phonebook. I
believe that it is showing the number of phone numbers in the phone,
not
the number of names. Perhaps this is the same with PCBIT and 30 just
happens to be the difference between the number of numbers and names in
Joes phone.
You are right. Mine shows me Dial# 073/500 or something like that and I
only have 40 entries. The number is the total of all phone numbers,
email addresses and aliases.
Post by Stephen Wood
t was all guesswork from my part. For Samsung phones, each number,
alias, and email entry takes a memory slot out MAX available slots
(500 for the A650). So if you have a phonebook entry with 5 numbers,
an alias, and an email, that'd take up 7 slots. For the A650, there
seems to be 30 slots pre-reserved for things like calendar, alarms,
etc.
Now I would agree that the number returned in that field by PCBIT is
indeed 30 greater than the sum of these entries.

Here's an additional piece of info. The filesystem on my a670 has a
file /nvm/nvm/dial. I had earlier played around with a Perl script to
parse that file and so can readily read it. I just checked. The number
of entries in that file is the same as the number reported by the phone
when saving which as I said is 30 less than the number PCBIT returns.

Not only that: the records in that file are 56 bytes long and the file
is 29904 bytes in size or big enough for 534 records. The first record
is null. The 502-504th records are three variations of 911. Curiously
that leaves room for 500 user records occupying slots 1-501 and the
magic number 30 records at the end. I don't think this is a coincidence.

Vic
d***@netzero.com
2004-10-27 19:06:06 UTC
Permalink
As another data point, my A310 phone does not have the extra 30 slots as the A650. In any case, should we go by what PCBIT tells us, or by reading all 500 slots. On my A650, with about 40 entries (50 slots), using PCBIT took about 5-10 seconds to read, reading entry-by-entry took about a minute. Any suggestions?
Post by Stephen Wood
When I save an entry on my phone, the phone displays a number of
entries
that is much greater than the number of names in the phonebook. I
believe that it is showing the number of phone numbers in the phone,
not
the number of names. Perhaps this is the same with PCBIT and 30 just
happens to be the difference between the number of numbers and names in
Joes phone.
You are right. Mine shows me Dial# 073/500 or something like that and I
only have 40 entries. The number is the total of all phone numbers,
email addresses and aliases.
Post by Stephen Wood
t was all guesswork from my part. For Samsung phones, each number,
alias, and email entry takes a memory slot out MAX available slots
(500 for the A650). So if you have a phonebook entry with 5 numbers,
an alias, and an email, that'd take up 7 slots. For the A650, there
seems to be 30 slots pre-reserved for things like calendar, alarms,
etc.
Now I would agree that the number returned in that field by PCBIT is
indeed 30 greater than the sum of these entries.

Here's an additional piece of info. The filesystem on my a670 has a
file /nvm/nvm/dial. I had earlier played around with a Perl script to
parse that file and so can readily read it. I just checked. The number
of entries in that file is the same as the number reported by the phone
when saving which as I said is 30 less than the number PCBIT returns.

Not only that: the records in that file are 56 bytes long and the file
is 29904 bytes in size or big enough for 534 records. The first record
is null. The 502-504th records are three variations of 911. Curiously
that leaves room for 500 user records occupying slots 1-501 and the
magic number 30 records at the end. I don't think this is a coincidence.

Vic



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Bitpim-devel mailing list
Bitpim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel


________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up today!
Stephen Wood
2004-10-27 19:36:21 UTC
Permalink
Post by d***@netzero.com
As another data point, my A310 phone does not have the extra 30 slots
as the A650. In any case, should we go by what PCBIT tells us, or by
reading all 500 slots. On my A650, with about 40 entries (50 slots),
using PCBIT took about 5-10 seconds to read, reading entry-by-entry
took about a minute. Any suggestions?
I would think all slots should be queried. That gives us code that can
more easily be shared among phones and code that is more robust (in case
the phones internal counters get messed up.)

Stephen

Loading...