EndpointCodec class

Encodes and decodes Airpass metadata for use in the Nearby Connections endpoint name field.

Constructors

EndpointCodec()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

availableMicroBytes({required String nodeId, required NodeRole role, List<String>? groupIds}) int
Returns the number of bytes remaining for micro-messages after encoding the base metadata (groups, role, node prefix).
decode(String endpointName) EndpointMetadata?
Decode an endpoint name string back into structured metadata.
encode({required String nodeId, required NodeRole role, List<String>? groupIds, String? microMessage}) String
Encode local node metadata into an endpoint name string.
encodedLength({required String nodeId, required NodeRole role, List<String>? groupIds, String? microMessage}) int
Calculates the encoded byte length WITHOUT actually throwing. Useful for validation before committing to a group subscription.
encodeMicroMessage(List<int> payload, {required String nodeId, required NodeRole role, List<String>? groupIds}) String?
Encodes a micro-message payload into a base64 string suitable for embedding in the endpoint name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldConnect({required NodeRole localRole, required List<String>? localGroupIds, required EndpointMetadata remote}) bool
Decides whether this node should connect to a discovered peer based on their respective metadata.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited