ACTION!="add|change", GOTO="paparazzi_rules_end"

# your own XBee ground modem with FTDI USB adapter (adapt serial number and uncomment line below)
#SUBSYSTEM=="tty", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A80081ej", SYMLINK+="paparazzi/xbee", GROUP="plugdev", GOTO="tty_FTDI232_end"

# other bare FT232R FTDI chip without EEPROM
SUBSYSTEM=="tty", ATTRS{product}=="FT232R USB UART", SYMLINK+="paparazzi/serial", GROUP="plugdev"

# MaxStream xbee pro box
SUBSYSTEM=="tty", ATTRS{product}=="MaxStream PKG-U", SYMLINK+="paparazzi/xbee", GROUP="plugdev"

# Navstik Xbee port
SUBSYSTEMS=="usb", ENV{.LOCAL_ifNum}="$attr{bInterfaceNumber}"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{product}=="Quad RS232-HS", ENV{.LOCAL_ifNum}=="02", SYMLINK+="paparazzi/xbee", GROUP="plugdev"

# Recent Digi XBee pro modems (XBP24-PKC-001-UA)
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{product}=="USB <-> Serial", SYMLINK+="paparazzi/xbee", GROUP="plugdev"

LABEL="tty_FTDI232_end"

SUBSYSTEM!="usb", GOTO="paparazzi_rules_end"
ENV{DEVTYPE}!="usb_device", GOTO="paparazzi_rules_end"

ATTR{product}=="Lisa/M (Upgrade)*", GROUP="plugdev"

#SUBSYSTEMS=="usb", ATTRS{serial}=="*_fbw", NAME="test_fbw", SYMLINK+="paparazzi/%s{serial}", MODE="0666"

# FTDI 2232 parallel converter / Amontec JTAG-Tiny (access through libftdi)
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", GROUP="plugdev"

# FTDI 2232 based jtag for Lisa/L and usb upload
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0666", GROUP="plugdev"

# FTDI 2232 based jtag for Navstik
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="0666", GROUP="plugdev"

# dfu devices
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0666", GROUP="plugdev"

# all (fake VID 0x7070) LPCUSB devices (access through libusb)
ATTRS{idVendor}=="7070", GROUP="plugdev"

# make joysticks/gamepads readable on event interface (writeable for force feedback), see input_event.sh
KERNEL=="event*", IMPORT{program}="input_event.sh %p", NAME="input/%k", GROUP="plugdev", MODE="0640" ENV{FF_DEVICE}=="1", MODE="0660"

# FTDI with uBlox direct on USB
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a5", KERNEL=="ttyACM*", SYMLINK+="paparazzi/acm", GROUP="plugdev"

LABEL="paparazzi_rules_end"
