linux - c++ Inappropriate ioctl for device -
I'm usually using a USB device attached to / dev / ttyUSB0
ever -Whenever there is more USB device goes to / dev / ttyUSB1 or other
I have added a rule with /etc/udev/rules.d/myrule.rules with the following line:
SUBSYSTEM == "usb", ATTRS {idVendor} == "xxxx", ATTRS {idProduct} == "yyyy", MODE = "0666", SYMLINK = "MyUSB"
This works fine when I plug my USB device / dev / MyUSB file.
The problem is that when I try to access this file using my C ++ program this message: "Improper ioctl for the tool" if I use / dev / ttyUSB0 Everything that is available works well.
Do I have to modify my C ++ code to deal with SYMLINKS?
Thank you in advance,
Carls.
This seems to work, I have tested it using a flash drive < P> Add rule in /etc/udev/rules.d/myrule.rules Reload rules using sudo udevadm control --reload-rules
#include
Comments
Post a Comment