-
• #2
Chances are you have so many advertising packets being received that it can't output the characters fast enough over BLE. Hence it not appearing to stop - it probably did stop but there was such a backlog it was taking ages.
The sample code definitely does work, but just not if you have a lot of devices or devices that advertise quickly
If you want to use
setScan
rather thanfindDevices
, make sure you can handle the data fast enough - for instance by just writing everything into an array (arr[d.id]=d
) -
• #3
Thanks!
By array, I assume you mean object? Otherwise, that works!
>xxx = []; =[ ] >xxx["abc"] = "def"; ="def" >xxx =[ ] >xxx =[ ] >xxx.abc ="def" >nnn = {} ={ } >nnn["abc"] = "def"; ="def" >nnn ={ "abc": "def" } >
-
• #4
Yes, object - thanks :)
Sample code for
NRF.setScan(xxx)
hangs during scanning. Where you see the block cursor in the attachment is the last character that was sent to the console. Typingreset()
doesn't do anything. Cycling power on Puck works though to reset.Also, calling
NRF.setScan()
with no argument (in order to stop scanning) isn't working.packets
variable continues to decrement, and scanning proceeds.Reproduced on 2 Pucks, both running 1v91.
Edit: I added
console.log(process.memory());
, and I can seefree
blocks dropping by about 500 as each packet is processed.1 Attachment