Top |
gboolean udisks_ata_send_command_sync (gint fd
,gint timeout_msec
,UDisksAtaCommandProtocol protocol
,UDisksAtaCommandInput *input
,UDisksAtaCommandOutput *output
,GError **error
);
Sends a command to an ATA device. Blocks the calling thread while the command is pending.
fd |
A file descriptor for a ATA device. |
|
timeout_msec |
Timeout in milli-seconds for the command. Use -1 for the default (5 seconds) timeout and |
|
protocol |
The direction of the command. |
|
input |
The input for the command. |
|
output |
The output for the command. |
|
error |
Return location for error or |
gboolean udisks_ata_get_pm_state (const gchar *device
,GError **error
,guchar *pm_state
);
Get the current power mode state.
The format of pm_state
is the result obtained from sending the
ATA command CHECK POWER MODE
to the drive.
Known values include:
0x00
: Device is in PM2: Standby state.
0x40
: Device is in the PM0: Active state, the NV Cache power mode is enabled, and the spindle is spun down or spinning down.
0x41
: Device is in the PM0: Active state, the NV Cache power mode is enabled, and the spindle is spun up or spinning up.
0x80
: Device is in PM1: Idle state.
0xff
: Device is in the PM0: Active state or PM1: Idle State.
Typically user interfaces will report "Drive is spun down" if pm_state
is
0x00 and "Drive is spun up" otherwise.
#define UDISKS_ATA_PM_STATE_AWAKE(pm_state) (pm_state >= 0x41)
Decodes the power state value as returned by udisks_ata_get_pm_state.
typedef struct { guint8 command; guint8 feature; guint8 count; guint8 device; guint32 lba; gsize buffer_size; guchar *buffer; } UDisksAtaCommandInput;
Struct used for input data when sending ATA commands.