Code Monkey home page Code Monkey logo

serialenum's Introduction

serialenum

Introduction

Serialenum is a simple utility to correctly enumerate all available and present serial ports on a given system. There are a number of ways to enumerate serial ports, but they are platform-specific and vary in effectiveness. Serialenum attempts to provide the best possible methods for each supported platform.

Installation

pip install serialenum

Usage

import serialenum

serialenum.enumerate()

The enumerate method will return a list of serial ports or a blank list, if none are found. If serial ports could not be enumerated, it will return None.

Using command line script

Script called serialenum can be used from command line

serialenum

It prints out all found serial ports, one per line.

Supported Platforms

  1. Windows XP or later
  2. Recent Linux 2.6+ kernels

Windows

The Windows implementation iterates over a registry key to ensure that usb-to-serial converters and oddly-named COM ports are discovered. This should work correctly on any modern version of Windows.

Linux

The Linux implementation uses /dev/serial to enumerate attached serialenum port devices. This avoids the fake ttyS devices typically present and also accounts for usb-to-serial converters.

TODO

  • Add fallback support for older Linux systems
  • Add support for more operating systems (testing help needed)

serialenum's People

Contributors

djs avatar vlcinsky avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.