Skip to content
Open

2.2.2 #139

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0d9ae33
src/audio/audio_datapath.c: notify bt_mgmt of audio under runs
DennisMoschina Nov 17, 2025
2ca2263
src/bluetooth/bt_management: implemented strategies for setting conn …
DennisMoschina Nov 17, 2025
8ddcb72
src/bluetooth/bt_management_conn_interval: removed unused parameter
DennisMoschina Nov 17, 2025
39cabc1
unicast_server/main.cpp: initiate strategy for managing connection in…
DennisMoschina Nov 17, 2025
7dba077
Update VERSION
TobiasRoeddiger Nov 20, 2025
59c0192
Update flash_fota.ps1
TobiasRoeddiger Nov 20, 2025
cbc5e63
Add hardware version to flash commands in README
TobiasRoeddiger Nov 20, 2025
3cd1285
Update README.md
TobiasRoeddiger Nov 20, 2025
e5bcc2f
Update README.md
TobiasRoeddiger Nov 7, 2025
6c33864
Simplify comments in flashing commands
TobiasRoeddiger Nov 7, 2025
7958a11
Fix formatting in recovery instructions
TobiasRoeddiger Nov 7, 2025
3bd6c8b
Update README with debug output instructions
TobiasRoeddiger Nov 7, 2025
515a603
Correct capitalization of 'J-Link' in README
TobiasRoeddiger Nov 7, 2025
9e4bf21
Update J-Link setup instructions in README
TobiasRoeddiger Nov 10, 2025
8730788
Update README.md
TobiasRoeddiger Nov 10, 2025
19f4769
Update J-Link options in README
TobiasRoeddiger Nov 19, 2025
457e26b
src/SensorManager/Baro.cpp: ignore first sample of Barometer
DennisMoschina Nov 20, 2025
46e5162
limit number of ongoing sensor stream notifies
Nov 20, 2025
56f90b0
remove temporary notify disable and disable notify permanently on dis…
Nov 28, 2025
041427d
set correct version of zephyr-sdk for build pipeline
Nov 28, 2025
883f83d
Merge pull request #142 from OpenEarable/sensor-stream-enhancement
TobiasRoeddiger Dec 1, 2025
157c739
remove anc_fxlms_wrapper file
Dec 9, 2025
d9f6f30
resolved merge conflict
TobiasRoeddiger Dec 10, 2025
9ebfb80
src/time_sync: proof of concept implementation of time sync using cts
DennisMoschina Dec 3, 2025
296d2e0
prj.conf, prj_fota.conf: enabled configurations for CTS
DennisMoschina Dec 3, 2025
d7eac90
CMakeLists.txt: added time_sync module
DennisMoschina Dec 3, 2025
54e776e
unicast_server/main.cpp: init time_sync
DennisMoschina Dec 3, 2025
4f28066
src/time_sync: implemented custom time sync service
DennisMoschina Dec 5, 2025
be10f7c
prj.conf, prj_fota.conf: removed unused configurations for CTS
DennisMoschina Dec 5, 2025
faabac3
src/time_sync/README.md: added documentation for time syncing
DennisMoschina Dec 5, 2025
16a8816
unicast_server/main.cpp: added default implementation for oe_micros
DennisMoschina Dec 6, 2025
e793221
include/openearable_common.h: use custom implementation for micros()
DennisMoschina Dec 6, 2025
7316fcb
src/time_sync: send current time instead of time since boot, receive …
DennisMoschina Dec 6, 2025
8345833
include/openearable_common.h: made oe_micros available to c++
DennisMoschina Dec 8, 2025
2693f57
unicast_server/main.cpp: removed default implementation of oe_micros()
DennisMoschina Dec 8, 2025
41b6328
micropython: removed micropython
DennisMoschina Dec 10, 2025
f13d94c
Update VERSION
TobiasRoeddiger Dec 10, 2025
00554c7
Fix header formatting in README.md
TobiasRoeddiger Dec 10, 2025
da31679
fixed readme conflicts
TobiasRoeddiger Dec 10, 2025
3d9e191
Merge branch '2.2.2' of github.com:OpenEarable/open-earable-2 into 2.2.2
TobiasRoeddiger Dec 10, 2025
cfc6c2a
Update README.md
TobiasRoeddiger Dec 10, 2025
a7d90c9
Update README.md
TobiasRoeddiger Dec 10, 2025
ed2fb27
Update README.md
TobiasRoeddiger Dec 10, 2025
951d0e7
Update README.md
TobiasRoeddiger Dec 10, 2025
d1d3ec8
src/SensorManager: changed time calculation for Bone Conduciton and P…
DennisMoschina Dec 15, 2025
6e2e495
src/time_sync/time_sync.c: made time sync more robust for mulitple co…
DennisMoschina Dec 15, 2025
ec146c5
Merge branch '2.2.2' of https://github.com/OpenEarable/open-earable-v…
Dec 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build_firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:

- name: Install Zephyr SDK
run: |
wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.4/zephyr-sdk-0.16.4_linux-x86_64_minimal.tar.xz
tar xf zephyr-sdk-0.16.4_linux-x86_64_minimal.tar.xz -C ~/
~/zephyr-sdk-0.16.4/setup.sh -c -t arm-zephyr-eabi
wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.0/zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz
tar xf zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz -C ~/
~/zephyr-sdk-0.17.0/setup.sh -c -t arm-zephyr-eabi

- name: Initialize Zephyr Workspace
# Set up the Zephyr workspace and install the Python dependencies
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ zephyr_library_include_directories(
src/SD_Card/SDLogger
src/SD_Card/Benchmark
src/SD_Card/SD_Card_Manager
src/time_sync
)

zephyr_library_include_directories(app PRIVATE
Expand All @@ -74,6 +75,7 @@ add_subdirectory(src/SensorManager)
add_subdirectory(src/SD_Card/SDLogger)
add_subdirectory(src/SD_Card/Benchmark)
add_subdirectory(src/SD_Card/SD_Card_Manager)
add_subdirectory(src/time_sync)

## Cirrus Logic
if (CONFIG_HW_CODEC_CIRRUS_LOGIC)
Expand Down
94 changes: 52 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

[OpenEarable](openearable.com) is the world's first fully open-source AI platform for ear-based sensing applications with true wireless audio. Packed with an unprecedented array of high-precision sensors, OpenEarable redefines what's possible in wearable tech. Designed for both development and research applications, OpenEarable is modular, reconfigurable, and built for the future.
<br/><br/><br/>
![image](https://github.com/user-attachments/assets/8cb55571-c6bc-4f51-b2ae-628f7be3661c)
<img width="1323" height="568" alt="image" src="https://github.com/user-attachments/assets/ab4e2b0e-9645-4428-975f-466c7ef2f13b" />


## Table of Contents

Expand Down Expand Up @@ -63,56 +64,65 @@
- Do not set any of the FOTA flags described above.

9. **J-Link Setup**
- Wire your J-Link to the debugging breakout PCB as shown below.
![image](https://github.com/user-attachments/assets/2eeec41e-6be1-4a4f-b986-7d9a07b0f8e5)
- If you do not own a J-Link yet, here are a few options (do **NOT** use J-Link clones, they will not work and are illegal!):
- [J-Link EDU Mini](https://mou.sr/3LrwiVe) (available to educational institutions, private persons, and students) with [JTAG adapter](https://www.adafruit.com/product/2094) and [cable](https://www.adafruit.com/product/1675).
- Full-scale J-Link for commercial use (e.g., [J-Link BASE Compact](https://mou.sr/4oQkAls)).
- ⚠️ The wiring show in the figure above is for the full-scale J-Link pinout. If you use the [JTAG adapter](https://www.adafruit.com/product/2094) the wiring may be different so make sure it is correct in your case! _(to be confirmed, picture coming soon)_.


10. **Build and Flash**
- Wire your J-Link to the debugging breakout PCB as shown below.
![image](https://github.com/user-attachments/assets/2eeec41e-6be1-4a4f-b986-7d9a07b0f8e5)
- If you do not own a J-Link yet, here are a few options (do **NOT** use J-Link clones, they will not work and are illegal!):
- [J-Link EDU Mini](https://mou.sr/3LrwiVe) (available to educational institutions, private persons, and students) with [JTAG adapter](https://www.adafruit.com/product/2094) and [cable](https://www.adafruit.com/product/1675).
- Full-scale J-Link for commercial use (e.g., [J-Link BASE Compact](https://mou.sr/4oQkAls)).
- ⚠️ The wiring show in the figure above is for the full-scale J-Link pinout. If you use the [JTAG adapter](https://www.adafruit.com/product/2094) the wiring may be different so make sure it is correct in your case!.

11. **Build and Flash**
- Click on `Generate and Build` and wait for the application to build (this will take some time)
- Make sure your device is charged or powered via USB. If the battery is fully discharged, the charging management IC will no longer supply power to the MCU from the battery, so you won’t be able to flash the MCU unless the battery is charged or the device is directly powered via USB.
- Open a new terminal in VS Code and run the following command from the root of the `open-earable-v2` directory to flash the FOTA build. Make sure to set the serial number of your J-Link (right click your J-Link in the `CONNECTED DEVICES` tab of the nRF connect extension and copy the serial number).
```bash
# --right for the right ear device, or no flag to retain left/right bonding
# --hw version is optional and can only be used with --left or --right
./tools/flash/flash_fota.sh --snr 123456789 --left --hw 2.0.1

```
```bash
# --right for the right ear device, or no flag to retain left/right bonding, --standalone for no pair
# --hw version is optional and can only be used with --left or --right
./tools/flash/flash_fota.sh --snr 123456789 --left --hw 2.0.1
```

- or without FOTA
```bash
# --right for the right ear device, or no flag to retain left/right bonding
# --hw version is optional and can only be used with --left or --right
./tools/flash/flash.sh --snr 123456789 --left --hw 2.0.1
```
```bash
# --right for the right ear device, or no flag to retain left/right bonding, --standalone for no pair
# --hw version is optional and can only be used with --left or --right

./tools/flash/flash.sh --snr 123456789 --left
```

- The FOTA update script is also available for Windows as `./tools/flash/flash_fota.ps1`. To execute it, open PowerShell with administrative privileges.

11. **Recover Board**
- If the application or network core becomes unresponsive, or you encounter flashing issues, you can recover the board using the recovery script. The `--snr` parameter specifies the serial number of your J-Link debugger.
- Ensure the device is powered via USB or that the battery is sufficiently charged before running the recovery process. Otherwise, the MCU may not power up correctly and the recovery will fail.
```bash
./tools/flash/recover.sh --snr 123456789
```
- After successful recovery, you can attempt to flash the firmware again (you will have to restore left/right bonding and hardware version).
- If the application or network core becomes unresponsive, or you encounter flashing issues, you can recover the board using the recovery script. The `--snr` parameter specifies the serial number of your J-Link debugger.
- Ensure the device is powered via USB or that the battery is sufficiently charged before running the recovery process. Otherwise, the MCU may not power up correctly and the recovery will fail.
```bash
./tools/flash/recover.sh --snr 123456789
```
- After successful recovery, you can attempt to flash the firmware again.

12. **Enable Debug Output**
- Open the **J-Link Configuration** program on your computer.
- On macOS: Press `CMD` + `Space` and search for `J-Link Config`.
- On Windows: Search for the program from the taskbar.
- Ensure your J-Link is connected to your computer.
- In the **Connected via USB** table, locate your J-Link device. Double-click it or right-click and select **Configure**.
- Find the **Virtual COM-Port** option and select **Enable**. Click **OK** to apply the setting.
- Open **Visual Studio Code**.
- In the left sidebar, open the **Extensions** menu.
- Search for and install the [**Serial Monitor**](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-serial-monitor) extension.
- In the top menu bar, click **Terminal → New Terminal**.
- A terminal window will appear at the bottom of VS Code. Open the **Serial Monitor** tab.
- In the **Port** dropdown menu, select your J-Link’s COM port.
- Set the **Baud rate** to **115200**.
- Click **Start Monitoring**.
- Ensure your earable is connected to the debugger probe. You should now see debug output appearing when you interact with the device (e.g., press button).
- Open the **J-Link Configuration** program on your computer.
- On macOS: Press `CMD` + `Space` and search for `J-Link Config`.
- On Windows: Search for the program from the taskbar.
- Ensure your J-Link is connected to your computer.
- In the **Connected via USB** table, locate your J-Link device. Double-click it or right-click and select **Configure**.
- Find the **Virtual COM-Port** option and select **Enable**. Click **OK** to apply the setting.
- Open **Visual Studio Code**.
- In the left sidebar, open the **Extensions** menu.
- Search for and install the [**Serial Monitor**](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-serial-monitor) extension.
- In the top menu bar, click **Terminal → New Terminal**.
- A terminal window will appear at the bottom of VS Code. Open the **Serial Monitor** tab.
- In the **Port** dropdown menu, select your J-Link’s COM port.
- Set the **Baud rate** to **115200**.
- Click **Start Monitoring**.
- Ensure your earable is connected to the debugger probe. You should now see debug output appearing when you interact with the device (e.g., press button).

13. **Recover Board**
- If the application or network core becomes unresponsive, or you encounter flashing issues, you can recover the board using the recovery script. The `--snr` parameter specifies the serial number of your J-Link debugger.
- Ensure the device is powered via USB or that the battery is sufficiently charged before running the recovery process. Otherwise, the MCU may not power up correctly and the recovery will fail.
```bash
./tools/flash/recover.sh --snr 123456789
```
- After successful recovery, you can attempt to flash the firmware again (you will have to restore left/right bonding and hardware version).



Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_MAJOR = 2
VERSION_MINOR = 2
PATCHLEVEL = 1
PATCHLEVEL = 2
VERSION_TWEAK = 0
EXTRAVERSION =
13 changes: 12 additions & 1 deletion include/openearable_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@

#define SENSOR_DATA_FIXED_LENGTH 38


#define millis() k_cyc_to_ms_floor64(k_uptime_ticks())
#define micros() k_cyc_to_us_floor64(k_uptime_ticks())

#ifdef __cplusplus
extern "C" {
#endif
uint64_t oe_micros();
#ifdef __cplusplus
}
#endif
#ifndef micros
#define micros() oe_micros()
#endif

#define load_switch_sd_id DT_NODELABEL(load_switch_sd)
#define load_switch_1_8_id DT_NODELABEL(load_switch)
Expand Down
2 changes: 1 addition & 1 deletion prj_fota.conf
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,4 @@ CONFIG_MCUMGR_GRP_OS_RESET_HOOK=y

#CONFIG_MCUMGR_GRP_SETTINGS_ACCESS_HOOK=y

CONFIG_SETUP_FUEL_GAUGE=y
CONFIG_SETUP_FUEL_GAUGE=y
11 changes: 0 additions & 11 deletions src/ParseInfo/SensorScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@

LOG_MODULE_REGISTER(parse_info_service, CONFIG_LOG_DEFAULT_LEVEL);

static void enable_notifies_handler(struct k_work *work)
{
temp_disable_notifies(false);
}

K_WORK_DELAYABLE_DEFINE(enable_notifies_work, enable_notifies_handler);

static char* parseInfoScheme;
static size_t parseInfoSchemeSize;

Expand All @@ -40,11 +33,7 @@ static ssize_t read_parse_info(struct bt_conn *conn,
void *buf,
uint16_t len,
uint16_t offset) {
temp_disable_notifies(true);
ssize_t ret = bt_gatt_attr_read(conn, attr, buf, len, offset, parseInfoScheme, parseInfoSchemeSize);

// re-enable notifications after a delay
k_work_schedule(&enable_notifies_work, K_MSEC(500));

return ret;
}
Expand Down
32 changes: 15 additions & 17 deletions src/SensorManager/BMA580/BMA580_Sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ int8_t BMA580::get_accel_and_int_settings(struct bma5_dev *dev)
rslt = bma5_set_acc_conf(&acc_cfg, dev);
bma5_check_rslt("bma5_get_acc_conf", rslt);

/*LOG_INF("Accel configurations");
LOG_INF("ODR : %s\t", enum_to_string(acc_cfg.acc_odr));
LOG_INF("Bandwidth : %s\t", enum_to_string(BMA5_ACC_BWP_NORM_AVG4));
LOG_INF("Power mode : %s\t", enum_to_string(BMA5_POWER_MODE_HPM));
LOG_INF("Range : %s\t", enum_to_string(BMA5_ACC_RANGE_MAX_2G));
LOG_INF("IIR RO : %s\t", enum_to_string(BMA5_ACC_IIR_RO_DB_60));
LOG_INF("Noise mode : %s\t", enum_to_string(BMA5_NOISE_MODE_LOWER_POWER));
LOG_INF("Auto Int clear : %s\t", enum_to_string(BMA5_ACC_DRDY_INT_AUTO_CLEAR_DISABLED));*/
/*LOG_DBG("Accel configurations");
LOG_DBG("ODR : %s\t", enum_to_string(acc_cfg.acc_odr));
LOG_DBG("Bandwidth : %s\t", enum_to_string(BMA5_ACC_BWP_NORM_AVG4));
LOG_DBG("Power mode : %s\t", enum_to_string(BMA5_POWER_MODE_HPM));
LOG_DBG("Range : %s\t", enum_to_string(BMA5_ACC_RANGE_MAX_2G));
LOG_DBG("IIR RO : %s\t", enum_to_string(BMA5_ACC_IIR_RO_DB_60));
LOG_DBG("Noise mode : %s\t", enum_to_string(BMA5_NOISE_MODE_LOWER_POWER));
LOG_DBG("Auto Int clear : %s\t", enum_to_string(BMA5_ACC_DRDY_INT_AUTO_CLEAR_DISABLED));*/

/* Enable accel */
sensor_ctrl = BMA5_SENSOR_CTRL_ENABLE;
Expand All @@ -208,7 +208,7 @@ int8_t BMA580::get_accel_and_int_settings(struct bma5_dev *dev)

if (rslt == BMA5_OK)
{
LOG_INF("Accel enabled");
LOG_DBG("Accel enabled");
}

rslt = bma5_get_acc_conf_0(&sensor_ctrl, dev);
Expand All @@ -227,10 +227,10 @@ int8_t BMA580::get_accel_and_int_settings(struct bma5_dev *dev)
rslt = bma5_set_int_conf(&int_config, n_ints, dev);
bma5_check_rslt("bma5_set_int_conf", rslt);

/*LOG_INF("\nInt Configurations");
LOG_INF("INT2 mode : %s\t", enum_to_string(BMA5_INT2_MODE_LATCHED));
LOG_INF("INT2 OD : %s\t", enum_to_string(BMA5_INT2_OD_PUSH_PULL));
LOG_INF("INT2 level : %s\t", enum_to_string(BMA5_INT2_LVL_ACTIVE_HIGH));*/
/*LOG_DBG("\nInt Configurations");
LOG_DBG("INT2 mode : %s\t", enum_to_string(BMA5_INT2_MODE_LATCHED));
LOG_DBG("INT2 OD : %s\t", enum_to_string(BMA5_INT2_OD_PUSH_PULL));
LOG_DBG("INT2 level : %s\t", enum_to_string(BMA5_INT2_LVL_ACTIVE_HIGH));*/

return rslt;
}
Expand Down Expand Up @@ -261,9 +261,7 @@ int BMA580::init(int odr, int fifo_watermark_level) {
//struct bma5_fifo_conf fifo_conf;

/* Assign context parameter selection */
enum bma5_context context;

context = BMA5_HEARABLE;
enum bma5_context context = BMA5_HEARABLE;

_odr = odr;

Expand All @@ -276,7 +274,7 @@ int BMA580::init(int odr, int fifo_watermark_level) {

rslt = bma580_init(&dev);
bma5_check_rslt("bma580_init", rslt);
LOG_INF("Chip ID :0x%X", dev.chip_id);
LOG_DBG("Chip ID :0x%X", dev.chip_id);

/* Map generic interrupts to hardware interrupt pin of the sensor */
rslt = bma580_get_int_map(&int_map, &dev);
Expand Down
9 changes: 9 additions & 0 deletions src/SensorManager/Baro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Adafruit_BMP3XX Baro::bmp;

Baro Baro::sensor;

static int baro_initial_discard = 1;

// Initialisierung der SampleRateSettings für Baro (BMP3)
const SampleRateSetting<18> Baro::sample_rates = {
{ BMP3_ODR_0_001_HZ, BMP3_ODR_0_003_HZ, BMP3_ODR_0_006_HZ, BMP3_ODR_0_01_HZ,
Expand All @@ -37,6 +39,11 @@ void Baro::update_sensor(struct k_work *work) {

bmp.performReading();

if (baro_initial_discard > 0) {
baro_initial_discard--;
return;
}

msg_baro.sd = sensor._sd_logging;
msg_baro.stream = sensor._ble_stream;

Expand Down Expand Up @@ -84,6 +91,8 @@ bool Baro::init(struct k_msgq * queue) {
}

void Baro::start(int sample_rate_idx) {
baro_initial_discard = 1;

k_timeout_t t = K_USEC(1e6 / sample_rates.true_sample_rates[sample_rate_idx]);

//bmp.set_interrogation_rate(setting.reg_val);
Expand Down
4 changes: 3 additions & 1 deletion src/SensorManager/BoneConduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ void BoneConduction::update_sensor(struct k_work *work) {

msg_bc.data.id = ID_BONE_CONDUCTION;
msg_bc.data.size = to_write * _size + sizeof(uint16_t);
msg_bc.data.time = _time_stamp - (num_samples - written) * BoneConduction::sensor.t_sample_us;

uint64_t dt_us = (uint64_t)((double)(num_samples - written) * (double)BoneConduction::sensor.t_sample_us);
msg_bc.data.time = _time_stamp - dt_us;

if (to_write > 1) {
uint16_t t_diff = BoneConduction::sensor.t_sample_us;
Expand Down
4 changes: 3 additions & 1 deletion src/SensorManager/PPG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ void PPG::update_sensor(struct k_work *work) {

msg_ppg.data.id = ID_PPG;
msg_ppg.data.size = to_write * _size + sizeof(uint16_t);
msg_ppg.data.time = _time_stamp - (num_samples - written) * PPG::sensor.t_sample_us;

const uint64_t dt_us = (uint64_t)((double)(num_samples - written) * (double)PPG::sensor.t_sample_us);
msg_ppg.data.time = _time_stamp - dt_us;

if (to_write > 1) {
uint16_t t_diff = PPG::sensor.t_sample_us;
Expand Down
Empty file removed src/audio/anc_fxlms_wrapper.cpp
Empty file.
Empty file removed src/audio/anc_fxlms_wrapper.h
Empty file.
6 changes: 6 additions & 0 deletions src/audio/audio_datapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,11 @@ static void alt_buffer_free_both(void)
alt.buf_1_in_use = false;
}

__attribute__((weak)) void bt_mgmt_report_audio_underrun(uint32_t count) {
LOG_ERR("Audio underrun reported to bt_mgmt");
}


/*
* This handler function is called every time I2S needs new buffers for
* TX and RX data.
Expand Down Expand Up @@ -792,6 +797,7 @@ static void audio_datapath_i2s_blk_complete(uint32_t frame_start_ts_us, uint32_t
underrun_condition = false;
LOG_WRN("Data received, total under-runs: %d",
ctrl_blk.out.total_blk_underruns);
bt_mgmt_report_audio_underrun(ctrl_blk.out.total_blk_underruns);
}

tx_buf = (uint8_t *)&ctrl_blk.out
Expand Down
3 changes: 3 additions & 0 deletions src/bluetooth/bt_management/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ zephyr_library_include_directories(

target_sources(app PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/bt_mgmt.c
${CMAKE_CURRENT_SOURCE_DIR}/bt_mgmt_conn_interval.cpp
${CMAKE_CURRENT_SOURCE_DIR}/controller_config/bt_mgmt_ctlr_cfg.c
${CMAKE_CURRENT_SOURCE_DIR}/conn_interval/conn_intvl_exp_backoff_lin_inc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/conn_interval/conn_intvl_linear.cpp
)

if (CONFIG_BT_CENTRAL)
Expand Down
9 changes: 8 additions & 1 deletion src/bluetooth/bt_management/bt_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "bt_mgmt_ctlr_cfg_internal.h"
#include "bt_mgmt_adv_internal.h"
#include "bt_mgmt_dfu_internal.h"
#include "bt_mgmt_conn_interval.h"

#include "BootState.h"

Expand Down Expand Up @@ -87,6 +88,8 @@ static void conn_params_updated(struct bt_conn *conn, uint16_t interval, uint16_

LOG_INF("Conn params updated: interval %d unit, latency %d, timeout: %d0 ms",interval, latency, timeout);

bt_mgmt_ci_on_conn_param_updated(conn, interval, latency, timeout);

/*msg.event = BT_MGMT_CONNECTED;
msg.conn = conn;

Expand Down Expand Up @@ -162,14 +165,18 @@ static void connected_cb(struct bt_conn *conn, uint8_t err)
LOG_ERR("Cannot update conneciton parameter (err: %d)", err);
return err;
}
LOG_INF("Connection parameters update requested");
LOG_INF("Connection parameters update requested: interval_min %d interval_max %d latency %d timeout %d",
conn_param->interval_min, conn_param->interval_max,
conn_param->latency, conn_param->timeout);
bt_mgmt_ci_on_connected(conn);

if (IS_ENABLED(CONFIG_BT_CENTRAL)) {
ret = bt_conn_set_security(conn, BT_SECURITY_L2);
if (ret) {
LOG_ERR("Failed to set security to L2: %d", ret);
}
}

}

K_MUTEX_DEFINE(mtx_duplicate_scan);
Expand Down
Loading