创建 udev 规则以从 USB 条形码扫描仪的符号链接获取数据 (ls2208)
我有这个UDEV规则,它创建了符号链接 subsystem ==“ usb”,action ==“ add”,attrs {product} ==“符号条形码扫描仪”,symlink+=“ scanner1”
> 但是,当我像cat/dev/scanner1
cat symlink时 我得到此
file: /dev /scanner1< binary> │尺寸:0 b
我希望像cat/dev/dev/input/mice
ps:预先感谢。
I have this udev rule which creates the symlinkSUBSYSTEM=="usb", ACTION=="add", ATTRS{product}=="Symbol Bar Code Scanner", SYMLINK+="scanner1"
but when i cat the symlink like so cat /dev/scanner1
I get this File: /dev/scanner1 <BINARY> │ Size: 0 B
I was hoping for somthing like when you do cat /dev/input/mice
ps: thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了我需要使用action ==“添加”的解决方案,然后将子系统更改为输入,我可以通过使用
cat barcode scanner symlink
看到扫描仪输出。I found the solution I needed to use ACTION=="add" when I did that and changed the subsystem to input it worked and I could see scanner output by using
cat barcode scanner symlink