mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat(wifi): introduce BLE-based WiFi provisioning for nymea-compatible devices (#4968)
Some checks are pending
Dependency Submission / dependency-submission (push) Waiting to run
Main CI (Verify & Build) / validate-and-build (push) Waiting to run
Main Push Changelog / Generate main push changelog (push) Waiting to run
Some checks are pending
Dependency Submission / dependency-submission (push) Waiting to run
Main CI (Verify & Build) / validate-and-build (push) Waiting to run
Main Push Changelog / Generate main push changelog (push) Waiting to run
This commit is contained in:
parent
1fee6c4431
commit
7e041c00e1
38 changed files with 3326 additions and 50 deletions
|
|
@ -35,7 +35,8 @@ import org.meshtastic.core.common.util.CommonUri
|
|||
* - `/messages/{contactKey}` -> Specific conversation
|
||||
* - `/settings` -> Settings root
|
||||
* - `/settings/{destNum}/{page}` -> Specific settings page for a node
|
||||
* - `/share?message={text}` -> Share message screen
|
||||
* - `/wifi-provision` -> WiFi provisioning screen
|
||||
* - `/wifi-provision?address={mac}` -> WiFi provisioning targeting a specific device MAC address
|
||||
*/
|
||||
object DeepLinkRouter {
|
||||
/**
|
||||
|
|
@ -64,6 +65,7 @@ object DeepLinkRouter {
|
|||
"settings" -> routeSettings(pathSegments)
|
||||
"channels" -> listOf(ChannelsRoutes.ChannelsGraph)
|
||||
"firmware" -> routeFirmware(pathSegments)
|
||||
"wifi-provision" -> routeWifiProvision(uri)
|
||||
else -> {
|
||||
Logger.w { "Unrecognized deep link segment: $firstSegment" }
|
||||
null
|
||||
|
|
@ -151,6 +153,11 @@ object DeepLinkRouter {
|
|||
}
|
||||
}
|
||||
|
||||
private fun routeWifiProvision(uri: CommonUri): List<NavKey> {
|
||||
val address = uri.getQueryParameter("address")
|
||||
return listOf(WifiProvisionRoutes.WifiProvision(address))
|
||||
}
|
||||
|
||||
private fun routeFirmware(segments: List<String>): List<NavKey> {
|
||||
val update = if (segments.size > 1) segments[1].lowercase() == "update" else false
|
||||
return if (update) {
|
||||
|
|
|
|||
|
|
@ -176,3 +176,9 @@ object FirmwareRoutes {
|
|||
|
||||
@Serializable data object FirmwareUpdate : Route
|
||||
}
|
||||
|
||||
object WifiProvisionRoutes {
|
||||
@Serializable data object WifiProvisionGraph : Graph
|
||||
|
||||
@Serializable data class WifiProvision(val address: String? = null) : Route
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue