adulogo.jpg (1752 bytes)LINUX SDK  

udev for ADU Devices 

 

 

udev monitors devices connected to a Linux computer and
manages entries in the /dev directory.

It sets permissions and device names in
a dynamic plug-and-play environment.

This page describes how to configure udev to ease the
usage of ADU devices.

(Easy-Use Home)

 

udev Rules

udev reads its configuration from files in the /etc/udev/rules.d directory.

The file 10-adu.rules contains the rules for ADU devices.
It normally resides in the /etc/udev/rules.d directory.

The sample 10-adu.rules file contains the following line:
(For readability the rules entry is shown on multiple lines.
Do not split up the line in the rules file. Each entry must be on one line.)

    BUS=="usb", KERNEL=="adutux[0-3]", SYSFS{manufacturer}=="www.ontrak.net",
    SYSFS{serial}=="B00099", SYMLINK="adutux4", MODE="0666"

The rules line consists of two types of values: conditional or assigned.

The conditional values are identified by double equal signs (==).
udev watches for devices that match the conditional values.

The assigned values are identified by a single equal sign (=).
When a device matching all the conditionals is detected then udev processes the assigned values.

In the example, udev is watching the usb bus for devices that:
- are connected to kernel names adutux0 through adutux3
- are manufactured by www.ontrak.net
- have a serial number of B00099

When a matching device is detected udev will create a
symbolic link, adutux4, and assign permissions 0666 to it.
Thus the ADU device with serial number B00099 can be accessed
via the name /dev/adutux4 regardless of the order of device
connection. This is necessary for systems using several ADU
devices. The /dev/adutux4 has global read-write permissions.

The example file contains a second line for an ADU device
with the serial number C00119. This ensures the second
ADU device is always accessible through the name /dev/adutux5
regardless of the order of device connection.
This also demonstrates that the udev rules file contains
one line per device .... do not split the values for a
device over two lines.
You can safely leave the line for the C00119 device in the
rules file, since you are unlikely to be plugging it into
your computer. (I have it here in my hands now.)

udev contains many other options, notably management of
group and owner. These are useful if you feel
uncomfortable with the global read-write permission of
the example.

Check the web for tutorials about udev.

The example assumes that 4 or fewer ADU devices are connected to the computer.