ACR89U-A1 – Reference Manual
Version 1.04
www.acs.com.hk
Page 54 of 57
Return Values:
AS_STATUS
This functions returns different values depending on whether it succeeds or fails.
AS_STATUS.DllError
contains the status as returned by the DLL.
AS_STATUS.W32Error
contains the Win32 error code associated with the DLL
error, if any. See also
Appendix A
for the possible return codes.
Example:
4.2.6.2. AS_SetRTC
This function sets the real time clock value of the built-in real time clock to the value specified in the
TIMESTAMP structure.
AS_STATUS AS_DECL
AS_SetRTC
(
IN INT nDevId,
IN PTIMESTAMP pNewTime,
OUT PTIMESTAMP pTimeStamp);
Parameters:
nDevId
[in] Handle returned by a previous call to
AS_Open
.
pNewTime
[in] Pointer to
TIMESTAMP
structure that contains the new time value to be set in the
built-in real time clock. See also
Section 4.1.4.1
for more information about the
TIMESTAMP
structure.
pTimeStamp
[out] Pointer to
TIMESTAMP
structure that contains the newly set time value. See
also
Section 4.1.4.1
for more information about the
TIMESTAMP
structure.
Return Values:
AS_STATUS
This functions returns different values depending on whether it succeeds or fails.
AS_STATUS.DllError
contains the status as returned by the DLL.
AS_STATUS.W32Error
contains the Win32 error code associated with the DLL error,
if any. See also Appendix A for the possible return codes.
AS_STATUS status;
TIMESTAMP tsRTC;
char szTime[81];
//read the RTC of the ACR89
//assumed is that a connection has already been established
status = AS_ReadRTC(nDevId, &tsRTC);
if(status.DllError == CMD_SUCCESS)
// display the returned date & time from the ACR89
sprintf(szTime, “RTC: %d/%d/%d %d:%d:%d (yy/mm/dd hh:mm:ss)”,
tsRTC. szRTCValue[0], tsRTC. szRTCValue[1],
tsRTC. szRTCValue[2], tsRTC. szRTCValue[3],
tsRTC. szRTCValue[4], tsRTC. szRTCValue[5]);
::MessageBox(0L, szTime, “”, MB_OK);
}
return status;
return status;