Re: Phone auto-detection
"Roger Binns" <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <009b01c54a20$7d23bc30$3501a8c0@rogersqyvr14d3> |
> - Use threading when available. The simplest way of doing this is to use two Queue.queue objects. On one of them, keep putting port "objects". Have some number of worker threads (eg 5) do blocking gets from that queue and then try the commands on the port. Use the second queue to place the results from the worker thread. To keep the UI updated, have the worker threads use wx.CallAfter to call a method in the UI thread which will count the result queue and give a percent complete as well as detect when all the results are in. > - Bail if first attempt to send AT command fails. Be somewhat careful with this. With the LG phones when talking over a serial connection you have to try at least 19200, 38400, 115200 and 230400 assuming they are even in modem mode. Or you can just stick to the rule of never sending modem commands to non-modem ports, and just defer to the logic I'll be writing which may work. > - You should also only grab the list of ports that at least > one phone module has in its auto-detection list. This should be fairly easy as the comdiagnose code already does the heavy lifting. I also think you should limit the ports passed to the detect phone method to those that the phone would claim. This helps ensure the interface detection code remains correct especially if people aren't using auto detect for whatever reason. Roger ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click