Open ahnseunghae opened 10 years ago
github에 distance를 얻는 예제를 다음과 같이 추가하였습니다. Peripheral.getDistance() 메소드를 사용하시면 됩니다.
CentralManager centralManager = CentralManager.getInstance(getApplicationContext()); centralManager.setPeripheralScanListener(new PeripheralScanListener() { @Override public void onPeripheralScan(Central central, final Peripheral peripheral) { // TODO do whatever you want with Peripheral(namely beaocn) peripheral.getBDAddress(); // gets Bluetooth Device address peripheral.getBDName(); // gets Bluetooth Device Name peripheral.getDistance(); // gets distance between peripheral and central device peripheral.getProximityUUID(); // gets uuid peripheral.getMajor(); // gets major id peripheral.getMinor(); // gets minor id peripheral.getBroadcastTime(); // gets broadcast time of the peripheral peripheral.getMeasuredPower(); // gets measured power in (dBm) peripheral.getProximity(); // gets proximity peripheral.getRssi(); // gets RSSI(Received Signal Strength Indicator) in (dBm) } }); // if bluetooth is disabled, then turn on before going further if(!centralManager.isBluetoothEnabled()) { Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(enableBtIntent, 100); } ...
문서 찾기가 좀 어렵네요ㅠㅠ
일단 비콘과의 거리 측정을 할려고 하는데 어떤 식으로 해야되는지 모르겠네요
예제나 도큐먼트 같은거 없나요?
그리고 오차 범위가 어느정도인지 알고 싶습니다.