animatedledstrip-client / animatedledstrip.client / AnimationSenderFactory / AnimationSender

AnimationSender

class AnimationSender

Constructors

<init>

AnimationSender(ipAddress: String, port: Int, connectAttemptLimit: Int)

Properties

connectAttemptLimit

val connectAttemptLimit: Int

connected

var connected: Boolean

ipAddress

var ipAddress: String

port

val port: Int

runningAnimations

val runningAnimations: MutableMap<String, AnimationData>

started

var started: Boolean

Functions

end

fun end(): Unit

Stop this connection

send

fun send(args: AnimationData): Unit

Send an animation via this connection

setAsDefaultSender

fun setAsDefaultSender(): AnimationSender

Set this sender as the default sender

setIPAddress

fun setIPAddress(address: String): AnimationSender

Set this connection's IP address. Restarts connection if connected.

setOnConnectCallback

fun setOnConnectCallback(action: () -> Unit): AnimationSender

Specify an action to perform when a connection is established

setOnDisconnectCallback

fun setOnDisconnectCallback(action: () -> Unit): AnimationSender

Specify an action to perform when a connection is lost

setOnEndAnimationCallback

fun <R> setOnEndAnimationCallback(action: (AnimationData) -> R): AnimationSender

Specify an action to perform when an animation ending message is received from the server. Runs after onReceive callback.

setOnNewAnimationCallback

fun <R> setOnNewAnimationCallback(action: (AnimationData) -> R): AnimationSender

Specify an action to perform when an animation starting message is received from the server. Runs after onReceive callback.

setOnReceiveCallback

fun <R> setOnReceiveCallback(action: (AnimationData) -> R): AnimationSender

Specify an action to perform when data is received from the server

start

fun start(): AnimationSender

Start this connection