setBuzzerOnDetection method

Future<void> setBuzzerOnDetection({
  1. required bool enabled,
})

Enables or disables the buzzer to sound upon card detection.

This method configures the RFID reader to activate its buzzer when an RFID card is detected, providing audible feedback based on the enabled state.

Parameters

  • enabled: A boolean value indicating whether the buzzer should be enabled (true) or disabled (false).

Throws

  • Exceptions related to APDU transmission failures or if the RFID reader responds with an error.

Example

await setBuzzerOnDetection(enabled: true); // Enables the buzzer on card detection.

Note: This configuration is particularly useful in scenarios requiring immediate user feedback upon card presence or absence.

Implementation

Future<void> setBuzzerOnDetection({required bool enabled}) async {
  await transmitApdu(
    ApduHeader(
      classNumber: 0xFF,
      instruction: 0x00,
      p1: 0x52,
      p2: enabled ? 0xFF : 0x00,
    ),
    le: 0x00,
  );
}