Skip to content

Feature/2626 distinct buzzer notifications#2665

Open
jocasmark wants to merge 7 commits into
meshcore-dev:devfrom
jocasmark:feature/2626-distinct-buzzer-notifications
Open

Feature/2626 distinct buzzer notifications#2665
jocasmark wants to merge 7 commits into
meshcore-dev:devfrom
jocasmark:feature/2626-distinct-buzzer-notifications

Conversation

@jocasmark
Copy link
Copy Markdown

Feature Request: #2626

Adds uniform buzzer feedback so users get distinct audible confirmation of what they toggled, without growing UIEventType per setting.

Convention

  • Ascending pitch = enable, descending = disable
  • Note count matches the number of button presses that trigger the action, so the buzzer toggle (triple-click) plays 3 notes and GPS toggle (quadruple-click) plays 4 notes.
  • Extensible up to 6 notes

Changes

  • New genericBuzzer::playToggle(count, enabled) renders the melody from the convention. Generic and opt-in.
  • New UIEventType::advertSent plays a short sound when an advert is sent from the UI.
  • New non-forcing AbstractUITask::notifyToggle(count, enabled) virtual (empty default).
  • Wired up in ui-orig, ui-new, ui-tiny: advert page, toggleBuzzer (3), toggleGPS (4).
  • Mute-confirmation fix: the "off" tone now plays to completion before quiet(true) cuts the buzzer.

Note
NonBlockingRtttl::begin() only stores a pointer to the melody, so the generated buffer in playToggle() uses static storage to outlive playback.

Validation

  • pio run -e t1000e_companion_radio_usb
  • pio run -e Heltec_E213_companion_radio_ble
  • Verified on T1000E hardware.

jocasmark added 7 commits June 1, 2026 15:18
Give advert and toggleable settings (buzzer, GPS) their own short,
easily distinguishable buzzer tones so users of buzzer-only devices
(e.g. T1000E) can tell events apart by ear.

- genericBuzzer::playToggle(count, enabled): generic, opt-in helper
  for the count/direction convention (N notes ascending if enabled,
  descending if disabled). Lives next to play()/startup()/shutdown();
  any caller can use it, nothing forces it.
- AbstractUITask: virtual notifyToggle(count, enabled) with an empty
  default — subclasses that don't care don't override. UIEventType
  only gains one event-shaped entry (advertSent), so it doesn't grow
  one entry per toggleable setting.
- ui-orig / ui-new / ui-tiny: notify() handles fixed events;
  notifyToggle() is a one-line delegate to buzzer.playToggle().
  Button presses, home-page actions, toggleBuzzer (3 notes) and
  toggleGPS (4 notes) route through notifyToggle().
- Preserve existing silent-when-connected behavior for incoming
  contact messages: when the companion app is connected it handles
  user notification, so the device stays quiet.
- Fix mute-confirmation bug: hold mute until the off-tone finishes
  so the user actually hears it when disabling the buzzer.
Adjusts the duration and tempo of several buzzer melodies to make them more perceptible. Specifically, the advert sent and generic toggle sounds are modified with longer note durations and slower tempos, improving their clarity on typical small piezo speakers.
Ensures the RTTTL player has a persistent buffer for melody data. The player stores a pointer to the melody, which requires the buffer to outlive the function call. A static buffer guarantees this, preventing issues from accessing deallocated memory. This is safe as concurrent playback is not supported.
Simplifies the explanation for using a static buffer for buzzer melodies.
Explains the distinct tones used on companion-radio devices for actions like toggle confirmations. Improves user understanding of audio feedback, especially on button-only devices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant