

You want to write a device driver so that generic applications can talk to your device without having to modify the applications.

A printer, a scanner, a webcam, a storage controller etc. You are making a device that fits into a generic category. There are several reasons you might want/need to write a device driver. I guess I don't understand why OpenBCI doesn't have or need a device driver, whereas the webcam (or any other standard USB device like a printer, mouse, keyboard, etc.) does. So why couldn't I write an app (in any language) that also just reads/writes directly to the USB/serial port (again, perhaps using JSerialComm or similar)? When I want the app to start capturing webcam video data, I send bytes to the serial port ( again via JSerialComm, etc.) that turn Pin #3 high/on, and that subsequently start reading the video data from Pins 4 and 5. This is a USB device, just like the OpenBCI. Let's pretend (just push the " I believe!" button for a moment) that the pinout for this webcam was stupid simple: PIN # Meaningģ Send data (if 1 then the camera will start "streaming" its video data over data pins) Here, you need to install the webcam's device drivers on your machine so that you can use it. Now, Example 2: a Logitech USB webcam like this one. It would then be up to my app to interpet that data per the specs listed above. So for instance, if I wanted a Java app to interpret brainwave data, I might use JSerialComm to read the data off my local COM port (or whatever USB is on the local system). Just the serial driver necessary to read bytes of data from, and then you need to interpret what those bytes mean from inside your app. So the stack looks like this:īut nowhere here do we have a "device driver" specific to the OpenBCI headset. To read your "streaming" brainwave data, you need to not only read from your serial port (using the serial driver provided by the OS), but you need to interpret the data in according with the OpenBCI specs. The OpenBCI headset sends RF signals to a USB drive plugged into your machine, and then you can write your own software to read the data coming into that port thus, allowing you to read your own brainwaves and interpret brainwave data at the app layer. driver.įor instance, Example 1: let's take OpenBCI, an open source hardware BCI that allows you to read EEG + EKG ("brainwave") readings. I'm having a difficult time understanding when device drivers are needed, and when its fine to just talk directly to a port controller via the OS-provided serial/parallel/USB/etc.
