and it's....
Web Bluetooth is a new API provided to allow interacting with devices from the web
use beacons with NO mobile app install
iBeacons
Eddystone
Physical Web
*but it works on iOS!
*and that's it!
Web Bluetooth
Enable bluetooth, get Chrome app, swipe down, enable Today Widgets
Enable Bluetooth + 'Settings > Google > Nearby'
connect smart kitchen scale to recipe web site to ensure precise measurements
connect smart jewelry to web browser to receive reminders
connect web site to connected beacons to enhance a historical visit!
hint ☝️
"Allows web sites to communicate over GATT with nearby user-selected Bluetooth devices in a secure and privacy-preserving way."
BLE: Bluetooth Low Energy
Bluetooth low energy (LE) is the version of Bluetooth that was built for the Internet of Things (IoT).
GATT: Generic ATTributes
The Generic Attributes (GATT) protocol defines the way that two BLE devices transfer data back and forth.
GATT Characteristics
Altitude Device Name |
org.bluetooth.characteristic.altitude org.bluetooth.characteristic.battery_level |
GATT Declarations
GATT Descriptors
GATT Services
#yolo
ng-beacon
https://github.com/manekinekko/angular-web-bluetooth
connect your beacons to website routes*
*use https and bit.ly shorteners!
1. Listen for beacon signals
ngOnInit(){
this.getDeviceStatus();
this.items = this.db.list('/Locales');
//sanitize images
this.items.subscribe(queriedItems => {
for (let prop in queriedItems){
this.cleanedImage = this.sanitizer.bypassSecurityTrustUrl(queriedItems[prop].Image);
queriedItems[prop].Image = this.cleanedImage.changingThisBreaksApplicationSecurity;
}
});
}
2. Connect to a beacon via service
connect() {
return this.ble
.discover$({ filters: [{ services: [BleUartService.UART_SERVICE] }] })
.mergeMap(gatt => {
this.gatt = gatt;
return this.ble.getPrimaryService$(gatt, BleUartService.UART_SERVICE);
})
.mergeMap(primaryService => this.connectRxTx(primaryService));
}
3. get info back from beacon, navigate
getDeviceStatus() {
this._beaconService.getDevice().subscribe(
(device) => {
if(device) {
//get the beacon's name
this.router.navigate(['/locale',device.name]);
this.device = device;
}
else {
// device not connected or disconnected
this.device = null;
}
}
);
}
@jenlooper