List of serial ports?

Forum rules

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo

Posted on
Tue Aug 30, 2011 8:30 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

List of serial ports?

Is there a way to get the indigo.serialPorts list from Python code? I'd like to "mix them in" with a dynamic list produced by my plugin.

If you just want to tell me where you get it from, I can get it from there, too. I just don't want the two to diverge on some hapless user's system.

(Actually, what I really want is a menu for "one of the built-in serial ports or one of those network ports here that I happen to know have serial ports behind them." But I gather we won't get that feature in Indigo 5, no?)

Cheers
-- perry

Posted on
Tue Aug 30, 2011 8:35 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: List of serial ports?

Yep, you can use indigo.server.getSerialPorts() like this:

Code: Select all
for posixPath, uiName in indigo.server.getSerialPorts(filter="indigo.ignoreBluetooth").iteritems():
   print(posixPath)
   print(uiName)

And yeah, adding them to a dynamic list control is the way to go for v5.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests