 +            isPreparedWrite,
 +            '<Buffer ' + data.length + '>');
 +
++  const callback = function(result) {
++    log.debug('_onWriteAttribute.callback', result, address);
++    if (needResponse) {
++      this._bledroid.command('attributeResponse ' +
++                             connectionId + ' ' +
++                             transactionId + ' ' +
++                             handle + ' ' +
++                             result);
++    }
++  }.bind(this);
++
 +  if (this._centralMap.has(address)) {
 +    assert.strictEqual(this._centralMap.get(address),
 +                       this._centralMap.get(connectionId));

From 8d2cfdbf129728ac3209d4ca09c58f18f73ce257 Mon Sep 17 00:00:00 2001
From: Ben Turner <bent@silklabs.com>
Date: Thu, 16 Jun 2016 14:29:54 -0700
Subject: [PATCH] Android Bluedroid bindings

---
 Android.mk                              |   7 +
 lib/android/bindings.js                 | 859 ++++++++++++++++++++++++++++++++
 lib/android/ccc-descriptor.js           | 196 ++++++++
 lib/android/descriptor-event-emitter.js |  89 ++++
 lib/bleno.js                            |  20 +-
 lib/characteristic.js                   |   2 +
 package.json                            |   6 +-
 7 files changed, 1168 insertions(+), 11 deletions(-)
 create mode 100644 Android.mk
 create mode 100644 lib/android/bindings.js
 create mode 100644 lib/android/ccc-descriptor.js

+include $(BUILD_NODE_MODULE)
diff --git a/lib/android/bindings.js b/lib/android/bindings.js
new file mode 100644
index 0000000..e3e24f5
--- /dev/null
+++ b/lib/android/bindings.js
@@ -0,0 +1,864 @@
+'use strict';
+
+const assert = require('assert');
