Skip to content

Read and notify LED color and indication mode - #356

Merged
TobiasRoeddiger merged 1 commit into
2.2.10from
codex/led-state-readback
Oct 4, 2026
Merged

TobiasRoeddiger merged 1 commit into
2.2.10from
codex/led-state-readback

Conversation

@TobiasRoeddiger

@TobiasRoeddiger TobiasRoeddiger commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

The LED service only accepts writes, so clients cannot recover the configured color or indication mode after reconnecting. Add read and notify to the existing RGB and State characteristics, retaining their UUIDs and payloads. Reads return StateIndicator’s stored configuration; successful writes notify subscribers. Reject undefined indication modes without changing state.

RGB readback is the stored custom color, including in automatic mode; it does not represent instantaneous blinking or a DFU override. Older clients can keep writing as before.

Protocol metadata: protocol #2.

Validation: FOTA firmware build passes. Host checks of the actual callbacks/getters (mocked GATT and LED controller) pass for default/current state, partial reads, accepted-write notifications, invalid modes/lengths/offsets, and unsubscribed writes. Not flashed in this change.

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

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

Test scenario Platform Result
openearable.unit.sensor_component 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 168
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 84 0
cppcheck 84 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.

@TobiasRoeddiger TobiasRoeddiger mentioned this pull request Oct 4, 2026
@TobiasRoeddiger
TobiasRoeddiger merged commit 62bd60a into 2.2.10 Oct 4, 2026
4 checks passed
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