Package-level declarations

Types

Link copied to clipboard

Represents the BaudRate that the SerialPort uses.

Link copied to clipboard
data class ChannelState(val id: String, val pollPeriod: Int, val energy: Long = 0, val maxVoltage: Int? = null, val minVoltage: Int? = null, val cumulativeVoltage: Long = 0, val maxCurrent: Int? = null, val minCurrent: Int? = null, val cumulativeCurrent: Long = 0, val maxPower: Int? = null, val minPower: Int? = null, val cumulativePower: Long = 0, val errorCount: Long = 0, val readCount: Long = 0, val latestEvent: MeterReading? = null)

Keeps track of channel state. Units in millis mW, mV, mA Units in micros: µJ

Link copied to clipboard
data class ElmorLabsPMDConfig(val ignore: Boolean = false, val pollPeriod: Int, val sampleRate: Int, val portConfiguration: PortConfiguration) : PowerMeterConfig
Link copied to clipboard

Different capabilities supported by the drivers.

Link copied to clipboard
data class MeterReading(val nanoTime: Long = System.nanoTime(), val systemTimestamp: Long = System.currentTimeMillis(), val meter: String, val channel: Int, val meterTime: Long? = null, val flags: List<String>? = null, val voltage: Int? = null, val current: Int? = null, val power: Int? = if (voltage != null && current != null) voltage * current / 1000 else null, val energy: Int? = null, val online: Boolean = true, val error: Boolean = false)

A reading received from the meter an event for reporting a successful measurement event

Link copied to clipboard
data class MeterState(val id: String, val status: MeterStatus, val channels: List<ChannelState>, val latestEvent: MeterReading? = null, val statusMessage: String? = null, val present: Boolean)

The live state of a single meter

Link copied to clipboard

The state of a power meter handler. Allows signaling various kinds of low and high level issues.

Link copied to clipboard
data class MeterType(val id: String, val description: String, val imageResource: String)

Describes a power meter type (id & description) and its image file for the frontend.

Link copied to clipboard
data class PortConfiguration(val baudRate: BaudRate = BaudRate.B115200, val dataBits: PortDataBits = PortDataBits.DataBits8, val stopBits: PortStopBits = PortStopBits.StopBits1, val parity: PortParity = PortParity.None, val flowControl: PortFlowControl = PortFlowControl.None)

Port configuration for TTY devices.

Link copied to clipboard

Represents the number of data bits.

Link copied to clipboard

The flow control scheme for the data.

Link copied to clipboard

Represents the parity.

Link copied to clipboard

Represents the number of stop bits.

Link copied to clipboard
data class PowerMeter(val meterType: MeterType, val protocol: String, val description: String, val channels: List<String>, val outputChannels: List<String> = channels, val pollPeriod: Int, val sampleRate: Int, val logEvents: Boolean, val present: Boolean = true, val extra: PowerMeterData, val capabilities: List<MeterCapability>, val id: String = "-", val shortId: String? = null, val describe: List<String> = extra.describe)

Power meter descriptor with abstract informative content.

Link copied to clipboard
Link copied to clipboard
sealed interface PowerMeterData
Link copied to clipboard
data class PowerMeterSimulatedExtra(val id: Int, val maxVoltage: Int = 24000, val maxCurrent: Int = 500, val maxVoltageNoise: Int = 500, val maxCurrentNoise: Int = 500, val passive: Boolean = false, val describe: List<String> = listOf( "Simulated id: $id", "maxVoltage: $maxVoltage mV", "maxCurrent: $maxCurrent mA", "maxVoltageNoise: $maxVoltageNoise mV", "maxCurrentNoise: $maxCurrentNoise mA", )) : PowerMeterData

Extra data fields for simulated power meters.

Link copied to clipboard
data class PowerMeterUSBExtra(val busPath: String, val devicePath: String? = null, val productId: Short, val vendorId: Short, val portConfiguration: PortConfiguration? = null, val maxPower: Int? = null, val speed: String? = null, val serial: String? = null, val describe: List<String> = listOf( "Bus path: $busPath", "Device path: ${devicePath ?: "N/A"}", "Vendor id: ${vendorId.toHexString()}:${productId.toHexString()}", "Serial port: ${portConfiguration ?: "N/A"}", "Max power: ${maxPower ?: "?"} mA", "USB bus speed: ${speed ?: "?"} Mbps", "Serial: ${serial ?: "N/A"}", )) : PowerMeterData

Extra data fields for USB/TTY power meters.

Link copied to clipboard
data class SmartPower3Config(val ignore: Boolean = false, val pollPeriod: Int, val sampleRate: Int, val portConfiguration: PortConfiguration) : PowerMeterConfig
Link copied to clipboard
data class SmartPowerConfig(val ignore: Boolean = false) : PowerMeterConfig
Link copied to clipboard
data class USBDevice(val vid: Short, val pid: Short, val bus: Int, val address: Int, val maxPower: Int? = null, val type: USBType? = null, val properties: Map<String, String> = mapOf(), val deviceFiles: List<String> = listOf())

Low level structure returned by the USB/HID enumerator.

Link copied to clipboard

Supported USB device classes. More can be added if necessary.