Hey all, I’m working on a node js library to allow you to fly minidrones with DualShock playstation controllers. I was able to repurpose a bunch of stuff from other node libraries, and it’s working really well. Flying with analog controls is way better than on a touch screen.
I’d like to extend the functionality and fix a few bugs. What’s the best resource to understand buffers and how to write to characteristics over the BT network? I see some of the documentation in the protocol docs but I’m having trouble grasping how to apply the docs to actual code.
For example the takeoff command looks like this, where this.steps is the sequence number, and COMMAND_KEY is ‘fa0c’.
let buffer = new Buffer([0x02, ++this.steps[COMMAND_KEY] & 0xFF, 0x02, 0x00, 0x01, 0x00]); this.write(COMMAND_KEY, buffer);
The rest I’m a little spacey on. Basically can someone walk me through interpreting the docs, creating buffers, and writing them to actual JS code?