Reputation:
To begin, I am building a simple gamepad and I was wondering if there is anyway that I can program a universal driver, what I mean by that is that so the input to be passed in by the gamepad (buttons, axes, etc) are built in one driver and that one driver is compatible with many systems.
I have searched everywhere but cannot find an answer to my solution. I see companies like logitech and other gamepads, whenever I plug the gamepad into any system it works, how do I program my device to do that?
--Edit--:
The connection between the host and my device is through bluetooth. But I already have that part taken care of, the data transmits successfully. The hard part is building the driver that will submit the input from gamepad to the actual game.
Upvotes: 0
Views: 268
Reputation: 243
Like Unix originally suggested: if you keep your device compatible with block or character device driver code built-in to the OS, your device will be 'compatible'.
Upvotes: 0
Reputation: 399763
The best approach should be to make your device appear as a Bluetooth Human Interface Device: I believe that's how mainstream commercial devices do it.
Operating systems can provide generic driver support for HID-class devices, that's the point of pre-defining the device class.
Upvotes: 1
Reputation: 63190
Drivers control hardware, and drivers are written at OS level, and deal with OS specific ways of dealing with hardware. There is no universial, cross platform way to write a driver, because each different OS works differently at kernel level.
Windows Drivers and Linux Drivers are written in a different ways, because they handle hardware differently.
You will have to write a driver for each OS you want to support.
Upvotes: 2