简体   繁体   中英

Arduino Bluetooth N64 Controller - Writing a Linux Driver?

I'm working on a little Arduino project to create a bluetooth N64 joystick for my Ubuntu box. I managed to find a sketch to output the controllers state via serial and it works great. Also sending the TX and RX to the little CSR bluetooth module I have works fine.

When I pair with the device I have to use "rfcomm bind" to see the device in my dev directory and 'cat'ing the output shows all the data is coming through as well.

My question is this, what are my next steps for getting Linux to recognize this device as a joystick - ie /dev/js0. If I know what I need to do to achieve this I can read up on the necessary steps but at the moment I have absolutely no clue where to start - having not done anything like this in the past. Should I be looking into creating a Kernel Module?

Any information or pokes in the right direction at all would be greatly appreciated - even if it's just an observation.

Writing custom kernel code is definitely not the way to go here.

To make your project appear as a joystick device in Linux you'll want to present it using the Bluetooth HID profile . With that in place everything should "just work" on the client side and you'll see an entry in /dev. The HID profile is pretty comprehensive and is used by most Bluetooth interface devices - keyboards, mice, game controllers etc. the Bluetooth part of this is actually mostly just a thin wrapper around the USB HID protocol.

From the sounds of things your device is currently not advertising itself using that profile.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM