Companion

object Companion

Properties

Link copied to clipboard
const val DEFAULT_NETSIM_HCI_PORT: Int = 6402

Default TCP port used for netsimd --hci-port / Rootcanal HCI sockets.

Link copied to clipboard

Special alias IP inside the Android Emulator that routes to the host's 127.0.0.1 loopback interface.

Functions

Link copied to clipboard
suspend fun connect(host: String = "127.0.0.1", port: Int = DEFAULT_NETSIM_HCI_PORT, connectTimeout: Duration = 3.seconds): TcpHciPacketIo

Connects a new TcpHciPacketIo to a TCP H4 HCI endpoint (such as netsimd --hci-port or Rootcanal).

Link copied to clipboard
fun fromSocket(socket: ERROR CLASS: Symbol not found for Socket): TcpHciPacketIo

Wraps an already-connected Socket as a TcpHciPacketIo.

Link copied to clipboard
suspend fun isReachable(host: String = "127.0.0.1", port: Int = DEFAULT_NETSIM_HCI_PORT, connectTimeout: Duration = 1.seconds): Boolean

Checks whether an H4 HCI TCP server (such as netsimd --hci-port) is reachable at host:port without issuing an HCI command that would allocate a persistent controller.