add iso support to bench app

This commit is contained in:
Gilles Boccon-Gibod
2025-07-06 14:08:16 +02:00
parent 1c1b947455
commit 43a8cc37f8
15 changed files with 820 additions and 196 deletions

View File

@@ -1,5 +1,7 @@
package com.github.google.bumble.remotehci;
import static com.github.google.bumble.remotehci.HciPacket.Type.COMMAND;
import android.os.RemoteException;
import android.util.Log;
@@ -16,6 +18,10 @@ public class HciProxy {
private int mAclPacketsSent;
private int mScoPacketsSent;
private static final byte[] LOOPBACK_COMMAND_COMPLETE_EVENT = {
0x0E, 0x04, 0x01, 0x77, (byte)0xFC, 0x00
};
HciProxy(int port, Listener listener) throws HalException {
this.mListener = listener;
@@ -84,6 +90,14 @@ public class HciProxy {
@Override
public void onPacket(HciPacket.Type type, byte[] packet) {
// Short-circuit a local response when a special latency-testing packet
// is received.
if (type == COMMAND && packet[0] == (byte)0x77 && packet[1] == (byte)0xFC) {
Log.d(TAG, "LOOPBACK");
mServer.sendPacket(HciPacket.Type.EVENT, LOOPBACK_COMMAND_COMPLETE_EVENT);
return;
}
Log.d(TAG, String.format("HOST->CONTROLLER: type=%s, size=%d", type, packet.length));
hciHal.sendPacket(type, packet);

View File

@@ -12,7 +12,7 @@ import java.net.Socket;
public class HciServer {
private static final String TAG = "HciServer";
private static final int BUFFER_SIZE = 1024;
private static final int BUFFER_SIZE = 8192;
private final int mPort;
private final Listener mListener;
private OutputStream mOutputStream;