safeNumber
fun ERROR CLASS: Symbol not found for HardwareModel.safeNumber(fallbackValue: Int = -1): Int(source)
Safely extracts the hardware model number from a HardwareModel enum.
This function handles unknown enum values gracefully by catching IllegalArgumentException and returning a fallback value. This prevents crashes when the app receives data from devices with hardware models not yet defined in the current protobuf version.
Return
The hardware model number, or the fallback value if the enum is unknown
Parameters
fallbackValue
The value to return if the enum is unknown (defaults to 0 for UNSET)