I'm not quite sure I understand the question... If you do E.setBootCode('NRF.setAdvertising({},{name: "<name>"});'/*,true*/); with true uncommented then the name change will persist through power cycling and calling reset().
WARNING - THIS IS DANGEROUS if you run code with E.setBootCode(..., true) it is always called, which means if you do something that stops you connecting to your device it's non-connectable FOREVER. Always try without setting true first to check that what you want to do actually works!
The only thing it won't persist through is reset(true) because that erases everything you wrote to the device.
If you want it to persist through completely erasing the device's memory then you have 2 options:
Build your own firmware with the name changed
Replace reset so the user can't fully reset the device's memory:
(function() {
var r = reset;
global.reset=function(){reset()};
});
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'm not quite sure I understand the question... If you do
E.setBootCode('NRF.setAdvertising({},{name: "<name>"});'/*,true*/);
withtrue
uncommented then the name change will persist through power cycling and callingreset()
.WARNING - THIS IS DANGEROUS if you run code with
E.setBootCode(..., true)
it is always called, which means if you do something that stops you connecting to your device it's non-connectable FOREVER. Always try without settingtrue
first to check that what you want to do actually works!The only thing it won't persist through is
reset(true)
because that erases everything you wrote to the device.If you want it to persist through completely erasing the device's memory then you have 2 options:
Replace
reset
so the user can't fully reset the device's memory: