Skip to content

Commit 3b46c6d

Browse files
author
mkuettner97
committed
fix stream control with button
1 parent 94eb2b3 commit 3b46c6d

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

src/audio/streamctrl.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ static void button_msg_sub_thread(void)
8080
LOG_DBG("Got btn evt from queue - id = %d, action = %d", msg.button_pin,
8181
msg.button_action);
8282

83-
if (msg.button_action != BUTTON_PRESS) {
83+
if (msg.button_action != BUTTON_RELEASED) {
8484
LOG_WRN("Unhandled button action");
85-
return;
85+
continue;
8686
}
8787

8888
switch (msg.button_pin) {
@@ -562,20 +562,14 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, st
562562
ad->data += len - 1;
563563
ad->len -= len - 1;
564564

565-
//printk("test\n");
566-
567565
// Suchen nach 16-bit Service UUIDs (LE Audio Services)
568-
if (type == BT_DATA_SVC_DATA16) { //BT_DATA_UUID16_SOME || type == BT_DATA_UUID16_ALL) {
569-
//printk("LE Audio-Gerät gefunden! UUID\n");
570-
//printk("type 0x%04X ", type);
566+
if (type == BT_DATA_SVC_DATA16) {
571567
for (size_t i = 0; i < len - 1; i += 2) {
572568
uint16_t uuid = (data[i + 1] << 8) | data[i];
573569
if (uuid == BT_UUID_CAS_VAL) {
574570
is_le_audio_device = true;
575-
//printk("LE Audio-Gerät gefunden! UUID: 0x%04X\n", uuid);
576571
}
577572
}
578-
//printk("\n");
579573
}
580574

581575
if (is_le_audio_device && type == BT_DATA_MANUFACTURER_DATA) {
@@ -596,9 +590,8 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, st
596590
if (is_le_audio_device) {
597591
LOG_INF("LE Audio-Gerät gefunden! UUID\n");
598592

599-
// printk("MANUFACTURER DATA 0x%s\n", bt_hex(chip_id, sizeof(chip_id)));
600-
601-
// printk("CSIS DATA 0x%s\n", bt_hex(csis_rsi, sizeof(csis_rsi)));
593+
// LOG_INF("MANUFACTURER DATA 0x%s\n", bt_hex(chip_id, sizeof(chip_id)));
594+
// LOG_INF("CSIS DATA 0x%s\n", bt_hex(csis_rsi, sizeof(csis_rsi)));
602595

603596
uint32_t hash_ref = (csis_rsi[2] << 16) | (csis_rsi[1] << 8) | csis_rsi[0];
604597
uint32_t hash;

0 commit comments

Comments
 (0)