getDeviceHardwareByModel

open suspend override fun getDeviceHardwareByModel(hwModel: Int, target: String?, forceRefresh: Boolean): ERROR CLASS: Symbol not found for Result<ERROR CLASS: Symbol not found for DeviceHardware?>(source)

Retrieves device hardware information by its model ID and optional target string.

This function implements a cache-aside pattern with a fallback mechanism:

  1. Check for a valid, non-expired local cache entry.

  2. If not found or expired, fetch fresh data from the remote API.

  3. If the remote fetch fails, attempt to use stale data from the cache.

  4. If the cache is empty, fall back to loading data from a bundled JSON asset.

Return

A Result containing the DeviceHardware on success (or null if not found), or an exception on failure.

Parameters

hwModel

The hardware model identifier.

target

Optional PlatformIO target environment name to disambiguate multiple variants.

forceRefresh

If true, the local cache will be invalidated and data will be fetched remotely.