From 601d0cf581d3ad0f354734bc73b21da06a8b95f1 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Tue, 12 Dec 2017 13:24:26 -0500 Subject: [PATCH] Send a buffer of a string, not the entire string. --- lib/ble/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ble/index.js b/lib/ble/index.js index cf52e67..ee7e4d9 100644 --- a/lib/ble/index.js +++ b/lib/ble/index.js @@ -174,7 +174,9 @@ class BLE { obj = JSON.parse(utf8) result = bleno.Characteristic.RESULT_SUCCESS if (obj.type && this[`_on${capitalize(obj.type)}`]) { - this[`_on${capitalize(obj.type)}`]( data => { + this[`_on${capitalize(obj.type)}`]( obj => { + let str = JSON.stringify(obj) + let data = new Buffer(str) return callback(result, data.slice(offset, data.length)) }) } else {