Epson Moverio Pro BT-2000 Developer's Manual page 176

Hide thumbs Also See for Moverio Pro BT-2000:
Table of Contents

Advertisement

8.9.4. Connecting and Disconnecting BLE
The following provides an example of the processing for connecting and disconnecting BLE.
Connecting: Enable GAP callback registration and scanning before connecting. Connect using
information in (addrType, addr) in the scan results (onScanResult()).
Disconnecting: Disconnect using the connection handle (connStatus.connectedHandle) in the
connection results (onConnectResult()).
import android.bluetooth.BluetoothLeAdapterManager;
import android.bluetooth.BluetoothLeGapEvtConnected;
import android.bluetooth.BluetoothLeGattCallback;
public class MainActivity extends Activity {
private BluetoothLeAdapterManager mManager;
private boolean mConnectingFlg = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
//Instance acquisition for the BLE manager class
mManager = BluetoothLeAdapterManager.getInstance();
//Register a callback for the GAP function provided
mManager.setGapCallback (mLeGapCallback);
}
private void connectLe(final boolean enable) {
if ( enable ) {
} else {
connStatus acquired in onConnectResult
}
}
MOVERIO Pro Developer's Guide (Rev.1.4)
//BLE connect
//Set the addrType and addr acquired in onScanResult
mManager.connect(addrType, addr, 1000, 0);
//BLE disconnect
//Set the connection handle ConnectedHandle in connected event status
mManager.disconnect(ConnectedHandle,
REMOTE_USER_TERMINATED_CONNECTION);
170

Advertisement

Table of Contents
loading

This manual is also suitable for:

Moverio pro bt-2200

Table of Contents