ACR89U-A1 – Reference Manual
Version 1.04
www.acs.com.hk
Page 55 of 57
Example:
4.2.7.
Other Functions
The following functions allow the user to control the buzzer of the LEDs of ACR89.
4.2.7.1. AS_SetBuzzer
This function enables or disables the buzzer of the ACR89.
AS_STATUS AS_DECL
AS_ SetBuzzer
(
IN INT nDevId,
IN PBUZZER pBuzzer);
Parameters:
nDevId
[in] Handle returned by a previous call to
AS_Open
.
pBuzzer
[in] Pointer to a
BUZZER
structure that contains the state to set of the buzzer. See also
Section 4.1.2.10
for more information about the
BUZZER
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.
Example:
AS_STATUS status;
TIMESTAMP newTime;
TIMESTAMP chkTime;
//set the RTC of the ACR89 using the values in the abTime array
//assumed is that a connection has already been established
CopyMemory(newTime.szRTCValue, abTime, 6);
Status = AS_SetRTC(pDevId, &newTime, &chkTime);
AS_STATUS status;
BUZZER buzStat;
//turn the buzzer of the ACR89 on for 1 second
//assumed is that a connection has already been established
buzStat.cbBuzzerState = 1;
buzStat.cbBuzzerOnDuration = 10;
// 1 second
status = AS_SetBuzzer(nDevId, &buzStat);
return status;