-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add notification support #325
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stintel
force-pushed
the
feature/notify
branch
3 times, most recently
from
November 7, 2023 19:08
bd9c65c
to
c84ea5e
Compare
Enable all audio codecs exposed in esp_decoder.h so that users can pass URLs with all these formats in notify. Tested HE-AAC with the following URL: https://www2.iis.fraunhofer.de/AAC/SBRtestStereoAot5Sig1.mp4 Tested HE-AACv2 with the following URLs: https://www2.iis.fraunhofer.de/AAC/SBRtestStereoAot29Sig1.mp4 https://www2.iis.fraunhofer.de/AAC/SBRtestStereoAot29Sig2.mp4 https://www2.iis.fraunhofer.de/AAC/SBRtestStereoAot29Sig0.mp4 https://www2.iis.fraunhofer.de/AAC/SBRtestStereoAot5SigusePS.mp4 Tested Ogg Vorbis file with the following URL: https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg Tested Opus file with the following URL: https://github.com/xiph/opus-website/raw/master/static/examples/samples/music_128kbps.opus Tested Wav file with the following URL: https://github.com/xiph/opus-website/raw/master/static/examples/samples/music_128kbps.wav
Example JSON: { "cmd": "notify", "data": { "audio_url": "http://was.local/dingding.wav", "repeat": 10, "text": "Wake Up!!!" } }
Reuse notify_task for it instead.
When the JSON does not contain backlight or backlight_max, cJSON_IsBool will return false.
Strobe effect will be enabled when strobe_period_ms is added to the notify message.
The cancel button only breaks out of the loop that calls esp_audio_play. This only happens when ESP Audio is done playing. When playing a long audio file, this results in the cancel button not responding.
We need to use valuedouble here as cJSON does not support 64 bit int.
We will hold the ID of the active notification. This way, if WAS sends the same notification again, we can tell WAS the notification is already active.
But skip this step when the notify ID is 1, which we use for identify/locate. This command is not tracked in WAS NotifyQueue.
After changing identify/locate to use notify_task, more members where added to the notify_data struct. Due to this, identify/locate no longer turned on the backlight, and the volume was set to 0.
This is a bit tricky as in FreeRTOS we cannot get the task data from a running task. Therefore, change notify_active to a pointer to struct notify_data we pass to the notify task, and add a member cancel to cancel the running task. While at it, also free the task data memory at the end to not leak memory.
stintel
force-pushed
the
feature/notify
branch
from
November 8, 2023 21:36
c84ea5e
to
3aca2c0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.