RequestNakWatcher

class RequestNakWatcher(radioController: RadioController, serviceRepository: ServiceRepository, serviceScope: ServiceScope, snackbarManager: SnackbarManager, resolveUiText: suspend (UiText) -> String = { it.resolve() })(source)

Shows a snackbar when a routing NAK answers a node request, which otherwise just never gets its reply.

Constructors

Link copied to clipboard
constructor(radioController: RadioController, serviceRepository: ServiceRepository, serviceScope: ServiceScope, snackbarManager: SnackbarManager, resolveUiText: suspend (UiText) -> String = { it.resolve() })

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun watch(request: StringResource, longName: String, onNak: (requestId: Int, routingError: Int) -> Unit = { _, _ -> }, send: suspend (requestId: Int) -> Unit)

Runs send with a fresh packet id, watching for a NAK to that id from before the send until WINDOW after. onNak gets the request id and routing error before the snackbar shows.