chore(core): improve unit_properties module comments
What changed, and why it matters
This commit only rewrites code comments in a header file to use a more formal documentation style. No actual program logic, function behavior, or security checks were changed. It is not a security fix and does not introduce any security issue.
No action needed. This is a non-functional documentation-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a pure documentation refactor in core/embed/util/unit_properties/inc/util/unit_properties.h. It converts inline // comments to Doxygen-style /* / blocks and adds parameter/return descriptions for existing functions. A function declaration unit_properties_get_sn() already present in the file is now documented, but no implementation or interface change is visible. No code semantics changed.
Changed components
core/embed/util/unit_properties/inc/util/unit_properties.hInspect captured patch +62 / −18
diff --git a/core/embed/util/unit_properties/inc/util/unit_properties.h b/core/embed/util/unit_properties/inc/util/unit_properties.h
index 47f1f2c58..853aeae64 100644
--- a/core/embed/util/unit_properties/inc/util/unit_properties.h
+++ b/core/embed/util/unit_properties/inc/util/unit_properties.h
@@ -25,47 +25,91 @@
#ifdef SECURE_MODE
-// Initializes module a detects the unit properties
-//
-// Returns `true` if the properties are successfully detected
+/**
+ * @brief Initializes module and detects the unit properties
+ *
+ * @return true if the properties are successfully detected
+ * @return false otherwise
+ */
bool unit_properties_init(void);
#endif // SECURE_MODE
typedef struct {
- // Set to true if the unit properties are locked and cannot be changed
- // (the device is in the production mode)
+ /**
+ * Production lock status indicator.
+ * When set to true, the unit properties are locked and cannot be modified.
+ * This indicates the device is in production mode and configuration is
+ * finalized.
+ */
bool locked;
- // Unit color. The value is opaque to the firmware and is
- // used only by Trezor Suite.
+ /**
+ * Unit color identifier.
+ * This field contains a hardware-specific color code that is opaque to the
+ * firmware. The value is interpreted and displayed by Trezor Suite for user
+ * identification purposes.
+ */
uint8_t color;
- // Set if `color` field contains a valid value
+ /** Validity flag for the color field - set to true when color contains a
+ * valid value */
bool color_is_valid;
- // Unit packaging. The value is opaque for the firmware and is
- // used only by Trezor Suite.
+ /**
+ * Unit packaging type identifier.
+ * This field contains a packaging-specific code that is opaque to the
+ * firmware. The value is used by Trezor Suite to determine the device's
+ * packaging variant.
+ */
uint8_t packaging;
- // Set if `packaging` field contains a valid value
+ /** Validity flag for the packaging field - set to true when packaging
+ * contains a valid value */
bool packaging_is_valid;
- // Set to true if the unit is BTC only
+ /**
+ * Bitcoin-only firmware restriction flag.
+ * When set to true, indicates this unit is configured to run Bitcoin-only
+ * firmware, restricting functionality to Bitcoin-related operations only.
+ */
bool btconly;
- // Set if `btconly` field contains a valid value
+ /** Validity flag for the btconly field - set to true when btconly contains a
+ * valid value */
bool btconly_is_valid;
- // Set to true if the SD card hotswap is enabled
+ /**
+ * SD card hotswap capability flag.
+ * When set to true, indicates the unit supports hot-swapping of SD cards
+ * without requiring a system restart or power cycle.
+ */
bool sd_hotswap_enabled;
} unit_properties_t;
-// Gets a copy of unit properties structure
-//
-// Properties are detected just once during the initialization.
+/**
+ * @brief Gets a copy of unit properties structure
+ *
+ * Properties are detected just once during the initialization.
+ *
+ * @param props Pointer to the structure to fill with unit properties
+ */
void unit_properties_get(unit_properties_t* props);
-// Gets a pointer to the static unit properties structure
+/**
+ * @brief Gets a pointer to the static unit properties structure
+ *
+ * @return const unit_properties_t* Pointer to the static unit properties
+ * structure
+ */
const unit_properties_t* unit_properties(void);
+/**
+ * @brief Gets the device serial number
+ *
+ * @param device_sn Buffer to store the device serial number
+ * @param max_device_sn_size Maximum size of the device_sn buffer
+ * @param device_sn_size Pointer to store the actual size of the serial number
+ * @return true if the serial number was successfully retrieved
+ * @return false otherwise
+ */
bool unit_properties_get_sn(uint8_t* device_sn, size_t max_device_sn_size,
size_t* device_sn_size);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.