Epson BT-2000 Developers Guide - Page 151
BLE Processing Sample Code
View all Epson BT-2000 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 151 highlights
8.8. BLE Processing Sample Code When developing a BLE app, describe the sample code used in the BLE API. 8.8.1. Enabling BLE Call isEnable() and acquire the current status. Since BLE is disabled when this function returns false, call enable() to enable BLE. private BluetoothLeAdapterManager mManager; if ( ! mManager.isEnable() ) { // BLE Off if ( ! mManager.enable() ) { //Error processing: display error message for BLE-On failure } } else { // BLE On } 8.8.2. Disabling BLE Call isEnable() and acquire the current status. Since BLE is enabled when this function returns true, call disable() to disable BLE. private BluetoothLeAdapterManager mManager; if ( mManager.isEnable() ) { // BLE On if ( ! mManager.disable() ) { //Error processing: display error message for BLE-Off failure } } else { // BLE Off } MOVERIO Pro Developer's Guide (Rev.1.0) 147