sforkowany z mirror/meshtastic-android
Merge branch 'meshtastic:master' into feature/osmand-migration
commit
88da9f1c69
|
@ -17,6 +17,7 @@ data class MyNodeInfo(
|
||||||
val messageTimeoutMsec: Int,
|
val messageTimeoutMsec: Int,
|
||||||
val minAppVersion: Int,
|
val minAppVersion: Int,
|
||||||
val maxChannels: Int,
|
val maxChannels: Int,
|
||||||
|
val hasWifi: Boolean,
|
||||||
val channelUtilization: Float,
|
val channelUtilization: Float,
|
||||||
val airUtilTx: Float
|
val airUtilTx: Float
|
||||||
) : Parcelable {
|
) : Parcelable {
|
||||||
|
@ -34,6 +35,7 @@ data class MyNodeInfo(
|
||||||
parcel.readInt(),
|
parcel.readInt(),
|
||||||
parcel.readInt(),
|
parcel.readInt(),
|
||||||
parcel.readInt(),
|
parcel.readInt(),
|
||||||
|
parcel.readByte() != 0.toByte(),
|
||||||
parcel.readFloat(),
|
parcel.readFloat(),
|
||||||
parcel.readFloat()
|
parcel.readFloat()
|
||||||
)
|
)
|
||||||
|
@ -49,6 +51,7 @@ data class MyNodeInfo(
|
||||||
parcel.writeInt(messageTimeoutMsec)
|
parcel.writeInt(messageTimeoutMsec)
|
||||||
parcel.writeInt(minAppVersion)
|
parcel.writeInt(minAppVersion)
|
||||||
parcel.writeInt(maxChannels)
|
parcel.writeInt(maxChannels)
|
||||||
|
parcel.writeByte(if (hasWifi) 1 else 0)
|
||||||
parcel.writeFloat(channelUtilization)
|
parcel.writeFloat(channelUtilization)
|
||||||
parcel.writeFloat(airUtilTx)
|
parcel.writeFloat(airUtilTx)
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,12 +223,8 @@ class UIViewModel @Inject constructor(
|
||||||
private val defaultPositionBroadcastSecs = if (isRouter) 12 * 60 * 60 else 15 * 60
|
private val defaultPositionBroadcastSecs = if (isRouter) 12 * 60 * 60 else 15 * 60
|
||||||
private val defaultLsSecs = if (isRouter) 24 * 60 * 60 else 5 * 60
|
private val defaultLsSecs = if (isRouter) 24 * 60 * 60 else 5 * 60
|
||||||
|
|
||||||
// val isESP32: Boolean = _localConfig.value?.hasWifi() == true (not working)
|
// We consider hasWifi = ESP32
|
||||||
fun isESP32(): Boolean {
|
fun isESP32() = myNodeInfo.value?.hasWifi == true
|
||||||
// mesh.proto 'HardwareModel' enums for ESP32 devices
|
|
||||||
val hwModelESP32 = listOf(1, 2, 3, 4, 5, 6, 8, 10, 11, 32, 35, 39, 40, 41, 43, 44)
|
|
||||||
return hwModelESP32.contains(nodeDB.ourNodeInfo?.user?.hwModel?.number)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun hasAXP(): Boolean {
|
fun hasAXP(): Boolean {
|
||||||
val hasAXP = listOf(4, 7, 9) // mesh.proto 'HardwareModel' enums with AXP192 chip
|
val hasAXP = listOf(4, 7, 9) // mesh.proto 'HardwareModel' enums with AXP192 chip
|
||||||
|
|
|
@ -1230,6 +1230,7 @@ class MeshService : Service(), Logging {
|
||||||
if (messageTimeoutMsec == 0) 5 * 60 * 1000 else messageTimeoutMsec, // constants from current device code
|
if (messageTimeoutMsec == 0) 5 * 60 * 1000 else messageTimeoutMsec, // constants from current device code
|
||||||
minAppVersion,
|
minAppVersion,
|
||||||
maxChannels,
|
maxChannels,
|
||||||
|
hasWifi,
|
||||||
channelUtilization,
|
channelUtilization,
|
||||||
airUtilTx
|
airUtilTx
|
||||||
)
|
)
|
||||||
|
|
Ładowanie…
Reference in New Issue