FireBirdLib - Topfield TMS PVR TAP Programming Library
HDD_Smart_ReturnStatus.c
Go to the documentation of this file.
1#include "FBLib_hdd.h"
2#include "libFireBird.h"
3
5{
7
8 unsigned char CommandBlock[FBHDIO_DRIVE_TASK_HDR_SIZE] = {WIN_SMART, //COMMAND
9 SMART_STATUS, //FEATURE
10 0x00, //NSECTOR
11 0, //SECTOR
12 0x4f, //LCYL
13 0xc2, //HCYL
14 0, //SELECT
15 0}; //COMMAND
16
17 if(SendHDDCommand(HDIO_DRIVE_TASK, CommandBlock, 0))
18 {
19 TRACEEXIT();
20 return 19;
21 }
22
23 if((CommandBlock[4] == 0x4f) && (CommandBlock[5] == 0xc2))
24 {
25 TRACEEXIT();
26 return 0;
27 }
28
29 if((CommandBlock[4] == 0xf4) && (CommandBlock[5] == 0x2c))
30 {
31 TRACEEXIT();
32 return 20;
33 }
34
35 TRACEEXIT();
36 return 19;
37}
int SendHDDCommand(dword, const byte *, int)
Definition: SendHDDCommand.c:4
#define WIN_SMART
Definition: FBLib_hdd.h:39
#define HDIO_DRIVE_TASK
Definition: FBLib_hdd.h:51
#define SMART_STATUS
Definition: FBLib_hdd.h:42
#define FBHDIO_DRIVE_TASK_HDR_SIZE
Definition: FBLib_hdd.h:38
int HDD_Smart_ReturnStatus(void)
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243