Package-level declarations

Types

Link copied to clipboard
object ChunkCodec

Splits an arbitrarily-sized payload into 1..N BYTES chunks and reassembles them.

Link copied to clipboard
class ConnectionFailedException(endpointId: String, reason: String?) : Exception

Thrown when Nearby reports a connection failure.

Link copied to clipboard
data class ConnectionInitiated(val endpointId: String, val displayName: String)

A connection handshake was initiated (either side) on endpointId.

Link copied to clipboard
data class ConnectionResult(val endpointId: String, val success: Boolean, val reason: String? = null)

Result of a connection attempt on endpointId.

Link copied to clipboard
data class DecodedChunk(val msgId: Int, val chunkIndex: Int, val chunkCount: Int, val chunkPayload: ByteArray)

A decoded (but not yet reassembled) chunk header + payload slice.

Link copied to clipboard
data class EndpointDisconnected(val endpointId: String)

The endpoint endpointId has disconnected.

Link copied to clipboard
data class EndpointFound(val endpointId: String, val displayName: String)

A discoverable endpoint appeared.

Link copied to clipboard
interface NearbyApi

Abstracts the slice of Google Nearby Connections needed by NearbyLoom.

Link copied to clipboard
class NearbyLoom(api: NearbyApi, serviceId: String = DEFAULT_SERVICE_ID, timeoutMs: Long, maxChunkPayload: Int = ChunkCodec.MAX_CHUNK_PAYLOAD) : Loom

Loom implementation backed by Google Nearby Connections.

Link copied to clipboard
data class NearbyTag(val displayName: String, val peerKey: String) : Tag

A Tag advertising a Nearby Connections endpoint.

Link copied to clipboard
data class PayloadReceived(val endpointId: String, val bytes: ByteArray)

A bytes payload from endpointId.