DeviceLinkRepository

Provides msh.to device links resolved by the Meshtastic API (/resource/deviceLinks) and cached locally. Vendor and region-filtered marketplace links are shown on the device hardware detail view, plus a full directory.

Functions

Link copied to clipboard
abstract suspend fun ensureImported()

Seeds the link table from the bundled snapshot if it is empty (fresh install, data clear, radio switch).

Link copied to clipboard
abstract suspend fun getLinksForTarget(platformioTarget: String, regionCode: String = currentRegionCode()): List<DeviceLink>

Links attached to a device's platformioTarget, region-filtered and sorted with vendor links first. Returns an empty list when no links match.

Link copied to clipboard
abstract fun observeAllLinks(): Flow<List<DeviceLink>>

All cached links, sorted by short code — backs the Settings "Device Links" directory.

Link copied to clipboard
abstract suspend fun reconcile()

Refreshes links from the API: upserts the resolved catalog and prunes short codes that no longer exist.