Skip to content

Pack BLE PPG samples losslessly for firmware 2.3.0 - #355

Merged
TobiasRoeddiger merged 3 commits into
2.2.10from
codex/compact-ppg-ble
Oct 4, 2026
Merged

TobiasRoeddiger merged 3 commits into
2.2.10from
codex/compact-ppg-ble

Conversation

@TobiasRoeddiger

@TobiasRoeddiger TobiasRoeddiger commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

PPG BLE samples currently spend 16 bytes on four 19-bit readings. Pack those readings losslessly into ten bytes immediately before BLE batching and bump firmware to 2.3.0 in the same change. At a 244-byte notification limit, a packet now holds 23 samples instead of 14.

  • Keep sensor ID 4, parse-info scheme, timestamp anchor/period, and other sensors unchanged. The updated client selects PPG decoding from each device’s firmware version.
  • Keep acquisition buffers, SD/.oe records and advertised logical values as four uint32 channels; reject out-of-range values rather than truncate them.
  • Pin generated C codecs from protocol PR #1. Requires the matching Flutter decoder for BLE PPG on 2.3.x.

Validation: FOTA firmware builds successfully; four C tests pass for exact bytes, full-scale values, 23-sample packets, unchanged SD sample sizes, and unchanged non-PPG bytes. Native Flutter compatibility/decoding tests pass. No new on-device throughput claim is made.

The combined PPG + LED FOTA firmware also builds successfully and reports firmware 2.3.0.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

✅ Unit tests passed

4 passed, 0 failed/error, 0 skipped — view workflow run

Test scenario Platform Result
openearable.unit.sensor_component native_sim/native/64 ✅ passed
openearable.unit.sensor_transport native_sim/native/64 ✅ passed
openearable.unit.ring_buffer native_sim/native/64 ✅ passed
openearable.unit.audio_startup native_sim/native/64 ✅ passed

Download the unit-test-results artifact for full Twister reports and logs.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.zip
openearable_v2_fota.zip

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Compiler warnings

The extended-warning build completed successfully.

Application compiler warnings

Show warnings
unicast_server/main.cpp:78:33: warning: 'int usb_enable(usb_dc_status_callback)' is deprecated [-Wdeprecated-declarations]
src/SensorManager/Baro.cpp:93:34: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]

View this workflow run

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

CodeChecker static analysis (advisory)

Note

This report is informational. It does not block merging and does not change code.

At a glance

Scope Result
Findings on lines changed by this PR 0
Findings in the complete codebase 8
Analyzer invocations completed 180
Analyzer invocations failed 0

Findings on changed lines

No non-style findings were reported on lines changed by this PR.

Analyzer coverage

Analyzer Completed Failed
clangsa 90 0
cppcheck 90 0

Complete-codebase summary

Severity: 2 high, 6 low
Reported by analyzer: clangsa: 8

Complete-codebase findings

Each finding includes source context. The > line and carets identify the expression reported by the analyzer.

Show detailed findings with source context (8 of 8)
HIGH — src/audio/audio_datapath.c:1002 — Null pointer passed as 1st argument to memory set function
  1001 | 
> 1002 |             memset(tx_buf, 0, BLK_MULTI_CHAN_SIZE_OCTETS);
       |                    ^^^^^^
  1003 |         }
HIGH — src/audio/sw_codec_select.c:220 — Assigned value is garbage or undefined
  219 | 
> 220 |         meta_out->bytes_per_location = bytes_written;
      |                                        ^^^^^^^^^^^^^
  221 |         meta_out->locations &= meta_in->locations;
LOW — src/audio/audio_system.c:238 — Value stored to 'audio_q_num_used' is never read
  237 |         if (unlikely(++debug_trans_count >= DEBUG_INTERVAL_NUM)) {
> 238 |             audio_q_num_used = k_msgq_num_used_get(&audio_q_in);
      |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  239 |             LOG_DBG(COLOR_CYAN "IN filled: %d" COLOR_RESET, audio_q_num_used);
LOW — src/audio/audio_system.c:745 — Value stored to 'num_ch' during its initialization is never read
  744 | 
> 745 |     int num_ch = POPCOUNT(locations);
      |         ^^^^^^
  746 | 
LOW — src/audio/le_audio_rx.c:125 — Value stored to 'bad_frame_percentage' during its initialization is never read
  124 |                 rx_stats[location_index].bad_or_empty_frame_cnt;
> 125 |     double bad_frame_percentage =
      |            ^^^^^^^^^^^^^^^^^^^^
  126 |         (total_frames > 0) ? (((double)rx_stats[location_index].bad_or_empty_frame_cnt /
LOW — src/audio/le_audio_rx.c:160 — Value stored to 'ret' is never read
  159 |         /* FIFO buffer is full, swap out oldest frame for a new one */
> 160 |         ret = k_msgq_get(&ble_q_rx, (void *)&stale_buf, K_NO_WAIT);
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  161 |         /* Checking return value of k_msgq_get() is not necessary here,
LOW — src/bluetooth/bt_management/scanning/bt_mgmt_scan.c:58 — Value stored to 'scan_param' during its initialization is never read
  57 | 
> 58 |     struct bt_le_scan_param *scan_param =
     |                              ^^^^^^^^^^
  59 |         BT_LE_SCAN_PARAM(NRF_AUDIO_GATEWAY_SCAN_TYPE, BT_LE_SCAN_OPT_FILTER_DUPLICATE,
LOW — src/modules/audio_sync_timer.c:138 — Value stored to 'cc_get_calls' is never read
  137 | 
> 138 |     cc_get_calls = 0;
      |                    ^
  139 | 

Open the workflow run and download the complete CodeChecker report for a detailed view. Check out codechecker.html/index.html.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.zip
openearable_v2_fota.zip

This was referenced Oct 4, 2026
@TobiasRoeddiger
TobiasRoeddiger merged commit b4d09ca into 2.2.10 Oct 4, 2026
4 checks passed
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

Build output available:
openearable_v2_firmware.zip
openearable_v2_fota.zip

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