Add u-blox 8 to udev rules. Use generic descriptions for ublox 6/7.

pull/418/head
AvSquirrel 2016-05-19 03:48:58 +00:00
rodzic aae8e925ef
commit 7940417f1c
2 zmienionych plików z 18 dodań i 6 usunięć

Wyświetl plik

@ -1,8 +1,18 @@
# To be placed in /etc/udev/rules.d.
# Auto-detect common USB stratux peripherals.
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="vk172"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK+="vk162"
# u-blox devices. Known devices include
# ublox8: RY835AI, RY836AI
# ublox7: VK-172, RY725AI
# ublox6: VK-162
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a8", SYMLINK+="ublox8"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="ublox7"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK+="ublox6"
#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="vk172"
#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK+="vk162"
# pl2303 devices are indistinguishable using idVendor and idProduct.
# Currently the BU-353-S4 and the TU-S9 (serialout) use the pl2303.

Wyświetl plik

@ -155,10 +155,12 @@ func initGPSSerial() bool {
baudrate := int(9600)
isSirfIV := bool(false)
if _, err := os.Stat("/dev/vk172"); err == nil { // u-blox 7.
device = "/dev/vk172"
} else if _, err := os.Stat("/dev/vk162"); err == nil { // u-blox 6.
device = "/dev/vk162"
if _, err := os.Stat("/dev/ublox8"); err == nil { // u-blox 8 (RY83xAI over USB).
device = "/dev/ublox8"
} else if _, err := os.Stat("/dev/ublox7"); err == nil { // u-blox 7 (VK-172, RY725AI over USB).
device = "/dev/ublox7"
} else if _, err := os.Stat("/dev/ublox6"); err == nil { // u-blox 6 (VK-162).
device = "/dev/ublox6"
} else if _, err := os.Stat("/dev/prolific0"); err == nil { // Assume it's a BU-353-S4 SIRF IV.
//TODO: Check a "serialout" flag and/or deal with multiple prolific devices.
isSirfIV = true