Thanks LuXxn,
I already succeed as your guide, but i only succeed to execute Short Selft-test and Extended Selft-test. Even my Hard-disk also supports to test SMART Conveyance self-test routine immediately in off-line mode (value = 03h). But it always return code is 1 'Captive Mode Required'. Do you know how to execute this test ?
I followed ATA/ATAPI Comment Set ACS-3 specification [Table 127, http://www.t13.org/Documents/UploadedDocuments/docs2013/d2161r5-ATAATAPI_Command_Set_-_3.pdf] to know exactly input parameters to excute SMART Selft-test
inParams["Subcommand"] = ?value;
/* *********************************************************************
* Table 127 — SMART EXECUTE OFF-LINE IMMEDIATE Subcommands/Draft ATA/ATAPI Comment Set ACS-3
* http://www.t13.org/Documents/UploadedDocuments/docs2013/d2161r5-ATAATAPI_Command_Set_-_3.pdf
* Value Description of subcommand to be processed
* 00h Execute SMART off-line routine immediately in off-line mode
* 01h Execute SMART Short self-test routine immediately in off-line mode
* 02h Execute SMART Extended self-test routine immediately in off-line mode
* 03h Execute SMART Conveyance self-test routine immediately in off-line mode
* 04h Execute SMART Selective self-test routine immediately in off-line mode
* 05h-3Fh Reserved
* 40h-7Eh Vendor specific
* 7Fh Abort off-line mode self-test routine
* 80h Reserved
* 81h Execute SMART Short self-test routine immediately in captive mode
* 82h Execute SMART Extended self-test routine immediately in captive mode
* 83h Execute SMART Conveyance self-test routine immediately in captive mode
* 84h Execute SMART Selective self-test routine immediately in captive mode
* 85h-8Fh Reserved
* 90h-FFh Vendor specific
* ********************************************************************/
To know my hard-disk can support execute SMART conveyance selftest in offline mode, I sent S.M.A.R.T command to get the value of OfflineCollectCapability, then return value is 0x73 and followed ATA/ATAPI Comment Set ACS-3 specification [Table 133, http://www.t13.org/Documents/UploadedDocuments/docs2013/d2161r5-ATAATAPI_Command_Set_-_3.pdf]
/**********************************************************************
* Table 133 — Offline Data Collection Capabilities
* Bit Description
* 7 Reserved
* 6 SELECTIVE SELF-TEST IMPLEMENTED bit – If this bit is cleared to zero, the device does not implement the
* Selective self-test routine. If this bit is set to one, the device implements the Selective self-test routine.
* 5 CONVEYANCE SELF-TEST IMPLEMENTED bit – If this bit is cleared to zero, the device does not implement the
* Conveyance self-test routines. If this bit is set to one, the device implements the Conveyance self-test
* routines.
* 4 SELF-TEST IMPLEMENTED bit – If this bit is cleared to zero, the device does not implement the Short and
* Extended self-test routines. If this bit is set to one, the device implements the Short and Extended
* self-test routines.
* 3 OFF-LINE READ SCANNING IMPLEMENTED bit – If this bit is cleared to zero, the device does not support
* off-line read scanning. If this bit is set to one, the device supports off-line read scanning.
* 2 ABORT/RESTART OFF-LINE BY HOST bit – If this bit is set to one, then the device shall abort all off-line data
* collection activity initiated by a SMART EXECUTE OFF-LINE IMMEDIATE command upon receipt of a
* new command within 2 seconds of receiving the new command. If this bit is cleared to zero, the device
* shall suspend off-line data collection activity after an interrupting command and resume off-line data
* collection activity after some vendor-specified event.
* 1 Vendor specific.
* 0 EXECUTE OFF-LINE IMMEDIATE IMPLEMENTED bit – If this bit is set to one, then the SMART EXECUTE
* OFF-LINE IMMEDIATE command is implemented by this device. If this bit is cleared to zero, then the
* SMART EXECUTE OFF-LINE IMMEDIATE command is not implemented by this device.
* *******************************************************************/
Thanks for your help,
Bamboo