USB Host auto event

30 Jun 2011

Hello, I am using BlueUSBHosthttp://mbed.org/users/peterbarrett1967/programs/BlueUSB/5yn1q program to talk mbed with my mouse. After connecting mouse it starts writing AUTO_MOUSE in terminal window. Please can anybody help me with code to get access to x,y, wheel and button data instead of AUTO_MOUSE report on terminal. I would like to use these data to do some actions (example - pressing left button will light up LED 1 on mbed).

After using google I understand I have to read interupt endpoint 81. My idea is to read this endpoint "on the fly" so as 4byte data arrives from mouse to mbed >read them > (store them to buffer?) > and process some functions based on values arrived in endpoint.

Can You please help me with code to have access to 4bytes from interupt endpoint of mouse? Or how to get printed by terminal values of andpoint that mouse sends instead of AUTO_MOUSE message?

30 Jun 2011

Hi, these events are handled in AutoEvents.cpp. This is done to make your life easy, you don't have to look for the endpoint yourself nor do you have to call any USB functions. The version autoevents that I have here prints AUTO_MOUSE data <length>: <data> Is the data you are looking for in that data? If it is you can simply replace the printf("AUTO_MOUSE "); statement with a call like my_mouse_handler(data, len); and comment out the statement printfBytes("data",data,len);