@Gordon - that didn't work. I had gotten to this point by using "save on send", so I enabled that again and used "var foo;" and was finally able to clear it out that way. I had even reloaded the boot code. Somehow that area of flash isn't getting cleared properly by any other method. I'd say there is a bug if I had to guess... I'd imagine this is going to cause others to have issues, so it bears looking into if you can do so. See attached screen grab.
Now, on to my task. I tried the following, but don't see the UUID/major, minor being advertised when I use my iBeacon scanners on the iPhone. It is based on the previously mentioned conversation:
var advertise = function(options) {
var d = new Uint8Array([
0x02, // Number of bytes after first AD structure
0x01, // BLE_GAP_AD_TYPE_FLAGS
0x04, // BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED
0x1A, // Length
0xFF, // BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA
0x4C, 0x00, // 0x004C == Apple
0x02, 0x15, // iBeacon type + length
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,// iBeacon proximity uuid
0x80, 0x00, // major
0x34, 0xab, // minor
0xc5]); // 2'c complement RSSI at 1 meter distance in dBm
d.set(options.uuid,9);
if (options.major!==undefined) d.set([options.major>>8,options.major],25);
if (options.minor!==undefined) d.set([options.minor>>8,options.minor],27);
if (options.rssi!==undefined) d.set([(options.rssi<0)?(options.rssi+256):options.rssi],29);
var e = [].slice.call(d);
NRF.setAdvertising(e, {interval:100});
};
advertise({
uuid : [0xDA, 0xB5, 0x9C, 0x4F, 0xA4, 0xD6, 0xEE, 0x28, 0x6B, 0xFE, 0x8E, 0x00, 0x00, 0xBB, 0xC2, 0xBB], // ibeacon uuid
major : 0x8000, // optional
minor : 0x1234, // optional
rssi : -59 // optional RSSI at 1 meter distance in dBm
});
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.
@Gordon - that didn't work. I had gotten to this point by using "save on send", so I enabled that again and used "var foo;" and was finally able to clear it out that way. I had even reloaded the boot code. Somehow that area of flash isn't getting cleared properly by any other method. I'd say there is a bug if I had to guess... I'd imagine this is going to cause others to have issues, so it bears looking into if you can do so. See attached screen grab.
Now, on to my task. I tried the following, but don't see the UUID/major, minor being advertised when I use my iBeacon scanners on the iPhone. It is based on the previously mentioned conversation:
1 Attachment