start

fun start(config: Smart1TrackerConfig, provider: Smart1TrackerDataProvider, coroutineScope: CoroutineScope, autoRestartOnError: Boolean = true, onGettingInPort: (Int) -> Unit? = null, onGettingOutPort: (Int) -> Unit? = null, onLog: (level: Smart1TrackerLogLevel, processType: Smart1TrackerProcessType?, message: String) -> Unit? = null, onFatalError: () -> Unit? = null)

Starts the Smart1Tracker process

Parameters

config
provider
coroutineScope
  • The coroutine scope to use for launching the jobs of the Smart1Tracker.

autoRestartOnError
onGettingInPort
  • A callback that is called when the tracker is getting in of some port. And it returns the port id in the lambda function.

onGettingOutPort
  • A callback that is called when the tracker is getting out of some port. And it returns the port id in the lambda function.

onLog
  • A callback that is called when the Smart1Tracker logs a message. You can use this callback to log the messages of the Smart1Tracker in your own log system.

onFatalError
  • A callback that is called when a fatal error occurs. This callback will be only called if the autoRestartOnError value is false, and inside you can have your own logic to handle the restart of the Smart1Tracker process.