Skip to content

MiP_Clap

github-actions[bot] edited this page Aug 10, 2026 · 10 revisions

Class MiP_Clap

MiP_Clap manages MiP's clap detection system, from enabling to disabling, configuring, and reporting on detected clap events.

Members & Functions

Type Signature Description
variable constexpr uint8_t MIP_CMD_ENABLE_CLAP The MiP protocol command to enable MiP's clap detection system.
variable constexpr uint8_t MIP_CMD_CLAP_RESPONSE The MiP protocol response reporting the number of claps detected.
variable constexpr uint8_t MIP_CMD_SET_CLAP_DELAY The MiP protocol command to set the minimum delay time between claps.
variable constexpr uint8_t MIP_CMD_GET_CLAP_SETTINGS The MiP protocol command to read MiP's clap detection settings.
function MiP_Clap(MiP &mip) Constructs the clap system manager.
function void enableEvents() Enables MiP's clap event reporting. This verified method sends the enable command and reads back settings to confirm success. It retries on failure.
function void disableEvents() Disables clap event reporting from MiP. This verified method sends the disable command and reads back settings to confirm success. It retries on failure.
function bool areEventsEnabled() Checks if clap event reporting is currently enabled.
function uint8_t availableEvents() Returns the number of unread clap events in the queue. Processes any pending serial data first to update the queue.
function uint8_t readEvent() Reads the next available clap event from the queue. Processes pending serial data first. If no event is available, sets last error to MIP_ERROR_NO_EVENT.
function uint16_t readDelay() Reads the current clap delay setting.
function void writeDelay(uint16_t delay) Sets the minimum delay between clap events. Verified method: sends the new delay and confirms by reading back the settings. Retries automatically on mismatch or error.

Clone this wiki locally