SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

can't get bulkRead to work

Last post 03-16-2007 2:10 PM by Milan Miosavljevic. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-09-2006 9:59 PM

    can't get bulkRead to work

    Hi,

    I am building a c# application which has to get input from a custom USB keyboard. I downloaded sharpUSBLib and attempted to connect to my USB keyboard. I was able to connect and get the device description just fine, but when I attempted to use bulkRead on the device, I wasn't able to read anything from the device. Perhaps I am not using the correct endpoint? I used libusb test program to determin which endpoints to use and this is what it tells me:

    Serial Number: Ver 0.34 02/03/06
      wTotalLength:         41
      bNumInterfaces:       1
      bConfigurationValue:  1
      iConfiguration:       0
      bmAttributes:         c0h
      MaxPower:             50
        bInterfaceNumber:   0
        bAlternateSetting:  0
        bNumEndpoints:      2
        bInterfaceClass:    3
        bInterfaceSubClass: 0
        bInterfaceProtocol: 0
        iInterface:         0
          bEndpointAddress: 81h
          bmAttributes:     03h
          wMaxPacketSize:   8
          bInterval:        10
          bRefresh:         0
          bSynchAddress:    0
          bEndpointAddress: 01h
          bmAttributes:     03h
          wMaxPacketSize:   64
          bInterval:        10
          bRefresh:         0
          bSynchAddress:    0

    I tried to use 0x81 and 0x01 to read from the keyboard like so:

    device.BulkRead(0x81, result);

    but that didn't work. What could this be caused by? I'd like to hear from somebody who has successfully used bulkRead method. Thank you in advance for your response.

  • 05-10-2006 11:59 PM In reply to

    • simple
    • Not Ranked
    • Joined on 05-10-2006
    • Posts 1

    Re: can't get bulkRead to work

    Hi,

    I haven't tried the sharplib yet and maybe I won't because nobody seems to have had success with it.

    But in your case I think the problem might be different:

    1) I think it shouldn't be possible to bulk-access a keyboard because it doesn't feature a bulk-endpoint, but only an interrupt endpoint. However I don't know if the sharplib API handles them equally and hides that to the user. Just check that.
    2) Additonally I think windows claims control over all standard USB keyboards and mice for itself. Therefore if it is a standard keyboard, it might not be possible to connect to it at this level. If it's your own device, simply change the usage in the report descriptor of the device to custom or something else, so windows doesn't recognize it as a keyboard or mouse anymore and allows free access.

    I'm not really sure about both points, so handle my answer with care, just trying to give you a hint with my half-knowledge...

    Regards
     Stephan

  • 01-12-2007 5:49 PM In reply to

    • amal
    • Not Ranked
    • Joined on 01-12-2007
    • Posts 2

    Re: can't get bulkRead to work

    I have VS2005 and I installed SharpUSBLib, Can you help with a simple code to receive and transmit bytes to a microcontroller device?

    any help is appreciated

    Filed under:
  • 03-16-2007 2:10 PM In reply to

    Re: can't get bulkRead to work

    Hi,

    and I have same problem (PC+Microcontroller). Anyone have some sample file.
Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.