分类: LINUX
2012-11-14 17:04:07
1)yixie设备很特殊,使用的是hidraw驱动,在我的PC下面,转为的端口为/dev/hidraw3 我读这个设备可以读出
协议中的数据,但在RB433上,转为的是/dev/hiddev0 这时读取的数据是混乱的,通过查资料,需要在openwrt的源码编译时,在pakage/keener/moudle/other.mk里添加CONFIG_HIDRAW这个配置,这样编译出来就可以使用yixie设备了。
2)根据易写班子提供的协议,可以实现笔迹的读取,但发指令执行擦出功能无法实现,后根据提示,在数据包的第一位添加0x00即可.
+read()
+-------
+read() will read a queued report received from the HID device. On USB
+devices, the reports read using read() are the reports sent from the device
+on the INTERRUPT IN endpoint. By default, read() will block until there is
+a report available to be read. read() can be made non-blocking, by passing
+the O_NONBLOCK flag to open(), or by setting the O_NONBLOCK flag using
+fcntl().
+
+On a device which uses numbered reports, the first byte of the returned data
+will be the report number; the report data follows, beginning in the second
+byte. For devices which do not use numbered reports, the report data
+will begin at the first byte.
+
+write()
+--------
+The write() function will write a report to the device. For USB devices, if
+the device has an INTERRUPT OUT endpoint, the report will be sent on that
+endpoint. If it does not, the report will be sent over the control endpoint,
+using a SET_REPORT transfer.
+
+The first byte of the buffer passed to write() should be set to the report
+number. If the device does not use numbered reports, the first byte should
+be set to 0. The report data itself should begin at the second byte.
+