Meshtastic-Android/app/src/main/java/com/geeksville/mesh/MyNodeInfo.kt

35 lines
1.1 KiB
Kotlin
Raw Normal View History

package com.geeksville.mesh
import android.os.Parcelable
import androidx.room.Entity
import androidx.room.PrimaryKey
import kotlinx.parcelize.Parcelize
/**
* Room [Entity] and [PrimaryKey] annotations and imports can be removed when only using the API.
* For details check the AIDL interface in [com.geeksville.mesh.IMeshService]
*/
// MyNodeInfo sent via special protobuf from radio
@Parcelize
@Entity(tableName = "MyNodeInfo")
data class MyNodeInfo(
@PrimaryKey(autoGenerate = false)
val myNodeNum: Int,
val hasGPS: Boolean,
val model: String?,
val firmwareVersion: String?,
val couldUpdate: Boolean, // this application contains a software load we _could_ install if you want
val shouldUpdate: Boolean, // this device has old firmware
val currentPacketId: Long,
val messageTimeoutMsec: Int,
val minAppVersion: Int,
val maxChannels: Int,
2022-08-28 07:54:47 -03:00
val hasWifi: Boolean,
val channelUtilization: Float,
val airUtilTx: Float
) : Parcelable {
2020-05-13 17:00:23 -07:00
/** A human readable description of the software/hardware version */
2021-03-03 08:14:40 +08:00
val firmwareString: String get() = "$model $firmwareVersion"
}