MOVERIO Pro Developer's Guide (Rev.1.4)
173
8.9.6.
Searching for Characteristic
You can search for the Characteristics on a connected BLE device by executing the callback
function setGattCallback() and Characteristic search using discChar().
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
//
Set StartHandle and EndHandle from the Service information
acquired in
onDiscPriSrvResult
mManager.discChar (ConnectedHandle, StartHandle, EndHandle);
}
Use the following callback to output logs when a Characteristic is detected.
private BluetoothLeGattCallback mLeGattCallback =
new BluetoothLeGattCallback() {
@Override
public void onDiscCharResult(char connectedHandle,
int status, BluetoothLeGattChar[] data) {
for (int cnt=0; cnt<data.length; cnt++) {
Log.i(“DEBUG”, “HandleValue=” +
data[cnt].hand “ uuid=” +
data[cnt].uuid);
}
};
};
}
Summary of Contents for Moverio Pro BT-2000
Page 7: ...MOVERIO Pro Developer s Guide Rev 1 4 1 1 Introduction ...
Page 12: ...MOVERIO Pro Developer s Guide Rev 1 4 6 2 Developing Apps ...
Page 30: ...MOVERIO Pro Developer s Guide Rev 1 4 24 3 Display control ...
Page 39: ...MOVERIO Pro Developer s Guide Rev 1 4 33 4 UI control ...
Page 47: ...MOVERIO Pro Developer s Guide Rev 1 4 41 5 Voice commands ...
Page 70: ...MOVERIO Pro Developer s Guide Rev 1 4 64 6 Camera control ...
Page 119: ...MOVERIO Pro Developer s Guide Rev 1 4 113 7 Sensor control ...
Page 127: ...MOVERIO Pro Developer s Guide Rev 1 4 121 8 Bluetooth BLE ...
Page 184: ...MOVERIO Pro Developer s Guide Rev 1 4 178 9 Power control ...
Page 187: ...MOVERIO Pro Developer s Guide Rev 1 4 181 10 Self diagnostic function ...
Page 191: ...MOVERIO Pro Developer s Guide Rev 1 4 185 11 GPS Assist ...
Page 202: ...MOVERIO Pro Developer s Guide Rev 1 4 196 Memo ...