mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat(wire): migrate from protobuf -> wire (#4401)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
9dbc8b7fbf
commit
25657e8f8f
239 changed files with 7149 additions and 6144 deletions
|
|
@ -18,8 +18,8 @@ package org.meshtastic.core.service
|
|||
|
||||
import android.app.Notification
|
||||
import org.meshtastic.core.database.entity.NodeEntity
|
||||
import org.meshtastic.proto.MeshProtos
|
||||
import org.meshtastic.proto.TelemetryProtos
|
||||
import org.meshtastic.proto.ClientNotification
|
||||
import org.meshtastic.proto.Telemetry
|
||||
|
||||
const val SERVICE_NOTIFY_ID = 101
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ interface MeshServiceNotifications {
|
|||
|
||||
fun initChannels()
|
||||
|
||||
fun updateServiceStateNotification(summaryString: String?, telemetry: TelemetryProtos.Telemetry?): Notification
|
||||
fun updateServiceStateNotification(summaryString: String?, telemetry: Telemetry?): Notification
|
||||
|
||||
suspend fun updateMessageNotification(
|
||||
contactKey: String,
|
||||
|
|
@ -63,11 +63,11 @@ interface MeshServiceNotifications {
|
|||
|
||||
fun showOrUpdateLowBatteryNotification(node: NodeEntity, isRemote: Boolean)
|
||||
|
||||
fun showClientNotification(clientNotification: MeshProtos.ClientNotification)
|
||||
fun showClientNotification(clientNotification: ClientNotification)
|
||||
|
||||
fun cancelMessageNotification(contactKey: String)
|
||||
|
||||
fun cancelLowBatteryNotification(node: NodeEntity)
|
||||
|
||||
fun clearClientNotification(notification: MeshProtos.ClientNotification)
|
||||
fun clearClientNotification(notification: ClientNotification)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
package org.meshtastic.core.service
|
||||
|
||||
import org.meshtastic.core.database.model.Node
|
||||
import org.meshtastic.proto.AdminProtos
|
||||
import org.meshtastic.proto.SharedContact
|
||||
|
||||
sealed class ServiceAction {
|
||||
data class GetDeviceMetadata(val destNum: Int) : ServiceAction()
|
||||
|
|
@ -30,7 +30,7 @@ sealed class ServiceAction {
|
|||
|
||||
data class Reaction(val emoji: String, val replyId: Int, val contactKey: String) : ServiceAction()
|
||||
|
||||
data class ImportContact(val contact: AdminProtos.SharedContact) : ServiceAction()
|
||||
data class ImportContact(val contact: SharedContact) : ServiceAction()
|
||||
|
||||
data class SendContact(val contact: AdminProtos.SharedContact) : ServiceAction()
|
||||
data class SendContact(val contact: SharedContact) : ServiceAction()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ import kotlinx.coroutines.flow.SharedFlow
|
|||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.receiveAsFlow
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
import org.meshtastic.proto.MeshProtos
|
||||
import org.meshtastic.proto.MeshProtos.MeshPacket
|
||||
import org.meshtastic.proto.ClientNotification
|
||||
import org.meshtastic.proto.MeshPacket
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
|
@ -83,11 +83,11 @@ class ServiceRepository @Inject constructor() {
|
|||
_connectionState.value = connectionState
|
||||
}
|
||||
|
||||
private val _clientNotification = MutableStateFlow<MeshProtos.ClientNotification?>(null)
|
||||
val clientNotification: StateFlow<MeshProtos.ClientNotification?>
|
||||
private val _clientNotification = MutableStateFlow<ClientNotification?>(null)
|
||||
val clientNotification: StateFlow<ClientNotification?>
|
||||
get() = _clientNotification
|
||||
|
||||
fun setClientNotification(notification: MeshProtos.ClientNotification?) {
|
||||
fun setClientNotification(notification: ClientNotification?) {
|
||||
Logger.e { notification?.message.orEmpty() }
|
||||
|
||||
_clientNotification.value = notification
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue