Constructs an instance of the RxTap class.
Configuration options for the tap handler.
Includes msgCode (default: 0x09) and threshold in seconds (default: 0.3).
Asynchronous queue for tap count events. Each event is a number representing the count of taps. Null if not attached.
Attaches this RxTap instance to a FrameMsg object to receive tap event data. It initializes the tap event queue and registers a handler for incoming data.
The FrameMsg instance to attach to.
A Promise that resolves to the AsyncQueue where tap counts (number) will be placed.
Detaches this RxTap instance from a FrameMsg object. It unregisters the data handler, clears any active timers, and clears the event queue.
The FrameMsg instance to detach from.
Handles incoming tap event data packets.
This method is typically called by a FrameMsg instance when a tap event is received.
It debounces rapid taps and counts taps within a defined threshold.
The accumulated tap count is placed onto the queue when the threshold timer expires.
A Uint8Array containing the tap event data (usually just the msgCode byte).
RxTap class handles tap events from the device. It counts the number of taps within a specified threshold time. It uses a queue to manage tap events and provides methods to attach and detach from a FrameMsg instance. It also debounces taps that occur too close together (40ms). The tap count is reset if no taps are detected within the threshold time.