Epson BT-2000 Developers Guide - Page 152
Registering scan start and callback
![]() |
View all Epson BT-2000 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 152 highlights
8.8.3. Registering scan start and callback To start the Beacon function, register the callback function using setGapCallback() to receive Advertise from the Beacon device, and start scanning using startScan(). import android.widget.Toast; public class MainActivity extends Activity { private BluetoothLeAdapterManager mManager; @Override protected void onCreate(Bundle savedInstanceState) { //Instance acquisition for the BLE manager class mManager = BluetoothLeAdapterManager.getInstance(); //Register a callback for the GAP function provided mManager.setGapCallback(mLeGapCallback); } private void scanLe(final boolean enable) { if ( enable ) { //Start scanning mManager.starScan(); } else { //Stop scanning mManager.stopScan(); } } Receive scan results using the following callback, and output the received signal strength to a log. private BluetoothLeGapCallback mLeGapCallback = new BluetoothLeGapCallback(){ @Override public void onScanResult(AddrType addrType, String addr, int rssi , byte[] adv_data) { Log.i("DEBUG", "rssi=" + rssi); } }; } MOVERIO Pro Developer's Guide (Rev.1.0) 148
![](/manual_guide/products/epson-bt2000-developers-guide-3a30282/152.png)