I can’t understand why this code doesn’t execute
this.ble.startScan([]).subscribe(devices => {
if (JSON.stringify(devices.name) == ‘my_ble’)
console.log(‘device id:’+ JSON.stringify(devices.id));
can s/o help me please?
Which code exactly? From what I see it could either not fire the subscribe
or not find a device called my_ble
.
1 Like
the if block doesn’t work ,when i execute it without "if (JSON.stringify(devices.name) == ‘my_ble’) " it runs also i tried with .filter() but the same issue.
Add a console.log(devices.name, devices)
before the if to see what is actually in there.