Discussion:
[Bitpim-devel] Changing device name under Linux
Stephen Wood
2003-12-14 01:19:32 UTC
Permalink
Under linux, my Sanyo phone uses the ACM driver, so I talk to it with
the device /dev/input/ttyACM0. When I update (overwrite really) the
phonebook, thet last thing that happens is that the phone is told to
reboot. When the phone reboots, linux, assigns the phone to
/dev/input/ttyACM1. I think this is because BitPim may still have the
device open at the time that the phone comes on again, so linux assigns
it the next free device name.

If I put "save.close()" as the last line of my savephone method, then
the phone gets assign ttyACM0 when it reboots. (Or maybe I was lucky).
Is it OK to do this close at this point?

Steve
Roger Binns
2003-12-14 03:47:37 UTC
Permalink
Post by Stephen Wood
If I put "save.close()" as the last line of my savephone method, then
the phone gets assign ttyACM0 when it reboots. (Or maybe I was lucky).
Is it OK to do this close at this point?
I don't think it will work, as the rest of the code won't attempt
to reopen a closed port.

To get the desired effect you should really be calling
WorkerThread.clearcomm.

I think the best way of dealing with this inspired by http. In
the dictionary you return, the following two keys can be added:

'connection': value can be 'close' and WorkerThread will
close it for you
'reboot': value can be True or False. If True, then the
phone will be rebooted. In the future this
could be controlled by the gui (ie auto-reboot
when needed, or let the user do it)

If that sounds ok, I will implement it at some point.

Roger
Stephen Wood
2003-12-14 04:29:08 UTC
Permalink
Adding dictionary words to request a reboot and connection close sounds
like a good idea. Maybe a reboot should close the connection by
default. Unless it is an old phone using a real serial interface, the
device is going to go away anyway. (I might try taking on adding
support for a Samsung SCH-3500, an old phone that I have a serial cable
for.)

Steve
Roger Binns
2003-12-14 04:35:02 UTC
Permalink
Post by Stephen Wood
Maybe a reboot should close the connection by
default.
That would make sense.

The other thing that closing the connection causes is
reiteration of interfaces if the 'auto' port has been chosen.

Roger

Loading...