mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
C2: Add icsneoc2_device_force_disk_config_update
This commit is contained in:
committed by
Kyle Schwarz
parent
9d91524dc0
commit
19232def41
@@ -18,7 +18,8 @@ enum class DiskLayout : uint8_t {
|
||||
struct DiskInfo {
|
||||
bool present; // Disk is connected
|
||||
bool initialized; // Disk is initialized
|
||||
bool formatted; // Disk is formatted
|
||||
// getDiskDetails: disk is formatted | formatDisk: disk to format | forceDiskConfigUpdate: disk enabled in layout (also reported as formatted)
|
||||
bool formatted;
|
||||
|
||||
uint64_t sectors;
|
||||
uint32_t bytesPerSector;
|
||||
|
||||
@@ -47,6 +47,7 @@ typedef enum _icsneoc2_error_t {
|
||||
icsneoc2_error_close_failed, // Failed to close device
|
||||
icsneoc2_error_reconnect_failed, // Failed to reconnect to device
|
||||
icsneoc2_error_invalid_data, // Failed to get/set data due to invalid data pointer or size
|
||||
icsneoc2_error_force_disk_config_update_failed, // Failed to force a disk config update
|
||||
// NOTE: Any new values added here should be updated in icsneoc2_error_code_get
|
||||
icsneoc2_error_maxsize
|
||||
} _icsneoc2_error_t;
|
||||
@@ -846,6 +847,24 @@ icsneoc2_error_t icsneoc2_disk_details_full_format_set(const icsneoc2_disk_detai
|
||||
*/
|
||||
icsneoc2_error_t icsneoc2_device_format_disk(const icsneoc2_device_t* device, icsneoc2_disk_details_t* disk_details, icsneoc2_disk_format_progress_fn progress_callback, void* user_data);
|
||||
|
||||
/**
|
||||
* Force a disk layout/configuration change on a device without formatting.
|
||||
*
|
||||
* Unlike icsneoc2_device_format_disk(), this applies the configuration described by the
|
||||
* disk details handle (such as the disk layout) and enables the change without erasing data.
|
||||
*
|
||||
* @param[in] device The device whose disk configuration should be updated.
|
||||
* @param[in] disk_details A disk details handle describing the desired configuration.
|
||||
* Use icsneoc2_device_disk_details_get() to obtain a handle, then modify it
|
||||
* (e.g. set the layout with icsneoc2_disk_details_layout_set()).
|
||||
* In this context the per-disk ICSNEOC2_DISK_FORMAT_FLAGS_FORMATTED flag
|
||||
* selects whether that disk is enabled in the layout (no formatting occurs).
|
||||
*
|
||||
* @return icsneoc2_error_t icsneoc2_error_success if successful,
|
||||
* icsneoc2_error_force_disk_config_update_failed otherwise.
|
||||
*/
|
||||
icsneoc2_error_t icsneoc2_device_force_disk_config_update(const icsneoc2_device_t* device, icsneoc2_disk_details_t* disk_details);
|
||||
|
||||
/**
|
||||
* Get the list of networks this device supports for receiving.
|
||||
*
|
||||
|
||||
@@ -413,7 +413,7 @@ typedef uint8_t icsneoc2_disk_layout_t;
|
||||
|
||||
#define ICSNEOC2_DISK_FORMAT_FLAGS_PRESENT 0x1 // Indicates that the disk is present
|
||||
#define ICSNEOC2_DISK_FORMAT_FLAGS_INITIALIZED 0x2 // Indicates that the disk is initialized
|
||||
#define ICSNEOC2_DISK_FORMAT_FLAGS_FORMATTED 0x4 // Indicates that the disk is already formatted
|
||||
#define ICSNEOC2_DISK_FORMAT_FLAGS_FORMATTED 0x4 // disk_details_get: disk is formatted | format_disk: disk to format | force_disk_config_update: disk enabled in layout (also reported as formatted)
|
||||
|
||||
typedef uint32_t icsneoc2_disk_format_flags_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user