Removed tests, added AndroidX explicitly and added callback interface

This commit is contained in:
2019-04-02 18:48:18 +02:00
parent 2138c42ee0
commit 3d36a50832
9 changed files with 152 additions and 78 deletions

View File

@@ -7,6 +7,7 @@ import android.bluetooth.BluetoothGattService;
import android.content.Context;
import android.util.Log;
import java.io.ByteArrayOutputStream;
import java.util.UUID;
import androidx.annotation.NonNull;
@@ -87,6 +88,14 @@ public class DecaManager extends BleManager<DecaManagerCallbacks> {
@Override
public void onDataReceived(@NonNull BluetoothDevice device, @NonNull Data data) {
Log.d(TAG, "onDataReceived: length=" + data.size() + " data=" + data);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
for (int i = 0; i < data.size(); i++) {
stream.write(data.getByte(i));
}
mCallbacks.onTagLocationData(stream.toByteArray());
}
@Override