ZAHNG Jing:
The code you show does exactly what you state as your objective. If
there is something more that you want to do, then I don't understand;
perhaps restate your requirements in some different terminology.
The read() call gets one message, with the data field populated with the
data read from the CAN bus. You can copy that data to
application-specific variables, and use the data in whatever way is
appropriate to your application. Sending data on the CAN bus is
essentially the opposite. Populate the data (and other) fields of the
canmsg_t structure, and pass the structure to the write() function.
This is pretty much the standard way of using character device drivers
in Linux. Devices are abstracted as files, and we open(), read(),
write() and close() them. The data we read and write is the data from
the device or that we send to the device. The driver makes it easy to
access the device by treating it like a file. This is all done in
userspace code. The driver runs in kernel space, and the read() and
write() functions perform the work of transferring the data between the
application and the kernel driver. Nothing in this paragraph describes
anything that is TS-73xx, ARM, or CANbus specific.
--- rod.
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|