Repository navigation
fix(lib): expose the microphone noise filter in the C++ and C APIs - #602
ChrisLauinger77 wants to merge 2 commits into
Conversation
CAP_NOISE_FILTER has had a device method and a CLI handler since it was added, but no library entry point, so applications linking libheadsetcontrol could detect the capability and not set it. Add Headset::setNoiseFilter() and hsc_set_noise_filter(), cover both through the test device, and document them in LIBRARY_USAGE.md. Level validation stays in the devices, which already reject anything above 2. The capability guide never mentioned the library APIs, which is how this one was missed, so it gains a step for them.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 387198d2b8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The 0-2 range is the public contract of setNoiseFilter() and hsc_set_noise_filter(), but the setter only relied on the devices to reject anything above it. The real implementations do; the test device echoes any level, so hsc_set_noise_filter(handle, 3) returned HSC_RESULT_OK there. Check the level against the capability descriptor before dispatching, as the 0-128 setters already do, cover the rejected value in both API tests, and mention it in the capability guide's validation section.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
) CAP_NOISE_FILTER had a device method and a CLI handler but no library entry point, so applications linking libheadsetcontrol could detect the capability without being able to set it. Add Headset::setNoiseFilter() and hsc_set_noise_filter(), bounded 0-2 in the library since all three device implementations reject anything higher, and document the library step in ADDING_A_CAPABILITY.md.
|
Merged as 8b255b0. Had to squash it locally rather than through the button: 0c875d2 rewrote the same Validation paragraph, so the two collided in Side effect of merging it by hand is that the commit is authored by me instead of you. Not intentional and I can't rewrite it, master rejects force pushes. The work is yours. |
Changes made
CAP_NOISE_FILTERhas a device method and a CLI handler, but no library entry point, so applications linkinglibheadsetcontrolcan detect the capability but not set it.Headset::setNoiseFilter()andhsc_set_noise_filter().tests/test_library_api.cpp, including the null-handle check.docs/LIBRARY_USAGE.md.hsc_set_noise_filter(handle, 3)returnsHSC_RESULT_INVALID_PARAMon every device, including the test device, which accepts any level.docs/ADDING_A_CAPABILITY.mdnever mentioned the library APIs, which is how this one was missed, so it gains a step 9 for them.No
API_VERSIONbump: the structured output is unchanged.Checklist
For new features in HeadsetControl: I discussed it beforehand in Issues or Discussions and adhered to the wikiNot applicable: this is a fix and adds no new capability.