Removed tests, added AndroidX explicitly and added callback interface
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user