BSB Developer Docs
Loading...
Searching...
No Matches
furi_hal_version.h File Reference

Version HAL API. More...

#include <stdbool.h>
#include <stdint.h>
#include <version/version.h>
#include <furi.h>
#include <furi_hal_flash_otp.h>

Go to the source code of this file.

Macros

#define FURI_HAL_VERSION_NAME_LENGTH   (8)
 
#define FURI_HAL_VERSION_ARRAY_NAME_LENGTH   (FURI_HAL_VERSION_NAME_LENGTH + 1)
 
#define FURI_HAL_VERSION_MAC_LENGTH   (6)
 

Enumerations

enum  FuriHalVersionColor { FuriHalVersionColorUnknown = 0x00 , FuriHalVersionColorWhite = 0x01 }
 Device Colors (from OTP2 hw_color, matches HWColor in bsbotp.py)
 
enum  FuriHalVersionKeyCurve { FuriHalVersionKeyCurveNone = 0x00 , FuriHalVersionKeyCurveSecp224r1 = 0x01 }
 

Functions

void furi_hal_version_init (void)
 Init flipper version.
 
bool furi_hal_version_check_target_match (void)
 Check target firmware version.
 
const char * furi_hal_version_get_model_name (void)
 Get model name.
 
const char * furi_hal_version_get_model_code (void)
 Get model name.
 
const char * furi_hal_version_get_fcc_id (void)
 Get FCC ID.
 
const char * furi_hal_version_get_ic_id (void)
 Get IC id.
 
const char * furi_hal_version_get_mic_id (void)
 Get MIC id.
 
const char * furi_hal_version_get_srrc_id (void)
 Get SRRC id.
 
const char * furi_hal_version_get_ncc_id (void)
 Get NCC id.
 
uint8_t furi_hal_version_get_hw_version (void)
 Get hardware version.
 
uint8_t furi_hal_version_get_hw_target (void)
 Get hardware target (with fallback to firmware version if OTP not provisioned)
 
uint8_t furi_hal_version_get_hw_target_otp (void)
 Get hardware target from OTP (raw value, 0 if not provisioned)
 
uint8_t furi_hal_version_get_hw_body (void)
 Get hardware body.
 
FuriHalVersionColor furi_hal_version_get_hw_color (void)
 Get hardware body color.
 
uint8_t furi_hal_version_get_hw_connect (void)
 Get hardware connect.
 
const char * furi_hal_version_get_hw_version_code (void)
 Get full hardware version code.
 
uint8_t furi_hal_version_get_hw_region (void)
 Get hardware region (raw value from OTP2)
 
uint32_t furi_hal_version_get_hw_timestamp (void)
 Get hardware timestamp.
 
uint32_t furi_hal_version_get_hw_timestamp_qc (void)
 Get QC timestamp from OTP2.
 
const char * furi_hal_version_get_name_ptr (void)
 Get pointer to target name.
 
const uint8_t * furi_hal_version_get_usb_mac (void)
 Get USB MAC address.
 
size_t furi_hal_version_uid_size (void)
 Get platform UID size in bytes.
 
const uint8_t * furi_hal_version_uid (void)
 Get const pointer to UID.
 
bool furi_hal_version_is_otp_valid (FuriHalFlashOtpBlock block)
 Check if an OTP block is valid (has magic and is programmed)
 
FuriHalVersionKeyCurve furi_hal_version_get_sign_curve (void)
 Get EC curve identifier from OTP3.
 
const uint8_t * furi_hal_version_get_sign_pubkey (void)
 Get public key from OTP3.
 
size_t furi_hal_version_get_sign_pubkey_size (void)
 Get public key size.
 
const uint8_t * furi_hal_version_get_otp_mcu_uid (void)
 Get stored MCU UID from OTP4 (for binding verification)
 
const uint8_t * furi_hal_version_get_otp1_signature (void)
 Get OTP1 signature from OTP4.
 
const uint8_t * furi_hal_version_get_otp2_signature (void)
 Get OTP2 signature from OTP4.
 
size_t furi_hal_version_get_signature_size (void)
 Get signature size.
 

Detailed Description

Version HAL API.

Function Documentation

◆ furi_hal_version_check_target_match()

bool furi_hal_version_check_target_match ( void )

Check target firmware version.

Returns
true if target and real matches

◆ furi_hal_version_get_fcc_id()

const char * furi_hal_version_get_fcc_id ( void )

Get FCC ID.

Returns
FCC id as C-string

◆ furi_hal_version_get_hw_body()

uint8_t furi_hal_version_get_hw_body ( void )

Get hardware body.

Returns
Hardware Body

◆ furi_hal_version_get_hw_color()

FuriHalVersionColor furi_hal_version_get_hw_color ( void )

Get hardware body color.

Returns
Hardware Color

◆ furi_hal_version_get_hw_connect()

uint8_t furi_hal_version_get_hw_connect ( void )

Get hardware connect.

Returns
Hardware Interconnect

◆ furi_hal_version_get_hw_region()

uint8_t furi_hal_version_get_hw_region ( void )

Get hardware region (raw value from OTP2)

Returns
Hardware Region value

◆ furi_hal_version_get_hw_target()

uint8_t furi_hal_version_get_hw_target ( void )

Get hardware target (with fallback to firmware version if OTP not provisioned)

Returns
Hardware Target

◆ furi_hal_version_get_hw_target_otp()

uint8_t furi_hal_version_get_hw_target_otp ( void )

Get hardware target from OTP (raw value, 0 if not provisioned)

Returns
Hardware Target from OTP, or 0 if OTP1 not provisioned

◆ furi_hal_version_get_hw_timestamp()

uint32_t furi_hal_version_get_hw_timestamp ( void )

Get hardware timestamp.

Returns
Hardware Manufacture timestamp

◆ furi_hal_version_get_hw_timestamp_qc()

uint32_t furi_hal_version_get_hw_timestamp_qc ( void )

Get QC timestamp from OTP2.

Returns
QC timestamp, or 0 if not provisioned

◆ furi_hal_version_get_hw_version()

uint8_t furi_hal_version_get_hw_version ( void )

Get hardware version.

Returns
Hardware Version

◆ furi_hal_version_get_hw_version_code()

const char * furi_hal_version_get_hw_version_code ( void )

Get full hardware version code.

Returns
Version code (like "4.F22.B7.C2"). Value is "Unknown" if OTP1 not provisioned.

◆ furi_hal_version_get_ic_id()

const char * furi_hal_version_get_ic_id ( void )

Get IC id.

Returns
IC id as C-string

◆ furi_hal_version_get_mic_id()

const char * furi_hal_version_get_mic_id ( void )

Get MIC id.

Returns
MIC id as C-string

◆ furi_hal_version_get_model_code()

const char * furi_hal_version_get_model_code ( void )

Get model name.

Returns
model code C-string

◆ furi_hal_version_get_model_name()

const char * furi_hal_version_get_model_name ( void )

Get model name.

Returns
model name C-string

◆ furi_hal_version_get_name_ptr()

const char * furi_hal_version_get_name_ptr ( void )

Get pointer to target name.

Returns
Hardware Name C-string

◆ furi_hal_version_get_ncc_id()

const char * furi_hal_version_get_ncc_id ( void )

Get NCC id.

Returns
NCC id as C-string

◆ furi_hal_version_get_otp1_signature()

const uint8_t * furi_hal_version_get_otp1_signature ( void )

Get OTP1 signature from OTP4.

Returns
Pointer to 56-byte signature, or NULL if not provisioned

◆ furi_hal_version_get_otp2_signature()

const uint8_t * furi_hal_version_get_otp2_signature ( void )

Get OTP2 signature from OTP4.

Returns
Pointer to 56-byte signature, or NULL if not provisioned

◆ furi_hal_version_get_otp_mcu_uid()

const uint8_t * furi_hal_version_get_otp_mcu_uid ( void )

Get stored MCU UID from OTP4 (for binding verification)

Returns
Pointer to 12-byte MCU UID, or NULL if not provisioned

◆ furi_hal_version_get_sign_curve()

FuriHalVersionKeyCurve furi_hal_version_get_sign_curve ( void )

Get EC curve identifier from OTP3.

Returns
Curve ID

◆ furi_hal_version_get_sign_pubkey()

const uint8_t * furi_hal_version_get_sign_pubkey ( void )

Get public key from OTP3.

Returns
Pointer to 56-byte public key (X || Y), or NULL if not provisioned

◆ furi_hal_version_get_sign_pubkey_size()

size_t furi_hal_version_get_sign_pubkey_size ( void )

Get public key size.

Returns
Public key size in bytes (56)

◆ furi_hal_version_get_signature_size()

size_t furi_hal_version_get_signature_size ( void )

Get signature size.

Returns
Signature size in bytes (56)

◆ furi_hal_version_get_srrc_id()

const char * furi_hal_version_get_srrc_id ( void )

Get SRRC id.

Returns
SRRC id as C-string

◆ furi_hal_version_get_usb_mac()

const uint8_t * furi_hal_version_get_usb_mac ( void )

Get USB MAC address.

Returns
pointer to USB MAC address array (length of FURI_HAL_VERSION_MAC_LENGTH)

◆ furi_hal_version_is_otp_valid()

bool furi_hal_version_is_otp_valid ( FuriHalFlashOtpBlock block)

Check if an OTP block is valid (has magic and is programmed)

Parameters
blockOTP block identifier
Returns
true if the specified OTP block is valid

◆ furi_hal_version_uid()

const uint8_t * furi_hal_version_uid ( void )

Get const pointer to UID.

Returns
pointer to UID

◆ furi_hal_version_uid_size()

size_t furi_hal_version_uid_size ( void )

Get platform UID size in bytes.

Returns
UID size in bytes