Просмотр сообщений
|
Страниц: [1]
|
1
|
Qt / Вопросы новичков / Re: QT + libusb
|
: Ноябрь 22, 2022, 12:56
|
Проблема решена. Решение: SUBSYSTEM=="hidraw", KERNEL=="hidraw*", MODE="0666" Дает доступ ко всем usb Первые 2 параметра взяты из рядомлежащего .rules
|
|
|
4
|
Qt / Вопросы новичков / QT + libusb
|
: Ноябрь 22, 2022, 10:05
|
Доброго времени. Необходимо связать Qt(Linux) и устройство на stm32. При попытке открыть, возвращается handle 0. Пытался настроить rules:
В /etc/udev/rules.d добавил 99-stm.rules (остальные имена начинаются с 70) с текстом SUBSYSTEM=="usb", MODE="0666" То есть всем устройствам хочу дать доступ RW
>lsusb
>Bus 002 Device 003: ID 174c:3074 ASMedia Technology Inc. ASM1074 SuperSpeed hub Bus 002 Device 002: ID 2001:4a00 D-Link Corp. DUB-1312 Gigabit Ethernet Adapter Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 011: ID 0483:57ff STMicroelectronics STM32 PPM-USB Adapter Bus 001 Device 005: ID 046e:5505 Behavior Tech. Computer Corp. USB Multimedia Keyboard Bus 001 Device 004: ID 046d:c040 Logitech, Inc. Corded Tilt-Wheel Mouse Bus 001 Device 002: ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed hub Bus 001 Device 006: ID 26ce:01a2 ASRock LED Controller Bus 001 Device 007: ID 0cf3:9271 Qualcomm Atheros Communications AR9271 802.11n Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
>udevadm info -a -n /dev/bus/usb/001/011
> looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-9': KERNEL=="1-9" SUBSYSTEM=="usb" DRIVER=="usb" ATTR{authorized}=="1" ATTR{avoid_reset_quirk}=="0" ATTR{bConfigurationValue}=="1" ATTR{bDeviceClass}=="00" ATTR{bDeviceProtocol}=="00" ATTR{bDeviceSubClass}=="00" ATTR{bMaxPacketSize0}=="64" ATTR{bMaxPower}=="100mA" ATTR{bNumConfigurations}=="1" ATTR{bNumInterfaces}==" 1" ATTR{bcdDevice}=="0200" ATTR{bmAttributes}=="e0" ATTR{busnum}=="1" ATTR{configuration}=="" ATTR{devnum}=="11" ATTR{devpath}=="9" ATTR{idProduct}=="57ff" ATTR{idVendor}=="0483" ATTR{ltm_capable}=="no" ATTR{manufacturer}=="STMicroelectronics" ATTR{maxchild}=="0" ATTR{power/active_duration}=="3109580" ATTR{power/async}=="enabled" ATTR{power/autosuspend}=="2" ATTR{power/autosuspend_delay_ms}=="2000" ATTR{power/connected_duration}=="3109580" ATTR{power/control}=="on" ATTR{power/level}=="on" ATTR{power/persist}=="1" ATTR{power/runtime_active_kids}=="0" ATTR{power/runtime_active_time}=="3109304" ATTR{power/runtime_enabled}=="forbidden" ATTR{power/runtime_status}=="active" ATTR{power/runtime_suspended_time}=="0" ATTR{power/runtime_usage}=="1" ATTR{power/wakeup}=="disabled" ATTR{power/wakeup_abort_count}=="" ATTR{power/wakeup_active}=="" ATTR{power/wakeup_active_count}=="" ATTR{power/wakeup_count}=="" ATTR{power/wakeup_expire_count}=="" ATTR{power/wakeup_last_time_ms}=="" ATTR{power/wakeup_max_time_ms}=="" ATTR{power/wakeup_total_time_ms}=="" ATTR{product}=="STM32 PPM-USB Adapter" ATTR{quirks}=="0x0" ATTR{removable}=="removable" ATTR{rx_lanes}=="1" ATTR{serial}=="00000000001A" ATTR{speed}=="12" ATTR{tx_lanes}=="1" ATTR{urbnum}=="29" ATTR{version}==" 2.00"
>ls -l /dev/hidraw*
>crw------- 1 root root 237, 0 ноя 22 2022 /dev/hidraw0 crw------- 1 root root 237, 1 ноя 22 2022 /dev/hidraw1 crw------- 1 root root 237, 2 ноя 22 2022 /dev/hidraw2 crw------- 1 root root 237, 3 ноя 22 2022 /dev/hidraw3 crw------- 1 root root 237, 4 ноя 22 09:09 /dev/hidraw4
Как добиться общего доступа для устройства? Спасибо Ubuntu22
|
|
|
|
|