Discussion:
[Bitpim-devel] gui enhancements/getphoneinfo
Alan Gonzalez
2003-09-15 21:48:58 UTC
Permalink
I see in com_lgvx4400, there is a getphoneinfo. I'm not sure where this is
called. Since this is my first foray into phone programming, I'm not sure of
all the details on what is proprietary to a phone.

Are we going to have a menu item for each supported phone? So if i create a
com_lgvx10.py, how will i import that? Or building on my above statement, is
there a way to get the phone type from a query like getphoneinfo?

Oh, BTW, I have wxwindows experience and i wrote a rather large C++ EDA CAD
program in it. So that part isn't all that unfamiliar with me. I haven't
written a lick of python, but i think i can pick it up.

Alan Gonzalez

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Todd
2003-09-15 22:11:52 UTC
Permalink
Post by Alan Gonzalez
Oh, BTW, I have wxwindows experience and i wrote a rather large C++ EDA CAD
program in it. So that part isn't all that unfamiliar with me. I haven't
written a lick of python, but i think i can pick it up.
Yeah, I meant ot ask about this. Any pointers on python development?
How do you do it, Roger? Are you using something like IDLE, or
just prints, or what?

When I had all those crashes and auto-detect problems, I grabbed
the CVS tree and installed all the necessary Python packages,
and was running things from the IDLE debugger(I forget which one,
there are 2 that come with 2.3, I think. One seemed to work better
than the other) But I couldn't ever get the thing to break on
the code I wanted to. I could set breaks in some spots, but not
others. Seemed to me it was an issue with the debugger and threads.

BTW, I tried bitpim on a different computer, and things were much
more stable, so I guess it was the computer. Maybe have something to
do with it being a dual CPU machine is my best guess.
Roger Binns
2003-09-15 22:47:06 UTC
Permalink
Post by Todd
Yeah, I meant ot ask about this. Any pointers on python development?
How do you do it, Roger? Are you using something like IDLE, or
just prints, or what?
I actually use xemacs to edit the code, and the occassional print
statement for debugging. If things look really bad then I do
fire up PythonWin and use the debugger in that.
Post by Todd
others. Seemed to me it was an issue with the debugger and threads.
Python isn't as wildly threaded as other languages. The interpretter
itself has a single lock - GIL (aka Global Interpretter Lock). BitPim
uses two threads. One does the gui, and one does the com port.
Post by Todd
BTW, I tried bitpim on a different computer, and things were much
more stable, so I guess it was the computer. Maybe have something to
do with it being a dual CPU machine is my best guess.
It could also be that the drivers for the cable were not SMP safe.
It certainly isn't a fundamental issue with Python as it is used
on all sorts of platforms with random numbers of CPUs, and the GIL
makes it almost impossible to have the normal sort of race conditions
and other wierdities you get with finely threaded code.

Roger

Roger Binns
2003-09-15 22:42:48 UTC
Permalink
Post by Alan Gonzalez
I see in com_lgvx4400, there is a getphoneinfo. I'm not sure where this is
called.
It isn't anymore. Most phones let you send various AT style commands
to get information out of them.

The problem with the VX4400 is that you have to speak to the phone's modem
interface. If using the USB to serial cable, the phone has to be set into
RS232 mode. The moment you send any filesystem commands or reboot, it
changes to a 'closed' mode, or to USB.

If you use the straight USB cable, then the modem interface is actually
a seperate com port number than the serial "diagnostics" interface. Things
are difficult enough finding one com port, and I certainly don't want to try
and find two! You also can't do any of the filesystem stuff on the modem
interface

BitPim prior to 0.6 would make those modem commands if the user selected.
They are nice and reassurring, but had a low probability of working,
and the information is obtainable directly on the phone anyway.
Post by Alan Gonzalez
Since this is my first foray into phone programming, I'm not sure of
all the details on what is proprietary to a phone.
I have no idea either! There is zero documentation, and everything has to
be figured out by trial and error. It is however pretty trivial to
structure code to inherit similarities and implement differences. That
will happen as more people do work on other phone models.
Post by Alan Gonzalez
Are we going to have a menu item for each supported phone?
The user will be able to select their phone model. Behind the scenes that
will pick a class to do phone stuff, and also supply some sort of device
capabilities information (eg how many phone numbers per entry does it
store, can it do a calendar).
Post by Alan Gonzalez
So if i create a com_lgvx10.py, how will i import that?
The user will manually select the phone model, and an appropriate class
will be selected. The corresponding Python code will work out roughly as

import com_lgvx10 as ThePhoneClass
Post by Alan Gonzalez
Or building on my above statement, is
there a way to get the phone type from a query like getphoneinfo?
There is, but I don't want to automate it yet. I prefer to have a rock
solid "manual" version first, and then add smarts later that guesses
the right way.

BTW we can detect the model for the phones that have the filesystem support
as you can see their model information on initialization (it was already
in the protocol traces you sent).
Post by Alan Gonzalez
Oh, BTW, I have wxwindows experience and i wrote a rather large C++ EDA CAD
program in it. So that part isn't all that unfamiliar with me.
Pretty much the way I do it is by looking in the wxPython demo and being inspired
by the code, as well as the online wxWindows help reference. The major annoying
thing is that a fair amount of stuff is implemented in wxPython only and not part
of the wxWindows core. I wish they kept them tighter together. As examples,
see how wxPython shows two different calendar controls. The treelist widget
used for the filesystem view is also proprietary to wxPython.

The one thing I don't want to do is have native wxWindows code since BitPim runs
on Windows, Linux and Mac, and porting it to all three makes life so much
harder.
Post by Alan Gonzalez
I haven't written a lick of python, but i think i can pick it up.
Yep, it is a nice simple language. You should keep a chart of how often your
code works first time. Remarkably high!

Roger
Loading...