Ahh, yes. It's a bit frustrating because of the way NRF.setAdvertising was implemented originally - and then I was stuck trying to be backwards compatible.
Try this:
var bUrl = "stackoverflow.com"; // Updated from Node-Red
function updateAdv() {
var data = [JSON.stringify(Puck.light().toFixed(3) * 1000), Math.round(E.getTemperature())];
console.log(data);
NRF.setAdvertising([
NRF.getAdvertisingData({},{manufacturer: 0x0590, manufacturerData:data}),
require("ble_eddystone").advertise(bUrl)
], {interval:1000});
}
updateAdv();
setInterval(updateAdv, 5000);
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.
Ahh, yes. It's a bit frustrating because of the way
NRF.setAdvertising
was implemented originally - and then I was stuck trying to be backwards compatible.Try this: