خرید بک لینک

Vote count: 0

I need to find nearby BLE tags (them device addresses). It's a simple goal on android. Code to resolve this one looks something like this:

bluetoothAdapter = bluetoothManager.getAdapter();

bluetoothAdapter.startLeScan(leScanCallback);

leScanCallback = new BluetoothAdapter.LeScanCallback() {
     @Override
     public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) {
         runOnUiThread(new Ruable() {
             @Override
             public void run() {
                 Log.d("test", "getAddress=" + device.getAddress());
             }
         });
     }
};

But I can't find solution for browser (JavaScript).

WebBluetooth doesn't support scaing.

Also I saw chrome.bluetooth API for Chrome Apps. Quote from documentation:

As with traditional Bluetooth devices, LE peripherals can be discovered using the methods described in Discovering nearby devices.

But it also doesn't work.

How to find nearby BLE tags from browser? Is this even possible?

Thanks.

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 23 خرداد 1395 ساعت: 20:57

صفحه بندی