Package kenozooid :: Package driver :: Class DeviceDriver

Class DeviceDriver

source code

object --+
         |
        DeviceDriver

Device driver interface.

Every device driver implementation has to implement at least this interface.

Software using this interface shall get driver instance using DeviceDriver.scan method.

There is only one known method for platform independent device scanning and it applies to USB devices only. Library pyUSB can be used to find devices, i.e.:

import usb.core
dev = usb.core.find(idVendor=0x0403, idProduct=0x6001)
dev.write(...)
dev.read(...)

Above code uses not released yet pyUSB 1.0 interfaces. Device's write and `read' methods can be used to communicate with a device. It is not yet possible to determine port of a device (i.e. /dev/ttyUSB0, COM1, etc.), so it is not possible to bind this method with pySerial usage when required.

Instance Methods
 
version(self)
Get model and firmware version information about connected dive computer.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
 
scan(port=None)
Scan for connected devices and return device driver instances.
source code
Properties

Inherited from object: __class__

Method Details

scan(port=None)
Static Method

source code 

Scan for connected devices and return device driver instances.

Each connected dive computer should get one device driver instance.

If port is specified, then a driver instance should be returned, which connects to the port.