Reconnecting to a Known Device
Posted: 15:14, 11 May 2016
I am building an app where I keep a list of known devices (i.e. devices that I previously scanned for and connected to). When my app restarts, I want to reconnect to these devices, but I can't reinitiate the scan because the device is not in pairing mode. The problem is that i no longer have a device JSON object with all the methods added to it by the easyble scan/connect. It seems that the api should provide something like the following:
evothings.easyble.reconnect = function(device,success,fail) {
console.log("Attempting Reconnect on: " + device.address);
internal.knownDevices[device.address] = device;
internal.addMethodsToDeviceObject(device)
internal.connectToDevice(device,function(dvc) {
internal.connectedDevices[dvc.address] = dvc;
success(dvc);
},fail);
}
It is, of course, possible that I have misunderstood this process. If so please advise. Thanks!
evothings.easyble.reconnect = function(device,success,fail) {
console.log("Attempting Reconnect on: " + device.address);
internal.knownDevices[device.address] = device;
internal.addMethodsToDeviceObject(device)
internal.connectToDevice(device,function(dvc) {
internal.connectedDevices[dvc.address] = dvc;
success(dvc);
},fail);
}
It is, of course, possible that I have misunderstood this process. If so please advise. Thanks!