How do you access a serial port in Python for mobiles?

585 views Asked by At

The serial port must be over USB cable, from the phone to a computer.

In Java, I got it working by using the following code:

CommConnection comm = (CommConnection)Connector.open("comm:USB1");

// Now use comm to read and write data

How can I do this in Python for mobiles, specifically PyS60?

1

There are 1 answers

1
joaquin On BEST ANSWER

I got this from here:

    import pys60usb
    usb = pys60usb.USBConnection()

    # Connect to port 1. Works with most S60 3rd devices.
    usb.connect( port = 1, mode = pys60usb.ECommExclusive )