Linux general technology-Linux programming and kernel information-linuxusb drivers and user programs. The linux usb driver is loaded into the kernel as a module. The driver has functions such as read () and write (). Does the data collection device need to write user programs to transmit data through usb?
Can the USB driver automatically read and write data? We can see that some example drivers only have some independent functions, and there is no main function.
# Include
# Include
MODULE_LICENSE ("GPL ");
Static int hello_init (void)
{
Printk (KERN_ALERT "Hello World! \ N ");
Return 0;
}
Static int hello_exit (void)
{
Printk (KERN_ALERT "GOODBYE! \ N ");
}
Module_init (hello_init );
Module_exit (hello_exit );
In this kind of driver template, add some read (), write () and other functions to automatically read and write data? This is to write an independent sub-function. it seems that calling can take effect. is it necessary to write a function such as usb user program call, read (), write () to transmit data?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service