EasyManua.ls Logo

Epson Moverio Pro BT-2000 - BLE Processing Sample Code

Epson Moverio Pro BT-2000
202 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
}

Table of Contents

Other manuals for Epson Moverio Pro BT-2000

Related product manuals