Skip to content

Move some generic modules into the shared library#802

Closed
arkq wants to merge 2 commits into
masterfrom
cleanup
Closed

Move some generic modules into the shared library#802
arkq wants to merge 2 commits into
masterfrom
cleanup

Conversation

@arkq
Copy link
Copy Markdown
Owner

@arkq arkq commented May 20, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2026 04:55
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 73.00613% with 88 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.38%. Comparing base (ed48734) to head (5ce1fd4).

Files with missing lines Patch % Lines
src/ba-rfcomm.c 71.97% 88 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #802      +/-   ##
==========================================
+ Coverage   66.19%   66.38%   +0.18%     
==========================================
  Files          94       95       +1     
  Lines       14494    14474      -20     
  Branches     2533     2513      -20     
==========================================
+ Hits         9594     9608      +14     
+ Misses       4900     4866      -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates several generic components (AT parser, H2 sync utilities, BLE-MIDI codec) into src/shared/ and updates build/test code accordingly, while also refactoring parts of RFCOMM handling to use the project’s error_code_t error reporting.

Changes:

  • Move/enable at.*, h2.*, and BLE-MIDI implementation in the shared library and update include paths across src/ and test/.
  • Replace the old ble-midi.h API include usage with shared/bluetooth-midi.h, and add explicit free calls in BLE-MIDI tests/cleanup paths.
  • Refactor RFCOMM callbacks and I/O helpers to return error_code_t, and factor SLC/setup progression into helpers.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/test-h2.c Update H2 include to use shared header path.
test/test-ble-midi.c Switch to shared BLE-MIDI header and add encoder/decoder cleanup calls.
test/test-at.c Update AT include to use shared header path.
test/mock/mock-bluealsa.c Switch BLE-MIDI include to shared header.
src/shared/Makefile.am Build moved/shared modules (at.c, h2.c, bluetooth-midi.c) into libshared.la.
src/shared/h2.h Update header guard to shared naming.
src/shared/h2.c Add shared implementation of h2_header_find().
src/shared/ffb.h Add #pragma once to match other shared headers.
src/shared/bluetooth-midi.h Add new shared BLE-MIDI public header (replacing removed src/ble-midi.h).
src/shared/bluetooth-midi.c Align includes/formatting; add no-op ble_midi_encode_free(); move MTU setter to inline in header.
src/shared/bluetooth-hfp.h Rename setup enum terminal value to HFP_SETUP_COMPLETED.
src/shared/at.h Update header guard; switch internal include to local shared header name.
src/shared/at.c Adjust includes and remove per-message debug logging from AT parsing.
src/midi.c Switch to shared BLE-MIDI header include.
src/Makefile.am Stop compiling at.c, h2.c, and ble-midi.c in libbluealsad sources (now shared).
src/codec-msbc.h Update H2 include path to shared header.
src/codec-msbc.c Update H2 include path to shared header.
src/codec-lc3-swb.h Update H2 include path to shared header.
src/codec-lc3-swb.c Update H2 include path to shared header.
src/bt-midi.c Switch to shared BLE-MIDI header include.
src/ble-midi.h Remove old BLE-MIDI header (replaced by shared header).
src/ba-transport.h Switch to shared BLE-MIDI header include.
src/ba-transport.c Switch to shared BLE-MIDI header include and free BLE-MIDI encoder on MIDI transport teardown.
src/ba-rfcomm.h Switch to shared AT header and change callback signature to error_code_t.
src/ba-rfcomm.c Refactor RFCOMM I/O + state machine to use error_code_t and new SLC/setup driver helpers.
.github/workflows/codecov-report.yaml Bump Codecov action major version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ba-rfcomm.c
Comment on lines +1572 to 1576
if (ret <= 0) {
ec = ERROR_SYSTEM(errno);
goto ioerror_exthandler;
}

Comment thread src/ba-rfcomm.c
Comment on lines +1572 to +1575
if (ret <= 0) {
ec = ERROR_SYSTEM(errno);
goto ioerror_exthandler;
}
Comment on lines +15 to +19
#include <stdbool.h>
#include <stdint.h>
#include <sys/param.h>
#include <time.h>

@arkq arkq closed this May 20, 2026
@arkq arkq deleted the cleanup branch May 20, 2026 15:11
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.

2 participants