SensorLegacyCommands

Functions

Link copied to clipboard
abstract suspend fun collectMemoryStatistics(updateProgress: suspend (progress: Progress) -> Unit = {})

Restart the collection of memory statistics from sensor.

Link copied to clipboard
abstract suspend fun disableEncryption(updateProgress: suspend (progress: Progress) -> Unit = {})

Disable encryption of part of advertisement package and commands requests/responses

Link copied to clipboard
abstract suspend fun downloadMeasurements(startDate: Long? = null, endDate: Long? = null, updateProgress: suspend (progress: Progress) -> Unit): Map<Channel, List<MeasurementsPacket>>

Start operation which will transfer measurements from a given time range defined by optional startDate and endDate timestamp constraints. Time range limitation using timestamps is supported by sensors 6.0 and newer. For older sensor all measurements will be transferred. If this command is run on older sensors then all measurements will be returned regardless if startDate or endDate were provided or not.

Link copied to clipboard
abstract suspend fun enableEncryption(encryptionKey: String, updateProgress: suspend (progress: Progress) -> Unit = {})

Enable encryption of part of advertisement package and commands requests/responses

Link copied to clipboard
abstract suspend fun enterBootloader(bootloaderEntryCode: Long, updateProgress: suspend (progress: Progress) -> Unit = {})

Enter sensors bootloader. If bootloader entry code is incorrect sensor will reboot.

Link copied to clipboard
abstract suspend fun finishBatchReconfiguration(updateProgress: suspend (progress: Progress) -> Unit = {})

Finish batch reconfiguration of sensor.

Link copied to clipboard
abstract suspend fun finishCalibration(channel: Channel, finishCalibrationParameters: FinishCalibrationParameters, updateProgress: suspend (progress: Progress) -> Unit = {})

Finish sensor calibration process for given channel. The calibration result can be rejected or accepted in this command. This command works only if the given calibration procedure supports the early completion of the calibration

Link copied to clipboard
abstract suspend fun getBatteryStatistics(updateProgress: suspend (progress: Progress) -> Unit = {}): BatteryStatistics

Get battery statistics from sensor.

Link copied to clipboard
abstract suspend fun getBluetoothTurnoff(updateProgress: suspend (progress: Progress) -> Unit = {}): BluetoothTurnOff

Get bluetooth turn off timeout.

Link copied to clipboard
abstract suspend fun getCalibrationData(channel: Channel, updateProgress: suspend (progress: Progress) -> Unit = {}): Calibration

Get sensor's calibration data from given channel

Link copied to clipboard
abstract suspend fun getChannelTypes(updateProgress: suspend (progress: Progress) -> Unit = {}): Map<Channel, Measurement.Type>

Get channel types from sensor.

Link copied to clipboard
abstract suspend fun getConfigurationErrors(clearErrors: Boolean, updateProgress: suspend (progress: Progress) -> Unit = {}): ConfigurationErrors

Get configuration errors from sensor.

Link copied to clipboard
abstract suspend fun getFactoryDescriptor(updateProgress: suspend (progress: Progress) -> Unit = {}): String

Get hardware description about version and type of sensor.

Link copied to clipboard
abstract suspend fun getLastUpdateStatus(updateProgress: suspend (progress: Progress) -> Unit = {}): UpdateInfo

Get update statistics from sensor.

Link copied to clipboard
abstract suspend fun getLedConfiguration(updateProgress: suspend (progress: Progress) -> Unit = {}): LedConfiguration

Get led configuration from sensor.

Link copied to clipboard
abstract suspend fun getMemoryStatistics(updateProgress: suspend (progress: Progress) -> Unit = {}): MemoryStatistics

Get memory statistics from sensor.

Link copied to clipboard
abstract suspend fun getName(updateProgress: suspend (progress: Progress) -> Unit = {}): String

Command is supported by sensors 6.0 and newer. If run on older sensors then UnsupportedCommandException will be thrown.

Link copied to clipboard
abstract suspend fun getPeriod(updateProgress: suspend (progress: Progress) -> Unit = {}): MeasurementPeriod

Command for collecting measurement period from sensor.

Link copied to clipboard
abstract suspend fun getPulsesConversionRatio(updateProgress: suspend (progress: Progress) -> Unit = {}): Int

Get sensor conversion ratio for pulses channel. Command is supported only on sensors 5.0 and older. If run on newer sensors then UnsupportedCommandException will be thrown.

Link copied to clipboard
abstract suspend fun getRules(updateProgress: suspend (progress: Progress) -> Unit = {}): List<Rule>

Get all rules from sensor.

Link copied to clipboard
abstract suspend fun getRuntimeErrors(clearErrors: Boolean, updateProgress: suspend (progress: Progress) -> Unit = {}): List<RuntimeError>

Get runtime errors from sensor

Link copied to clipboard
abstract suspend fun getSelfTestData(updateProgress: suspend (progress: Progress) -> Unit = {}): SelfTestData

Get self-test data from sensor.

Link copied to clipboard
abstract suspend fun getSensorModels(updateProgress: suspend (progress: Progress) -> Unit = {}): Map<Channel, SensorModel>

Get models of sensors installed on the device.

Link copied to clipboard
abstract suspend fun getSensorPublicKey(updateProgress: suspend (progress: Progress) -> Unit = {}): ByteArray

Get sensor's public encryption key.

Link copied to clipboard
abstract suspend fun getSoftwareCompilationDate(updateProgress: suspend (progress: Progress) -> Unit = {}): String

Get sensor's software compilation date

Link copied to clipboard
abstract suspend fun getSoftwareCompilationTime(updateProgress: suspend (progress: Progress) -> Unit = {}): String

Get sensor's compilation time

Link copied to clipboard
abstract suspend fun getSoftwareVersion(updateProgress: suspend (progress: Progress) -> Unit = {}): SoftwareVersion

Get software version of a sensor

Link copied to clipboard
abstract suspend fun getTime(updateProgress: suspend (progress: Progress) -> Unit = {}): TimeInformation

Collect time information from sensor.

Link copied to clipboard
abstract suspend fun getTimeSinceEvent(event: TimeInformation.Event, updateProgress: suspend (progress: Progress) -> Unit = {}): Long

Get time since event occurred on sensor.

Link copied to clipboard
abstract suspend fun getTimeSynchronizationPeriod(updateProgress: suspend (progress: Progress) -> Unit = {}): Int

Get time synchronization period in seconds.

Link copied to clipboard
abstract suspend fun getTxPowerLevel(updateProgress: suspend (progress: Progress) -> Unit = {}): TxPowerLevel

Get Tx power level of bluetooth module installed on sensor. Command is supported by sensors 6.0 and newer. If run on older sensors then UnsupportedCommandException will be thrown.

Link copied to clipboard
abstract suspend fun pingNotification(number: Long, updateProgress: suspend (progress: Progress) -> Unit = {})

Send a ping number to a sensor. The number will be send back via sensor notification channel.

Link copied to clipboard
abstract suspend fun resetBatteryStatus(resetTimestamp: Long, updateProgress: suspend (progress: Progress) -> Unit = {})

Reset battery status on sensor.

Link copied to clipboard
abstract suspend fun restoreDefaults(updateProgress: suspend (progress: Progress) -> Unit = {})

Restore default settings on the sensor.

Link copied to clipboard
abstract suspend fun setBluetoothTurnoff(bluetoothTurnOff: BluetoothTurnOff, updateProgress: suspend (progress: Progress) -> Unit = {})

Set bluetooth turn off timeout.

Link copied to clipboard
abstract suspend fun setCalibrationData(channel: Channel, sensorModel: SensorModel, calibrationParameters: CalibrationParameters, sensorId: String, updateProgress: suspend (progress: Progress) -> Unit = {})

Set sensor's calibration data for given channel

Link copied to clipboard
abstract suspend fun setCalibrationDate(date: Long, manufacturerKey: Int, updateProgress: suspend (progress: Progress) -> Unit = {})

Set calibration date on a sensor.

Link copied to clipboard
abstract suspend fun setChannelOutput(channel: Channel, isPinStateHigh: Boolean, updateProgress: suspend (progress: Progress) -> Unit = {})

Sets the output pin for a given channel. Following sensors are supported: SensorModel.IO_CONTROL_AS_OK_ALARM

Link copied to clipboard
abstract suspend fun setLedConfiguration(ledConfiguration: LedConfiguration, updateProgress: suspend (progress: Progress) -> Unit = {})

Set led configuration on sensor.

Link copied to clipboard
abstract suspend fun setName(deviceName: String, updateProgress: suspend (progress: Progress) -> Unit = {})

Change device name

Link copied to clipboard
abstract suspend fun setPeriod(period: MeasurementPeriod, resetMemory: Boolean, updateProgress: suspend (progress: Progress) -> Unit = {})

Command for setting the measurement period of sensor. When executed on sensors 4.x and 5.x all readings are erased from memory.

Link copied to clipboard
abstract suspend fun setPulsesConversionRatio(conversionRatio: Int, updateProgress: suspend (progress: Progress) -> Unit = {})

Set sensor conversion ratio for pulses channel. Command is supported only on sensors 5.0 and older. If run on newer sensors then UnsupportedCommandException will be thrown.

Link copied to clipboard
abstract suspend fun setRule(rule: Rule, updateProgress: suspend (progress: Progress) -> Unit = {})

Set rule on sensor.

Link copied to clipboard
abstract suspend fun setTime(time: Long, updateProgress: suspend (progress: Progress) -> Unit = {})

Write time information in epoch format to sensor.

Link copied to clipboard
abstract suspend fun setTimeSynchronizationPeriod(period: Int, updateProgress: suspend (progress: Progress) -> Unit = {})

Set time synchronization period in seconds. This determines how often sensor requests time synchronization from other devices over Bluetooth.

Link copied to clipboard
abstract suspend fun setTxPowerLevel(txPowerLevel: TxPowerLevel, updateProgress: suspend (progress: Progress) -> Unit = {})

Set Tx power level of bluetooth module installed on sensor.

Link copied to clipboard
abstract suspend fun startBatchReconfiguration(updateProgress: suspend (progress: Progress) -> Unit = {})

Start batch reconfiguration of sensor.

Link copied to clipboard
abstract suspend fun startCalibration(channel: Channel, calibrationProcedure: CalibrationProcedure, updateProgress: suspend (progress: Progress) -> Unit = {}, calibrationProcedureProgress: suspend (calibrationProcedureProgress: CalibrationProcedureProgress) -> Unit = {})

Start sensor's calibration process for given channel with calibration parameters

Link copied to clipboard
abstract suspend fun toggleBinaryMode(channel: Channel, updateProgress: suspend (progress: Progress) -> Unit = {})

Toggle sensor's binary logic. If enabled sensor will work in binary mode.