MOVERIO Pro Developer's Guide (Rev.1.4)
168
8.9.
BLE Processing Sample Code
When developing a BLE app, describe the sample code used in the BLE API.
8.9.1.
Enabling BLE
Call isEnable() and acquire the current status.
Since BLE is disabled when this function returns false, call enable() to enable BLE.
// Instance acquisition for the BLE manager class
BluetoothLeAdapterManager mManager = BluetoothLeAdapterManager.getInstance();
if ( ! mManager.isEnable() ) {
// BLE Off
if ( ! mManager.enable() ) {
//Error processing: display error message for BLE-On failure
}
} else {
// BLE On
}
8.9.2.
Disabling BLE
Call isEnable() and acquire the current status.
Since BLE is enabled when this function returns true, call disable() to disable BLE.
// Instance acquisition for the BLE manager class
BluetoothLeAdapterManager mManager = BluetoothLeAdapterManager.getInstance();
if ( mManager.isEnable() ) {
// BLE On
if ( ! mManager.disable() ) {
//Error processing: display error message for BLE-Off failure
}
} else {
// BLE Off
}
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 ...