KarooSystemService

class KarooSystemService(context: Context)

Karoo System Service for interaction with Karoo-specific state and hardware.

Samples

karooSystemUsage

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard

KarooSystem is connected and ready for calls.

Link copied to clipboard

Get the hardware type of the connected Karoo System.

Link copied to clipboard

Get information about the connected Karoo System.

Link copied to clipboard

Get the version of ext lib service is running.

Link copied to clipboard

Get the serial of the connected Karoo System.

Functions

Link copied to clipboard
inline fun <T : KarooEvent> addConsumer(noinline onError: (String) -> Unit? = null, noinline onComplete: () -> Unit? = null, noinline onEvent: (T) -> Unit): String

Register a listener to events or state changes as they happen.

inline fun <T : KarooEvent> addConsumer(params: KarooEventParams, noinline onError: (String) -> Unit? = null, noinline onComplete: () -> Unit? = null, noinline onEvent: (T) -> Unit): String

Register a listener with params to events or state changes as they happen.

Link copied to clipboard
fun connect(onConnection: (Boolean) -> Unit? = null)

Connect to KarooSystem

Link copied to clipboard

Disconnect from KarooSystem and unregister all consumers

Link copied to clipboard

Send a KarooEffect to the Karoo System service for handling.

Link copied to clipboard
fun removeConsumer(consumerId: String)

Unregister a consume from events.