I had a look into the EspruinoHub code and i saw that the scanning is interruptet if a write message needs to be sent.
/* Write to the given device */
exports.write = function(device, service, characteristic, data) {
if (isBusy) {
queue.push(function() { exports.write(device,service,characteristic,data); });
return;
}
isBusy = true;
getConnectedDevice(device, function(err, connection) {
if (err) return setNotBusy();
connection.getCharacteristic(util.uuid2noble(service),
util.uuid2noble(characteristic),
function(err,char) {
if (err) return setNotBusy();;
writeToCharacteristic(char, util.obj2buf(data), function() {
log(connection.name+": Written.");
setNotBusy();
});
});
});
};
and
function serviceQueue() {
if (!queue.length) {
if (connections.length==0) // no open connections
discovery.restartScan();
return;
}
if (connections.length < MAX_CONNECTIONS) {
var job = queue.shift();
discovery.stopScan();
setTimeout(job, 1000);
}
}
function setNotBusy() {
isBusy = false;
serviceQueue();
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I cant send a write command to the puck:
I only found this information:
https://github.com/sandeepmistry/noble/issues/658
I had a look into the EspruinoHub code and i saw that the scanning is interruptet if a write message needs to be sent.
and
Can it still be related to the dongle i use?