Add authenticated BLE audio streaming, shared link ownership, mic stream API, and config/docs - #74
Merged
MacNite merged 2 commits intoSep 7, 2026
Conversation
This file contains hidden or 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
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.
Motivation
Description
src/link.c/src/link.hthat centralisesBT_CONN_CB_DEFINEbehavior, exposeslink_conn(), exclusivelink_claim()/link_release()ownership forLINK_OWNER_OTA,LINK_OWNER_AUDIO, andLINK_OWNER_THROUGHPUT, and an arm-timeout that disconnects unclaimed connections afterHIVE_LINK_ARM_TIMEOUT_MS.src/audio.c/src/audio.hwith CTRL/DATA/STATUS characteristics, nonce + truncatedHMAC-SHA256authentication (PSA Crypto), sequenced PCM16 notifications, 30-byte STATUS layout, ring-backed capture, software gain with clipping accounting, CRC-32 over transmitted bytes, notification-credit draining and a 60 s hard cap, and detailed protocol docdocs/audio-over-ble.md.src/mic.h/src/mic.c(mic_stream_start(),mic_stream_read(),mic_stream_release(),mic_stream_stop()), increased slab blocks for streaming, reimplementedmic_read()on top of the streaming API, and ensured the sensor loop is gated bylink_is_busy()inmain.cso the PDM controller is single-ownership.0.6.0insrc/hive_config.h, added guarded audio constants (ENABLE_AUDIO,HIVE_AUDIO_MAX_SECONDS,HIVE_AUDIO_RING_BYTES,HIVE_AUDIO_STALL_TIMEOUT_MS,HIVE_AUDIO_CONN_INTERVAL_UNITS,HIVE_LINK_ARM_TIMEOUT_MS) and aBUILD_ASSERTfor ring size, updatedprj.conftoCONFIG_BT_BUF_ACL_TX_COUNT=6,CONFIG_BT_USER_DATA_LEN_UPDATE=y,CONFIG_BT_USER_PHY_UPDATE=y, and PSA HMAC/SHA-256 symbols, addedsrc/audio_secret.example.hand gitignoredsrc/audio_secret.h, and updatedCMakeLists.txtto includelink.candaudio.c.Testing
git diff --checkand source invariant Python assertions forAUDIO_STATUS_LEN,HIVE_AUDIO_MAX_SECONDS, and PSA use, and these checks passed.rgto confirmBT_CONN_CB_DEFINEis now implemented only inlink.c, and pattern checks for the protocol and STATUS layout succeeded.westbuilds but thewesttoolchain and NCS environment are not available in this execution environment, sowest --sysbuildbuilds (debug, lowpower, spike) and application size / slot-budget verification could not be executed here and must be run in an NCS v3.3.1 toolchain on a host withwestinstalled.Codex Task