Epson BT-2000 Developers Guide - Page 157
Searching for Characteristic Descriptor
![]() |
View all Epson BT-2000 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 157 highlights
8.8.7. Searching for Characteristic Descriptor You can search for the Characteristic Descriptor on a connected BLE device by executing the callback function setGattCallback() and Characteristic Descriptor search using discCharDesc(). import android.bluetooth.BluetoothLeAdapterManager; import android.bluetooth.BluetoothLeGapEvtConnected; import android.bluetooth.BluetoothLeGattCallback; 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 GATT function provided mManager.setGattCallback(mLeGattCallback); //Searching for Characteristic Descriptor //Set StartHandle and EndHandle from the acquired onDiscPriSrvResult mManager.discCharDesc (ConnectedHandle, StartHandle, EndHandle); } Use the following callback to output logs when a Characteristic Descriptor is detected. private BluetoothLeGattCallback mLeGattCallback = new BluetoothLeGattCallback() { }; } @Override public void onDiscCharDescResult (char connectedHandle, int status, BluetoothLeGattChar[] data) { for (int cnt=0; cnt
![](/manual_guide/products/epson-bt2000-developers-guide-3a30282/157.png)