c - Converting linux driver to android usb api ch341 -


After

OK,

I try to convert a ch341 linux driver for Android USB api Stayed. I was very aware that those drivers knew things and I could apologize to those silly questions below.

  CH341, known as USB serial cable HL-340 or even 0x1a86 / 0x7523, vid / pid.  

The driver I found is not a libusb, it is a kernel driver (which I find harder to read).

Is it possible to change a kernel driver in the Google USB API?

I mean, all the accessories needed by the kernel driver can be completed, or at least for this specific driver?

I could open, configure, control and read about these I do not know if this is working, but I have not yet received the error message

controlIn Code part:

  Private integer controlIn (int request, int value, int index, byte [] buffer, int bomize) {int r; R = mConnection.controlTransfer (UsbConstants.USB_DIR_IN | 0x40, request, price, index, buffer, bufsize, DEFAULT_TIMEOUT); Return r; }  

The code below, which is called for reading and writing devices? Or, what process is the read and write of data on your USB device?

  Static struct usb_serial_driver ch341_device = {.driver = {.owner = THIS_MODULE, .name = "ch341-UART",}, .id_table = id_table, .num_ports = 1, .open = ch341_open , Kdtr_artis = C34l_dtr_artis, Kkrriar_rased = C34l_krriar_rased, Kcloj = C34l_cloj, Kset_termios = C34l_set_termios, Kbrek_ktl = C34l_brek_ktl, Kskmget = C34l_skmget, Kiomset = C34l_tiomset, Kskmiwait = Usb_siriyl_jenerik_skmiwait, Kreed_int_kalbak = C34l_reed_int_kalbak, Kport_prob = C34l_port_prob , .port_remove = ch341_port_remove, .reset_resume = ch341_reset_resume,};  

thanks


Comments