Skip to main content

Extends serial.Serial to add methods such as auto discovery of available serial ports in Linux, Windows, and Mac OS X

Project description

This Python package (serial_device2) creates a class named SerialDevice, which inherits from serial.Serial and adds methods to it, like auto discovery of available serial ports in Linux, Windows, and Mac OS X. The SerialDevice class can be used by itself, but it is mostly intended to be a base class for other serial port devices with higher level functions.

Authors:

Peter Polidoro <polidorop@janelia.hhmi.org>

License:

BSD

Example Usage:

from serial_device2 import SerialDevice, find_serial_device_ports
find_serial_device_ports() # Returns list of available serial ports
dev = SerialDevice()  # Automatically finds device if one available
dev.get_device_info()
dev = SerialDevice('/dev/ttyACM0') # Linux
dev = SerialDevice('/dev/tty.usbmodem262471') # Mac OS X
dev = SerialDevice('COM3') # Windows
devs = SerialDevices()  # Automatically finds all available devices
devs.get_devices_info()
devs.sort_by_port()
dev = devs[0]
dev.get_device_info()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

serial_device2-1.0.zip (11.7 kB view hashes)

Uploaded Source

serial_device2-1.0.tar.gz (7.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page