CCAux  2.20.0.0
CCAux API reference
Functions
Smart functions

Functions

EXTERN_C CCAUXDLL_API SMARTHANDLE CCAUXDLL_CALLING_CONV GetSmart (void)
 
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Smart_release (SMARTHANDLE)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getRemainingLifeTime (SMARTHANDLE, uint8_t *lifetimepercent)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getRemainingLifeTime2 (SMARTHANDLE, uint8_t *lifetimepercent)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getDeviceSerial (SMARTHANDLE, char_t *buff, int32_t len)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getDeviceSerial2 (SMARTHANDLE, char_t *buff, int32_t len)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getInitialTime (SMARTHANDLE, time_t *time)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getInitialTime2 (SMARTHANDLE, time_t *time)
 

Detailed Description

Functions in the Smart class

Function Documentation

◆ GetSmart()

EXTERN_C CCAUXDLL_API SMARTHANDLE CCAUXDLL_CALLING_CONV CrossControl::GetSmart ( void  )

Factory function that creates instances of the Smart object.

Supported Platform(s): XL, XM, XM9

Returns
SMARTHANDLE to an allocated AuxVersion structure. The returned handle needs to be deallocated using the Smart::Release() method when it's no longer needed. Returns NULL if it fails to allocate memory.

Example Usage:

SMARTHANDLE pSmart = ::GetSmart();
assert(pSmart);
show_card_data(pSmart);
Smart_release(pSmart);
EXTERN_C CCAUXDLL_API SMARTHANDLE CCAUXDLL_CALLING_CONV GetSmart(void)
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Smart_release(SMARTHANDLE)
void * SMARTHANDLE
Definition: Smart.h:28

◆ Smart_getDeviceSerial()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Smart_getDeviceSerial ( SMARTHANDLE  ,
char_t buff,
int32_t  len 
)

Get serial number of the secondary storage device.

Supported Platform(s): XL, XM, XM9

Parameters
buffText output buffer.
lenMaximum length of the output buffer. If the actual length of the data is greater, an error will be returned. At least an 21 bytes buffer size must be used since the serial number can be 20 bytes + trailing zero.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

char serial[21];
err = Smart_getDeviceSerial(pSmart, serial, sizeof(serial));
if (ERR_SUCCESS == err)
{
cout << "Device serial number: " << serial << endl;
}
else
{
cout << "Error(" << err << ") in function getDeviceSerial: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getDeviceSerial(SMARTHANDLE, char_t *buff, int32_t len)
EXTERN_C CCAUXDLL_API char_t const *CCAUXDLL_CALLING_CONV GetErrorStringA(eErr errCode)
@ ERR_SUCCESS
Definition: CCAuxTypes.h:163

◆ Smart_getDeviceSerial2()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Smart_getDeviceSerial2 ( SMARTHANDLE  ,
char_t buff,
int32_t  len 
)

Get serial number of the second secondary storage device. Use this function to access the second card if the the device uses two cards.

Supported Platform(s): XL

Parameters
buffText output buffer.
lenMaximum length of the output buffer. If the actual length of the data is greater, an error will be returned. At least an 21 bytes buffer size must be used since the serial number can be 20 bytes + trailing zero.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. ERR_CODE_NOT_EXIST if only one card is available on XL platform. See the enum eErr for details.

Example Usage:

char serial[21];
err = Smart_getDeviceSerial2(pSmart, serial, sizeof(serial));
if (ERR_SUCCESS == err)
{
cout << "Device serial number: " << serial << endl;
}
else if (ERR_NOT_SUPPORTED == err)
{
cout << "Smart_getDeviceSerial2 is not supported on this platform" << endl;
}
else
{
cout << "Error(" << err << ") in function getDeviceSerial: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getDeviceSerial2(SMARTHANDLE, char_t *buff, int32_t len)
@ ERR_NOT_SUPPORTED
Definition: CCAuxTypes.h:165

◆ Smart_getInitialTime()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Smart_getInitialTime ( SMARTHANDLE  ,
time_t *  time 
)

Get the date/time when the SMART monitoring began for this storage device. This time is either when the card first was used or when the system software was updated to support S.M.A.R.T. monitoring for the first time. Logging of time is based on the local time of the computer at the time of logging and may therefore not always be accurate.

Supported Platform(s): XL, XM, XM9

Parameters
timeA 32bit time_t value representing the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

time_t initialTime;
struct tm *timeinfo;
err = Smart_getInitialTime(pSmart, &initialTime);
if (ERR_SUCCESS == err)
{
cout << "Device was initially timestamped on: ";
timeinfo = localtime(&initialTime);
if (timeinfo)
{
cout << asctime(timeinfo) << endl;
}
else
{
cout << "Error getting initial time" << endl;
}
}
else
{
cout << "Error(" << err << ") in function getInitialTime: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getInitialTime(SMARTHANDLE, time_t *time)

◆ Smart_getInitialTime2()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Smart_getInitialTime2 ( SMARTHANDLE  ,
time_t *  time 
)

Get the date/time when the SMART monitoring began for this storage device. This time is either when the card first was used or when the system software was updated to support S.M.A.R.T. monitoring for the first time. Logging of time is based on the local time of the computer at the time of logging and may therefore not always be accurate.

Use this function to access the second card if the the device uses two cards.

Supported Platform(s): XL

Parameters
timeA 32bit time_t value representing the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. ERR_CODE_NOT_EXIST if only one card is available on XL platform. See the enum eErr for details.

Example Usage:

time_t initialTime;
struct tm *timeinfo;
err = Smart_getInitialTime2(pSmart, &initialTime);
if (ERR_SUCCESS == err)
{
cout << "Device was initially timestamped on: ";
timeinfo = localtime(&initialTime);
if (timeinfo)
{
cout << asctime(timeinfo) << endl;
}
else
{
cout << "Error getting initial time" << endl;
}
}
else if (ERR_NOT_SUPPORTED == err)
{
cout << "Smart_getInitialTime2 is not supported on this platform" << endl;
}
else
{
cout << "Error(" << err << ") in function getInitialTime: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getInitialTime2(SMARTHANDLE, time_t *time)

◆ Smart_getRemainingLifeTime()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Smart_getRemainingLifeTime ( SMARTHANDLE  ,
uint8_t lifetimepercent 
)

Get remaining lifetime of the secondary storage device.

Supported Platform(s): XL, XM, XM9

Parameters
lifetimepercentThe expected remaining lifetime (0..100%).
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

unsigned char life;
err = Smart_getRemainingLifeTime(pSmart, &life);
if (ERR_SUCCESS == err)
{
cout << "Estimated remaining lifetime: " << (int)life << "%" << endl;
}
else
{
cout << "Error(" << err << ") in function getRemainingLifeTime: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getRemainingLifeTime(SMARTHANDLE, uint8_t *lifetimepercent)

◆ Smart_getRemainingLifeTime2()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Smart_getRemainingLifeTime2 ( SMARTHANDLE  ,
uint8_t lifetimepercent 
)

Get remaining lifetime of the second secondary storage device. Use this function to access the second card if the the device uses two cards.

Supported Platform(s): XL

Parameters
lifetimepercentThe expected remaining lifetime (0..100%).
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. ERR_CODE_NOT_EXIST if only one card is available on XL platform. See the enum eErr for details.

Example Usage:

unsigned char life;
err = Smart_getRemainingLifeTime2(pSmart, &life);
if (ERR_SUCCESS == err)
{
cout << "Estimated remaining lifetime: " << (int)life << "%" << endl;
}
else if (ERR_NOT_SUPPORTED == err)
{
cout << "Smart_getRemainingLifeTime2 is not supported on this platform" << endl;
}
else
{
cout << "Error(" << err << ") in function getRemainingLifeTime: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Smart_getRemainingLifeTime2(SMARTHANDLE, uint8_t *lifetimepercent)

◆ Smart_release()

EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV CrossControl::Smart_release ( SMARTHANDLE  )

Delete the Smart object.

Supported Platform(s): XL, XM, XM9

Returns
-

Example Usage:

SMARTHANDLE pSmart = ::GetSmart();
assert(pSmart);
show_card_data(pSmart);
Smart_release(pSmart);