HOW TO RUN PROGRAM:

STEP 1
Please switch to root(superuser) to run the utility.
or
Use "sudo" to allow users to execute a command as root(superuser) in user mode. 

Example:
$ su
$ sudo ./SSDWidget

STEP 2
Ensure you are at the top of the file directory

STEP 3
Run the SMART program, the synopsis of the commands as below:

- SSDWidget [options][device name]

Options:
    	 d: Display the target device SMART information.
            SSD Drive: Example: # ./SSDWidget d /dev/sdc
            PCIe Drive: Example: # ./SSDWidget d /dev/nvme0n1

   	 s: Configure the SMART program run at background.
  	    Example: # ./SSDWidget s

	 q: Quit the background SMART program
	    Example: # ./SSDWidget q

	qs: Quick Scan, randomly selects blocks and reads through selected blocks to scan for errors.
	    SSD Drive: Example: # ./SSDWidget qs /dev/sdc
            PCIe Drive: Example: # ./SSDWidget qs /dev/nvme0n1

	fs: Full Scan, read through all blocks to scan for errors.
	    SSD Drive: Example: # ./SSDWidget fs /dev/sdc
            PCIe Drive: Example: # ./SSDWidget fs /dev/nvme0n1

	dc: Data Compare, create virtual files in the designated drive path, the virtual files will be deleted afterwards
	    SSD Drive: Example: # ./SSDWidget dc /dev/sdc1
            PCIe Drive: Example: # ./SSDWidget fs /dev/nvme0n1p1

	de: Drive Erase. Erases all LBAs in the drive.
	    SSD Drive: Example: # ./SSDWidget de /dev/sdc
            PCIe Drive: Example: # ./SSDWidget de /dev/nvme0n1

	ss: S.M.A.R.T short self-test.
	    SSD Drive: Example: # ./SSDWidget ss /dev/sdc
            PCIe Drive: Example: # not supported

	es: S.M.A.R.T extended self-test.
	    SSD Drive: Example: # ./SSDWidget es /dev/sdc
            PCIe Drive: Example: not supported   

	as: Abort S.M.A.R.T short self-test or S.M.A.R.T extended self-test.
	    SSD Drive: Example: # ./SSDWidget as /dev/sdc
            PCIe Drive: Example: not supported

	se: Secure Erase or Instant Keychange(if supported).
	    SSD Drive: Example: # ./SSDWidget se /dev/sdc
            PCIe Drive: Example: not supported 

	tr: Drive Optimization.
	    SSD Drive: Example: # ./SSDWidget tr /dev/sdc
            PCIe Drive: Example: not supported           

Notes:

- Log file: 
1. It will save the log file at the home folder every time when run the program.
2. User can set the number of hours by changing "CheckTime" item to save the log file.
   Example: "CheckTime=5" means every 5 hours save the log file.
3. User can change the log file name by changing "LogFileName" item.
   Example: LogFileName=SSDWidget.log



- FTP:
1. If want upload the SMART information to server by FTP, please make sure the system has installed the linux tool "curl", otherwise the transaction would not be performed.
2. if "curl" is installed, you need to enable the connection in setting.ini.
   Example: EnableFTPConnection=1(1: Enable, 0: Disable)


Setting:
Configure the FTP and log file setting in setting.ini

[FTPSetting]
EnableFTPConnection=1           ---> FTP connection enable, '1' - enabled
                                                            '0' - disabled
Group=Apacer                    ---> Group name.
Platform=Linux_Test             ---> Platform name.
UserName=Apacer_user	        ---> User name for FTP connection.
Password=123456                 ---> Password for FTP connection.
IP=127.0.0.1                    ---> IP address for FTP connection.
Port=21                         ---> Port for FTP connection.


[Others]
CheckTime=5                     ---> Set the number of hours by "CheckTime" item to save log file and upload to server by FTP.(hours : 1 - 24)
AutoSaveLog=1			---> Save log file automatically, '1' - enabled
                                                                  '0' - disabled
LogFileName=SSDWidget.log       ---> Log file name.



