From 9dcd9ad0463ca270d4f115e4f9798ece146fc812 Mon Sep 17 00:00:00 2001 From: Michael Dietz Date: Tue, 23 Feb 2016 10:09:08 +0100 Subject: [PATCH] device.connectGATT() deprecated. No need for notification callback handler in writeMode(). --- dist/dfu.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dist/dfu.js b/dist/dfu.js index 0fdef57..2ac44b7 100644 --- a/dist/dfu.js +++ b/dist/dfu.js @@ -130,7 +130,6 @@ }) .then(() => { log("writing modeData"); - controlChar.addEventListener('characteristicvaluechanged', handleNotifications); return controlChar.writeValue(new Uint8Array([1, 4])); }) .then(() => { @@ -142,10 +141,6 @@ log(error); reject(error); }); - - function handleNotifications(event) { - log('received notification on control characteristic - ERROR this should not happen'); - } }); } @@ -217,7 +212,7 @@ }); } - device.connectGATT() + device.gatt.connect() .then(gattServer => { // Connected server = gattServer;