don/BluetoothSerial — pull request #83 by pardo-bsso (2014-10-11 12:34:58+00:00)
Title: [RFC] Add methods to work with raw bytes.

Hi Don and thanks for this wonderful plugin.

I'm toying with the Firmata protocol over bluetooth and the standard bluetoothSerial cuts the data at the first 0x00 as it uses String() internally.

This is somewhat related to #39 and #57, so pinging @sgenov and @carlocarlini .

I'd like your opinion on this patches (I should probably implement read() too). The new methods are:

### writeRaw
Same as .write() but the data is an array of ints. Currently it chokes on anything that is not a plain array.

```javascript
bluetoothSerial.writeRaw([186, 220, 222], success, failure);
```

### rawSubscribe
Just like .subscribe() but takes no delimiter and the data passed to the callback is an ArrayBuffer

```javascript
bluetoothSerial.rawSubscribe(function (data) {
var bytes = new Uint8Array(data);
console.log(bytes);
}, failure);
```
### rawUnsubscribe
```javascript
bluetoothSerial.rawUnsubscribe();
```