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_interface) creates a class named SerialInterface, 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 SerialInterface 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_interface import SerialInterface, find_serial_interface_ports
find_serial_interface_ports() # Returns list of available serial ports
dev = SerialInterface() # Might automatically find device if one available
# if it is not found automatically, specify port directly
dev = SerialInterface(port='/dev/ttyUSB0') # Linux
dev = SerialInterface(port='/dev/tty.usbmodem262471') # Mac OS X
dev = SerialInterface(port='COM3') # Windows
dev.get_device_info()
from serial_interface import SerialInterfaces
devs = SerialInterfaces()  # Might automatically find all available devices
# if they are not found automatically, specify ports to use
devs = SerialInterfaces(use_ports=['/dev/ttyUSB0','/dev/ttyUSB1']) # Linux
devs = SerialInterfaces(use_ports=['/dev/tty.usbmodem262471','/dev/tty.usbmodem262472']) # Mac OS X
devs = SerialInterfaces(use_ports=['COM3','COM4']) # Windows
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 Distribution

serial_interface-1.0.2.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file serial_interface-1.0.2.tar.gz.

File metadata

File hashes

Hashes for serial_interface-1.0.2.tar.gz
Algorithm Hash digest
SHA256 fd61945c6aec9caba74c58fdb5bb8ced13711ddc87e324a34558a82a9c11c429
MD5 bfeee3298a757e553d3dc24a7fb1b613
BLAKE2b-256 6492150ccc120c31b31ab7b041842469d5d28503b717d41206256a0ba2733a55

See more details on using hashes here.

Supported by

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