SensorCommands

interface SensorCommands

Functions

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.

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

Enter sensor bootloader. If bootloader entry code is incorrect sensor will reboot. Run Connection.disconnect afterwards to start the procedure.

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

Troubleshooting mode lasts 5 minutes (if not previously exited by the exitTroubleshootingMode), then exits automatically but does not disconnect. The troubleshooting data can be collected via SensorNotification.TroubleshootingMode notifications. During troubleshooting mode, the sensor will not take any measurements.

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

This command exits the troubleshooting mode.

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 getCellularNetworkStatus(updateProgress: suspend (progress: Progress) -> Unit = {}): CellularNetworkStatus

Get cellular network status.

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

Get device configuration

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

Get device information

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

Get device extended configuration

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

Get hardware version of a sensor

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

Get modem control (is cellular modem enabled/disabled/not available)

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

This command returns the current state of modem logs.

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 getSoftwareVersion(updateProgress: suspend (progress: Progress) -> Unit = {}): SoftwareVersion

Get software version of a sensor

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

Collect time information from sensor.

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 resetTamperAlert(updateProgress: suspend (progress: Progress) -> Unit = {})

Reset tamper alert triggered by opening the sensor's enclosure.

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 setCalibrationDate(date: Long, manufacturerKey: Int, updateProgress: suspend (progress: Progress) -> Unit = {})

Set calibration date on a sensor.

Link copied to clipboard
abstract suspend fun setConfiguration(configuration: SensorConfiguration, updateProgress: suspend (progress: Progress) -> Unit = {})

Set device configuration

Link copied to clipboard
abstract suspend fun setExtendedConfiguration(configuration: SensorExtendedConfiguration, updateProgress: suspend (progress: Progress) -> Unit = {})

Set device extended configuration

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

Enable/disable cellular modem. When disabled, the device will work as a regular Bluetooth sensor. Run Connection.disconnect afterwards to start the procedure.

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

This command controls the modem logs state.

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

Set time on a sensor.

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

Shut down the sensor. Run Connection.disconnect afterwards to start the procedure.

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 triggerCommunicationWithServer(updateProgress: suspend (progress: Progress) -> Unit = {})

Initiate communication with the server