espruino / BangleApps

Bangle.js App Loader (and Apps)
https://banglejs.com/apps
MIT License
498 stars 1.17k forks source link

Move BLE advertising coordination to a module and fix array handling #3420

Closed bobrippling closed 6 months ago

bobrippling commented 6 months ago

This moves common code to a module and fixes a bug shared across all instances

The bugfix:

-for(var ad in Bangle.bleAdvert){
+for(var ad of Bangle.bleAdvert){
   if(ad[0x180F]){
     ad[0x180F] = [E.getBattery()];
     found = true;
     break;
   }
 }
bobrippling commented 6 months ago

Tested by installing both bootgattbat and bootgatthrm, confirmed they're both able to advertise battery/hrm at the same time