MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / device

Function device

src/ext/makerbot_pyserial/serialjava.py:41–49  ·  view source on GitHub ↗

Turn a port number into a device name

(portnumber)

Source from the content-addressed store, hash-verified

39
40
41def device(portnumber):
42 """Turn a port number into a device name"""
43 enum = comm.CommPortIdentifier.getPortIdentifiers()
44 ports = []
45 while enum.hasMoreElements():
46 el = enum.nextElement()
47 if el.getPortType() == comm.CommPortIdentifier.PORT_SERIAL:
48 ports.append(el)
49 return ports[portnumber].getName()
50
51
52class JavaSerial(SerialBase):

Callers 2

openMethod · 0.70
makeDeviceNameMethod · 0.70

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected