Data Sheet
public void disconnected() {
}
@Override
public void permission(boolean granted) {
}
}, TerabeeSdk.DeviceType.EVO_60M);
In the process of connecting you will receive callbacks: whether connection established successfully, when
device gets disconnected plus results of permission requests.
Also, note that SDK supports connection to sensor with auto-detection of sensor type. For apply
auto-detect mode need pass in SDK next type of sensor:
TerabeeSdk.DeviceType.AUTO_DETECT
Receiving data from the sensor
To receive data from the connected sensor, it’s necessary to register the data receiver according to the
sensor type.
Create instance of a receiver for a Evo 3M and Evo 60M sensor:
private final TerabeeSdk.DataDistanceCallback mDataDistanceCallback = new
TerabeeSdk.DataOnePixelCallback() {
@Override
public void onDistanceReceived(int distance, int dataBandwidth, int
dataSpeed) {
// received distance from the sensor
}
@Override
public void onReceivedData(byte[] bytes, int i, int i1) {
// received raw data from the sensor
}
};
Register the data receiver:
TerabeeSdk.getInstance().registerDataReceive(mDataDistanceCallback);
After completing of using the sensor you need to unregister the data receiver:
TerabeeSdk.getInstance().unregisterDataReceive(mDataDistanceCallback);
To receive data from a different sensor it’s necessary to register a different data receiver according to the
sensor type. The SDK supports the following data receivers:
DataDistanceCallback – for Evo 3M and Evo 60M sensors, allow to receive distance value from the
sensor
DataDistancesCallback – for Multiflex sensors, allow to receive array values of distances from the
sensor
DataMatrixCallback – for Evo 64px sensors, allow to receive matrix of distances.
DataCallback – for all types of Terabee sensors, allow to receive raw data from any sensor