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

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

Advertisement

8.9.10. Writing a Characteristic Value
You can write the Characteristic Value to a connected BLE device by
executing the callback function setGattCallback() and Characteristic Value writing using
writeGatt().
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);
Writing a Characteristic Value
//
//Set the handle HandleValue in Characteristic Value from the Characteristic
// information acquired in onDiscCharResult()
mManager.writeGatt(ConnectedHandle, HandleValue, 0x01);
}
Use the following callback to output logs when a Characteristic Value is written.
private BluetoothLeGattCallback mLeGattCallback =
new BluetoothLeGattCallback() {
@Override
public void onWriteGattResult(char connectedHandle, int status,
}
};
}
MOVERIO Pro Developer's Guide (Rev.1.4)
BluetoothLeGattEvtWriteRsp data) {
//Since the value written in writeGatt is returned for confirmation,
// no processing is performed
Log.i("DEBUG", "write ok");
177

Advertisement

Table of Contents
loading

This manual is also suitable for:

Moverio pro bt-2200

Table of Contents