Skip to content

Library for connecting to an AnimatedLEDStrip server from clients written in Kotlin/JVM or Kotlin/JS

License

Notifications You must be signed in to change notification settings

AnimatedLEDStrip/client-kotlin-mpp

Repository files navigation

Build Status codecov Maven Central

AnimatedLEDStrip Client Library for Kotlin/MPP

This library allows a Kotlin/JVM or Kotlin/JS client to communicate with an AnimatedLEDStrip server.

Creating an ALSHttpClient

To create a HTTP client, run ALSHttpClient(clientEngine, ip).

clientEngine is a Ktor HttpClientEngineFactory

val client = ALSHttpClient(CIO, ip = "10.0.0.254")

An optional configuration for the Ktor engine can be passed as a third argument. Any configuration should include a JSON feature that uses the AnimatedLEDStrip serializer:

import animatedledstrip.communication.serializer as alsSerializer

install(JsonFeature) {
    serializer = KotlinxSerializer(alsSerializer)
}

Communicating with the Server

This library follows the conventions laid out for AnimatedLEDStrip client libraries.

About

Library for connecting to an AnimatedLEDStrip server from clients written in Kotlin/JVM or Kotlin/JS

Topics

Resources

License

Stars

Watchers

Forks

Languages