Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-11-05 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1382876547


##
nimble/host/services/auracast/syscfg.yml:
##
@@ -0,0 +1,29 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+syscfg.defs:
+  BLE_SVC_AURACAST_ADV_INSTANCE:
+description: >
+  Defines which advertising instance is used for Auracast.
+  If set to -1 last advertising instance is used, and if MESH is enabled, 
one before that.

Review Comment:
   For broadcast, we can choose. For Auracast user has freedom to define single 
instance (for now) to be used, OR give up this decision to package. This can 
simplify process of writting apps, especially simple ones



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-11-05 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1382875227


##
nimble/host/services/auracast/syscfg.yml:
##
@@ -0,0 +1,29 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+syscfg.defs:
+  BLE_SVC_AURACAST_ADV_INSTANCE:
+description: >
+  Defines which advertising instance is used for Auracast.
+  If set to -1 last advertising instance is used, and if MESH is enabled, 
one before that.
+  Must be set to value in range 0 .. BLE_MULTI_ADV_INSTANCES.

Review Comment:
   changed to -1 .. BLE



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-11-05 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1382874426


##
porting/examples/linux/include/syscfg/syscfg.h:
##
@@ -771,6 +783,14 @@
 #define MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS (1)
 #endif
 
+#ifndef MYNEWT_VAL_BLE_MAX_BIG
+#define MYNEWT_VAL_BLE_MAX_BIG (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES)
+#endif
+
+#ifndef MYNEWT_VAL_BLE_MAX_BIS
+#define MYNEWT_VAL_BLE_MAX_BIS (4)

Review Comment:
   As for now, total. I have nothing against changing it to per BIG, I feel 
like both approaches are  valid



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-11-05 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1382818277


##
apps/btshell/src/btshell.h:
##
@@ -182,6 +185,36 @@ int btshell_l2cap_send(uint16_t conn, uint16_t idx, 
uint16_t bytes);
 int btshell_l2cap_reconfig(uint16_t conn_handle, uint16_t mtu,
uint8_t num, uint8_t idxs[]);
 
+#if (MYNEWT_VAL(BLE_ISO_BROADCASTER))
+int btshell_broadcast_base_add(uint8_t adv_instance, uint32_t 
presentation_delay);

Review Comment:
   So the flow is like that:
   1. `base_add` (calls `btshell_broadcast_base_add`) - allocates memory for 
`ble_audio_base`, `ble_iso_big_params`. Sets `presentation_delay` and 
`adv_instance` to base
   2. `big_sub_add` (calls `btshell_broadcast_big_sub_add`) - adds subgroup to 
BASE identified by `adv_instance` (allocates memory, sets fields)
   3. `bis_add` (calls `btshell_broadcast_bis_add`) - similar to `big_sub_add`, 
but for BIS. Adds bis to last added subgroup in BIG identified by `adv_instance`
   4. `broadcast_create` (calls `btshell_broadcast_create` - basically calls 
`ble_audio_broadcast_create`. Here EA and PA params are set, instance 
configured with both advertisements.
   5. `broadcast_start` (calls `btshell_broadcast_start`) - this finally calls 
`ble_audio_broadcast_start`, so EA, PA are started. `ble_iso_create_big` is 
also called, and BIG Info advertisements start to broadcast
   6. In shell, I haven't added data stream flow to BISes. I'm not sure how 
this could be done in shell to make sense. I'm preparing standalone demo that 
does all this, in similar way extended_advertiser demo does. So at this point 
app has to have some routine (like loop or thread) that calls `ble_iso_tx`, 
with payload. For BIS `conn_handle` for this function is BIS handle.
   7. At this point broadcast can be stopped (`broadcast_stop`), destroyed 
(`broadcast_destroy`) or updated (`broadcast_update`).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-11-05 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1382803599


##
apps/btshell/src/btshell.h:
##
@@ -182,6 +185,36 @@ int btshell_l2cap_send(uint16_t conn, uint16_t idx, 
uint16_t bytes);
 int btshell_l2cap_reconfig(uint16_t conn_handle, uint16_t mtu,
uint8_t num, uint8_t idxs[]);
 
+#if (MYNEWT_VAL(BLE_ISO_BROADCASTER))
+int btshell_broadcast_base_add(uint8_t adv_instance, uint32_t 
presentation_delay);

Review Comment:
   Broadcast ID is indeed unique ID. Internally identifying broadcast with 
adv_instance (which is also used as BIG ID) saves memory. And AFAIK each adv 
instance can be only used for single broadcast either way - because it needs to 
have corelated Ext Adv and PA, and this cannot be started on already active 
instance. This means, you cannot start another broadcast on same instance.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-11-03 Thread via GitHub


kolodgrz commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1381784263


##
apps/btshell/src/btshell.h:
##
@@ -182,6 +185,36 @@ int btshell_l2cap_send(uint16_t conn, uint16_t idx, 
uint16_t bytes);
 int btshell_l2cap_reconfig(uint16_t conn_handle, uint16_t mtu,
uint8_t num, uint8_t idxs[]);
 
+#if (MYNEWT_VAL(BLE_ISO_BROADCASTER))
+int btshell_broadcast_base_add(uint8_t adv_instance, uint32_t 
presentation_delay);

Review Comment:
   This is original concept to identify broadcast with adv_instance. Can one 
advertising instance be used for "multiple" purposes in context of one program 
? Broadcast ID seems to be an unique ID



##
apps/btshell/src/btshell.h:
##
@@ -182,6 +185,36 @@ int btshell_l2cap_send(uint16_t conn, uint16_t idx, 
uint16_t bytes);
 int btshell_l2cap_reconfig(uint16_t conn_handle, uint16_t mtu,
uint8_t num, uint8_t idxs[]);
 
+#if (MYNEWT_VAL(BLE_ISO_BROADCASTER))
+int btshell_broadcast_base_add(uint8_t adv_instance, uint32_t 
presentation_delay);

Review Comment:
   What this method is doing ? Isn't this a "StartBasicAudioAnnouncement" 
function ? not sure about having here presentation delay. Where is the "real" 
BASE prepared ? 
   
   What's the flow ? How to start from scratch a broadcast ?
   1. Who prepares Broadcast Audio Announcement
   2. Who prepares Broadcast Source Audio Endpoint
   3. Where it'll be attached to EA, PA
   4. Where EA, PA would be started
   5. Where data would be bind to BISes
   ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-11-03 Thread via GitHub


kolodgrz commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1381533180


##
porting/examples/linux/include/syscfg/syscfg.h:
##
@@ -771,6 +783,14 @@
 #define MYNEWT_VAL_BLE_L2CAP_SIG_MAX_PROCS (1)
 #endif
 
+#ifndef MYNEWT_VAL_BLE_MAX_BIG
+#define MYNEWT_VAL_BLE_MAX_BIG (MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES)
+#endif
+
+#ifndef MYNEWT_VAL_BLE_MAX_BIS
+#define MYNEWT_VAL_BLE_MAX_BIS (4)

Review Comment:
   it's per BIG ? or total ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-11-03 Thread via GitHub


kolodgrz commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1381423584


##
nimble/host/services/auracast/syscfg.yml:
##
@@ -0,0 +1,29 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+syscfg.defs:
+  BLE_SVC_AURACAST_ADV_INSTANCE:
+description: >
+  Defines which advertising instance is used for Auracast.
+  If set to -1 last advertising instance is used, and if MESH is enabled, 
one before that.
+  Must be set to value in range 0 .. BLE_MULTI_ADV_INSTANCES.

Review Comment:
   If -1 is valid value why "Must be ... 0 .. BLE" ?



##
nimble/host/services/auracast/syscfg.yml:
##
@@ -0,0 +1,29 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+syscfg.defs:
+  BLE_SVC_AURACAST_ADV_INSTANCE:
+description: >
+  Defines which advertising instance is used for Auracast.
+  If set to -1 last advertising instance is used, and if MESH is enabled, 
one before that.

Review Comment:
   What is the reason for defining in configuring which advertising instance 
should be used ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-31 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1377493139


##
nimble/syscfg.yml:
##
@@ -81,7 +81,7 @@ syscfg.defs:
 This allows to configure maximum size of advertising data and
 scan response data used in LE Advertising Extensions.
 Valid range 31-1650.
-value: 31
+value: 251

Review Comment:
   I'll double check if this needs to be changed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


andrzej-kaczmarek commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1376149248


##
nimble/syscfg.yml:
##
@@ -81,7 +81,7 @@ syscfg.defs:
 This allows to configure maximum size of advertising data and
 scan response data used in LE Advertising Extensions.
 Valid range 31-1650.
-value: 31
+value: 251

Review Comment:
   also if this is required by some feature we should better make 251 
conditional depending on that feature, this way default configuration is not 
changed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375863742


##
nimble/host/src/ble_audio_common.c:
##
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "host/ble_audio_common.h"
+#include 
+
+int ble_audio_build_codec_config(const struct ble_audio_codec_config_params

Review Comment:
   change into macro



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375839326


##
nimble/host/src/ble_audio_common.c:
##
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "host/ble_audio_common.h"
+#include 
+
+int ble_audio_build_codec_config(const struct ble_audio_codec_config_params
+ *params,
+ uint8_t *codec_config_out,
+ uint8_t *codec_config_out_len)
+{
+uint8_t len = 0;
+
+memcpy(codec_config_out, >sampling_freq, 1);

Review Comment:
   I don't know how I missed this. Also, I'll try to add this to shell



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375835230


##
nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h:
##
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_audio_common.h"
+#include "host/ble_audio_broadcast.h"
+
+struct ble_svc_auracast_create_params {
+struct ble_audio_base *base;
+struct ble_iso_big_params *big_params;
+const char *name;
+uint8_t adv_instance;

Review Comment:
   It chooses it by itself, like we do for ext adv and PA. So we may expect 
that it remembers what it chose.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375834014


##
nimble/syscfg.yml:
##
@@ -81,7 +81,7 @@ syscfg.defs:
 This allows to configure maximum size of advertising data and
 scan response data used in LE Advertising Extensions.
 Valid range 31-1650.
-value: 31
+value: 251

Review Comment:
   if we want to change this, it should be separate patch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375830783


##
nimble/host/src/ble_audio_common.c:
##
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "host/ble_audio_common.h"
+#include 
+
+int ble_audio_build_codec_config(const struct ble_audio_codec_config_params
+ *params,
+ uint8_t *codec_config_out,
+ uint8_t *codec_config_out_len)
+{
+uint8_t len = 0;
+
+memcpy(codec_config_out, >sampling_freq, 1);

Review Comment:
   shouldn't it build LTVs ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375823634


##
nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h:
##
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_audio_common.h"
+#include "host/ble_audio_broadcast.h"
+
+struct ble_svc_auracast_create_params {

Review Comment:
   If we want this field I can add it, like there is in 
`ble_broadcast_create_params`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375819421


##
nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h:
##
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_audio_common.h"
+#include "host/ble_audio_broadcast.h"
+
+struct ble_svc_auracast_create_params {
+struct ble_audio_base *base;
+struct ble_iso_big_params *big_params;
+const char *name;
+uint8_t adv_instance;

Review Comment:
   how application knows `adv_instnace` ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375819421


##
nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h:
##
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_audio_common.h"
+#include "host/ble_audio_broadcast.h"
+
+struct ble_svc_auracast_create_params {
+struct ble_audio_base *base;
+struct ble_iso_big_params *big_params;
+const char *name;
+uint8_t adv_instance;

Review Comment:
   how application knows `adv_instance` ?  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375818275


##
nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h:
##
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_audio_common.h"
+#include "host/ble_audio_broadcast.h"
+
+struct ble_svc_auracast_create_params {

Review Comment:
   do you mean additional service data to `Broadcast Audio Announcement Service 
UUID` ?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375806874


##
nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h:
##
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_audio_common.h"
+#include "host/ble_audio_broadcast.h"
+
+struct ble_svc_auracast_create_params {
+struct ble_audio_base *base;
+struct ble_iso_big_params *big_params;
+const char *name;
+uint8_t adv_instance;
+};
+
+/**
+ * @brief Create Auracast Endpoint and configure advertising instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for Auracast broadcast.
+ *
+ * @param[in] paramsPointer to a `ble_svc_auracast_create_params`
+ *  structure that defines BIG and broadcast name.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  Auracast advertisement.
+ * @param[in] destroy_cbOptional callback to be called when Auracast
+ *  advertisement is destroyed.

Review Comment:
   That is true, BAP allows that. But for Public Broadcaster we want to make 
sure broadcast source is visible :) therefore PA will be there whenever 
auracast is created.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375800333


##
nimble/host/include/host/ble_audio_common.h:
##
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_COMMON_
+#define H_BLE_AUDIO_COMMON_
+
+#include "stdint.h"
+#include "os/queue.h"
+
+#define BLE_BROADCAST_AUDIO_ANNOUNCEMENT_SVC_UUID   0x1852
+
+#define BLE_BROADCAST_SAMPLING_RATE_8000_HZ   BIT(0)
+#define BLE_BROADCAST_SAMPLING_RATE_11025_HZ  BIT(1)
+#define BLE_BROADCAST_SAMPLING_RATE_16000_HZ  BIT(2)
+#define BLE_BROADCAST_SAMPLING_RATE_22050_HZ  BIT(3)
+#define BLE_BROADCAST_SAMPLING_RATE_24000_HZ  BIT(4)
+#define BLE_BROADCAST_SAMPLING_RATE_32000_HZ  BIT(5)
+#define BLE_BROADCAST_SAMPLING_RATE_44100_HZ  BIT(6)
+#define BLE_BROADCAST_SAMPLING_RATE_48000_HZ  BIT(7)
+#define BLE_BROADCAST_SAMPLING_RATE_88200_HZ  BIT(8)
+#define BLE_BROADCAST_SAMPLING_RATE_96000_HZ  BIT(9)
+#define BLE_BROADCAST_SAMPLING_RATE_176400_HZ BIT(10)
+#define BLE_BROADCAST_SAMPLING_RATE_192000_HZ BIT(11)
+#define BLE_BROADCAST_SAMPLING_RATE_384000_HZ BIT(12)
+
+#define BLE_BROADCAST_SUPPORTED_FRAME_DURATION_7_5_MS BIT(0)
+#define BLE_BROADCAST_SUPPORTED_FRAME_DURATION_10_MS  BIT(1)
+
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_LEFT   BIT(0)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_RIGHT  BIT(1)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_CENTER BIT(2)
+#define BLE_BROADCAST_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1   BIT(3)
+#define BLE_BROADCAST_AUDIO_LOCATION_BACK_LEFTBIT(4)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_LEFT_CENTERBIT(5)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_RIGHT_CENTER   BIT(6)
+#define BLE_BROADCAST_AUDIO_LOCATION_BACK_CENTER  BIT(7)
+#define BLE_BROADCAST_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2   BIT(8)
+#define BLE_BROADCAST_AUDIO_LOCATION_SIDE_LEFTBIT(9)
+#define BLE_BROADCAST_AUDIO_LOCATION_SIDE_RIGHT   BIT(10)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_FRONT_LEFT   BIT(11)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_FRONT_RIGHT  BIT(12)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_FRONT_CENTER BIT(13)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_CENTER   BIT(14)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_BACK_LEFTBIT(15)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_BACK_RIGHT   BIT(16)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_SIDE_LEFTBIT(17)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_SIDE_RIGHT   BIT(18)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_BACK_CENTER  BIT(19)
+#define BLE_BROADCAST_AUDIO_LOCATION_BOTTOM_FRONT_CENTER  BIT(20)
+#define BLE_BROADCAST_AUDIO_LOCATION_BOTTOM_FRONT_LEFTBIT(21)
+#define BLE_BROADCAST_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT   BIT(22)
+#define BLE_BROADCAST_AUDIO_LOCATION_LEFT_SURROUNDBIT(23)
+#define BLE_BROADCAST_AUDIO_LOCATION_RIGHT_SURROUND   BIT(24)
+
+struct ble_audio_codec_id {
+/** Coding Fromat */
+uint8_t format;
+
+/** Company ID */
+uint16_t company_id;
+
+/** Vendor Specific Codec ID */
+uint16_t vendor_specific;
+};
+
+struct ble_audio_bis {

Review Comment:
   agree with @KKopyscinski 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375798515


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,244 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** Broadcast Audio Source Endpoint */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_create(const struct ble_broadcast_create_params
+   *params,
+   ble_audio_broadcast_destroy_fn *destroy_cb,
+   void *args,
+   ble_gap_event_fn *gap_cb);
+
+/**
+ * @brief Start advertisements for given BASE configuration
+ *
+ * This function starts BASE advertisement by enabling extended,  periodic
+ * and BIGInfo advertisements for this instance.
+ *
+ * @param[in] adv_instance  Advertising instance used by broadcast.
+ * @param[in] cbPointer to an ISO event handler.
+ * @param[in] cb_argArguments to an ISO event handler.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_start(uint8_t adv_instance,
+  ble_iso_event_fn *cb, void *cb_arg);
+
+/**
+ * @brief Stop advertisements for given BASE configuration
+ *
+ * This function stops BASE advertisement by disabling extended and periodic
+ * advertising. Advertising instance is still configured and ready for resume.
+ *
+ * @param[in] adv_instance  Advertising instance used by broadcast.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_stop(uint8_t adv_instance);
+
+/**
+ * @brief Destroy advertisements for given BASE 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375796707


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE

Review Comment:
   yes, I'll change description to be more precise



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375795608


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE

Review Comment:
   I believe this callback is called when `ble_audio_broadcast_destroy` is 
called. Is that correct?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375769855


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */

Review Comment:
   Yes, it should be advertising instance.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-30 Thread via GitHub


rymanluk commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1375768771


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;

Review Comment:
   @KKopyscinski  the limitation is coming from here:
   
   https://www.bluetooth.com/specifications/pbp-1-0/
   
   5.1. Broadcast Name Data AD Type
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371326238


##
nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h:
##
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_audio_common.h"
+#include "host/ble_audio_broadcast.h"
+
+struct ble_svc_auracast_create_params {
+struct ble_audio_base *base;
+struct ble_iso_big_params *big_params;
+const char *name;
+uint8_t adv_instance;
+};
+
+/**
+ * @brief Create Auracast Endpoint and configure advertising instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for Auracast broadcast.
+ *
+ * @param[in] paramsPointer to a `ble_svc_auracast_create_params`
+ *  structure that defines BIG and broadcast name.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  Auracast advertisement.
+ * @param[in] destroy_cbOptional callback to be called when Auracast
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with
+ *  Auracast advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_svc_auracast_create(const struct
+ble_svc_auracast_create_params *params,
+struct ble_broadcast_base_config *config_out,

Review Comment:
   I agree and my response is also the same :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371324815


##
nimble/host/include/host/ble_iso.h:
##
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_ISO_
+#define H_BLE_ISO_
+#include "syscfg/syscfg.h"
+
+#if MYNEWT_VAL(BLE_ISO)
+
+/** ISO event: BIG Create Completed */
+#define BLE_ISO_EVENT_BIG_CREATE_COMPLETE  0
+
+/** ISO event: BIG Terminate Completed */
+#define BLE_ISO_EVENT_BIG_TERMINATE_COMPLETE   0
+
+#include 
+
+struct ble_iso_big_desc
+{
+uint8_t big_handle;
+uint32_t big_sync_delay;
+uint32_t transport_latency_big;
+uint8_t phy;
+uint8_t nse;
+uint8_t bn;
+uint8_t pto;
+uint8_t irc;
+uint16_t max_pdu;
+uint16_t iso_interval;
+uint8_t num_bis;
+uint16_t conn_handle[MYNEWT_VAL(BLE_MAX_BIS)];
+};
+
+/**
+ * Represents a ISO-related event.  When such an event occurs, the host
+ * notifies the application by passing an instance of this structure to an
+ * application-specified callback.
+ */
+struct ble_iso_event {
+/**
+ * Indicates the type of ISO event that occurred.  This is one of the
+ * BLE_ISO_EVENT codes.
+ */
+uint8_t type;
+
+/**
+ * A discriminated union containing additional details concerning the ISO
+ * event.  The 'type' field indicates which member of the union is valid.
+ */
+union {
+/**
+ * Represents a completion of BIG creation. Valid for the following
+ * event types:
+ * o BLE_ISO_EVENT_BIG_CREATE_COMPLETE
+ */
+struct {
+struct ble_iso_big_desc desc;
+} big_created;
+
+/**
+ * Represents a completion of BIG termination. Valid for the following
+ * event types:
+ * o BLE_ISO_EVENT_BIG_TERMINATE_COMPLETE
+ */
+struct {
+uint16_t big_handle;
+uint8_t reason;
+} big_terminated;
+};
+};
+
+typedef int ble_iso_event_fn(struct ble_iso_event *event, void *arg);
+
+struct ble_iso_big_params {
+uint32_t sdu_interval;
+uint16_t max_sdu;
+uint16_t max_transport_latency;
+uint8_t rtn;
+uint8_t phy;
+uint8_t packing;
+uint8_t framing;
+uint8_t encryption;
+const char *broadcast_code;
+};
+
+struct ble_iso_create_big_params {
+uint16_t adv_handle;
+uint8_t bis_cnt;
+ble_iso_event_fn *cb;
+void *cb_arg;
+};
+
+int ble_iso_create_big(const struct ble_iso_create_big_params *create_params,
+   const struct ble_iso_big_params *big_params);
+
+int ble_iso_terminate_big(uint8_t big_id);
+
+void
+ble_gap_rx_create_big_complete(const struct

Review Comment:
   this should change prefix to ble_iso, and be moved to src/ble_iso_priv.h 
(must be created). It's for handling HCI event



##
nimble/host/include/host/ble_iso.h:
##
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_ISO_
+#define H_BLE_ISO_
+#include "syscfg/syscfg.h"
+
+#if MYNEWT_VAL(BLE_ISO)
+
+/** ISO event: BIG Create Completed */
+#define BLE_ISO_EVENT_BIG_CREATE_COMPLETE  0
+
+/** ISO event: BIG Terminate Completed */
+#define BLE_ISO_EVENT_BIG_TERMINATE_COMPLETE   0
+
+#include 
+
+struct ble_iso_big_desc
+{
+uint8_t big_handle;
+uint32_t big_sync_delay;
+uint32_t 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371315040


##
nimble/host/include/host/ble_audio_common.h:
##
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_COMMON_
+#define H_BLE_AUDIO_COMMON_
+
+#include "stdint.h"
+#include "os/queue.h"
+
+#define BLE_BROADCAST_AUDIO_ANNOUNCEMENT_SVC_UUID   0x1852
+
+#define BLE_BROADCAST_SAMPLING_RATE_8000_HZ   BIT(0)
+#define BLE_BROADCAST_SAMPLING_RATE_11025_HZ  BIT(1)
+#define BLE_BROADCAST_SAMPLING_RATE_16000_HZ  BIT(2)
+#define BLE_BROADCAST_SAMPLING_RATE_22050_HZ  BIT(3)
+#define BLE_BROADCAST_SAMPLING_RATE_24000_HZ  BIT(4)
+#define BLE_BROADCAST_SAMPLING_RATE_32000_HZ  BIT(5)
+#define BLE_BROADCAST_SAMPLING_RATE_44100_HZ  BIT(6)
+#define BLE_BROADCAST_SAMPLING_RATE_48000_HZ  BIT(7)
+#define BLE_BROADCAST_SAMPLING_RATE_88200_HZ  BIT(8)
+#define BLE_BROADCAST_SAMPLING_RATE_96000_HZ  BIT(9)
+#define BLE_BROADCAST_SAMPLING_RATE_176400_HZ BIT(10)
+#define BLE_BROADCAST_SAMPLING_RATE_192000_HZ BIT(11)
+#define BLE_BROADCAST_SAMPLING_RATE_384000_HZ BIT(12)
+
+#define BLE_BROADCAST_SUPPORTED_FRAME_DURATION_7_5_MS BIT(0)
+#define BLE_BROADCAST_SUPPORTED_FRAME_DURATION_10_MS  BIT(1)
+
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_LEFT   BIT(0)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_RIGHT  BIT(1)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_CENTER BIT(2)
+#define BLE_BROADCAST_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1   BIT(3)
+#define BLE_BROADCAST_AUDIO_LOCATION_BACK_LEFTBIT(4)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_LEFT_CENTERBIT(5)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_RIGHT_CENTER   BIT(6)
+#define BLE_BROADCAST_AUDIO_LOCATION_BACK_CENTER  BIT(7)
+#define BLE_BROADCAST_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2   BIT(8)
+#define BLE_BROADCAST_AUDIO_LOCATION_SIDE_LEFTBIT(9)
+#define BLE_BROADCAST_AUDIO_LOCATION_SIDE_RIGHT   BIT(10)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_FRONT_LEFT   BIT(11)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_FRONT_RIGHT  BIT(12)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_FRONT_CENTER BIT(13)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_CENTER   BIT(14)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_BACK_LEFTBIT(15)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_BACK_RIGHT   BIT(16)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_SIDE_LEFTBIT(17)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_SIDE_RIGHT   BIT(18)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_BACK_CENTER  BIT(19)
+#define BLE_BROADCAST_AUDIO_LOCATION_BOTTOM_FRONT_CENTER  BIT(20)
+#define BLE_BROADCAST_AUDIO_LOCATION_BOTTOM_FRONT_LEFTBIT(21)
+#define BLE_BROADCAST_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT   BIT(22)
+#define BLE_BROADCAST_AUDIO_LOCATION_LEFT_SURROUNDBIT(23)
+#define BLE_BROADCAST_AUDIO_LOCATION_RIGHT_SURROUND   BIT(24)
+
+struct ble_audio_codec_id {
+/** Coding Fromat */
+uint8_t format;
+
+/** Company ID */
+uint16_t company_id;
+
+/** Vendor Specific Codec ID */
+uint16_t vendor_specific;
+};
+
+struct ble_audio_bis {
+/** Pointer to next BIS in subgroup */
+STAILQ_ENTRY(ble_audio_bis) next;
+
+/** BIS index */
+uint8_t idx;
+
+/** BIS level Codec Specific Configuration */
+uint8_t codec_spec_config_len;
+
+/** BIS level Codec Specific Configuration length */
+uint8_t *codec_spec_config;
+};
+
+struct ble_audio_subgroup {
+/** Pointer to next subgroup in BIG */
+

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371275680


##
nimble/host/include/host/ble_audio_common.h:
##
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_COMMON_
+#define H_BLE_AUDIO_COMMON_
+
+#include "stdint.h"
+#include "os/queue.h"
+
+#define BLE_BROADCAST_AUDIO_ANNOUNCEMENT_SVC_UUID   0x1852
+
+#define BLE_BROADCAST_SAMPLING_RATE_8000_HZ   BIT(0)
+#define BLE_BROADCAST_SAMPLING_RATE_11025_HZ  BIT(1)
+#define BLE_BROADCAST_SAMPLING_RATE_16000_HZ  BIT(2)
+#define BLE_BROADCAST_SAMPLING_RATE_22050_HZ  BIT(3)
+#define BLE_BROADCAST_SAMPLING_RATE_24000_HZ  BIT(4)
+#define BLE_BROADCAST_SAMPLING_RATE_32000_HZ  BIT(5)
+#define BLE_BROADCAST_SAMPLING_RATE_44100_HZ  BIT(6)
+#define BLE_BROADCAST_SAMPLING_RATE_48000_HZ  BIT(7)
+#define BLE_BROADCAST_SAMPLING_RATE_88200_HZ  BIT(8)
+#define BLE_BROADCAST_SAMPLING_RATE_96000_HZ  BIT(9)
+#define BLE_BROADCAST_SAMPLING_RATE_176400_HZ BIT(10)
+#define BLE_BROADCAST_SAMPLING_RATE_192000_HZ BIT(11)
+#define BLE_BROADCAST_SAMPLING_RATE_384000_HZ BIT(12)
+
+#define BLE_BROADCAST_SUPPORTED_FRAME_DURATION_7_5_MS BIT(0)
+#define BLE_BROADCAST_SUPPORTED_FRAME_DURATION_10_MS  BIT(1)
+
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_LEFT   BIT(0)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_RIGHT  BIT(1)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_CENTER BIT(2)
+#define BLE_BROADCAST_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1   BIT(3)
+#define BLE_BROADCAST_AUDIO_LOCATION_BACK_LEFTBIT(4)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_LEFT_CENTERBIT(5)
+#define BLE_BROADCAST_AUDIO_LOCATION_FRONT_RIGHT_CENTER   BIT(6)
+#define BLE_BROADCAST_AUDIO_LOCATION_BACK_CENTER  BIT(7)
+#define BLE_BROADCAST_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2   BIT(8)
+#define BLE_BROADCAST_AUDIO_LOCATION_SIDE_LEFTBIT(9)
+#define BLE_BROADCAST_AUDIO_LOCATION_SIDE_RIGHT   BIT(10)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_FRONT_LEFT   BIT(11)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_FRONT_RIGHT  BIT(12)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_FRONT_CENTER BIT(13)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_CENTER   BIT(14)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_BACK_LEFTBIT(15)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_BACK_RIGHT   BIT(16)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_SIDE_LEFTBIT(17)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_SIDE_RIGHT   BIT(18)
+#define BLE_BROADCAST_AUDIO_LOCATION_TOP_BACK_CENTER  BIT(19)
+#define BLE_BROADCAST_AUDIO_LOCATION_BOTTOM_FRONT_CENTER  BIT(20)
+#define BLE_BROADCAST_AUDIO_LOCATION_BOTTOM_FRONT_LEFTBIT(21)
+#define BLE_BROADCAST_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT   BIT(22)
+#define BLE_BROADCAST_AUDIO_LOCATION_LEFT_SURROUNDBIT(23)
+#define BLE_BROADCAST_AUDIO_LOCATION_RIGHT_SURROUND   BIT(24)
+
+struct ble_audio_codec_id {
+/** Coding Fromat */
+uint8_t format;
+
+/** Company ID */
+uint16_t company_id;
+
+/** Vendor Specific Codec ID */
+uint16_t vendor_specific;
+};
+
+struct ble_audio_bis {

Review Comment:
   I don't think so, sometimes it's just `next` sometimes it has some name 
appended. I can change that to `bis_next` and `big_sub_next` (in 
`ble_audio_big_subgroup`). But `next` seems to be perfectly fine, like in 
`STAILQ_ENTRY(ble_l2cap_coc_srv) next;`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371267338


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_create(const struct ble_broadcast_create_params
+   *params,
+   struct ble_broadcast_base_config *config_out,
+   ble_audio_broadcast_destroy_fn *destroy_cb,
+   void *args,
+   ble_gap_event_fn *gap_cb);
+
+/**
+ * @brief Start advertisements for given BASE configuration
+ *
+ * This function starts BASE advertisement on by enabling extended and periodic
+ * advertising and creates BASE for this instance.
+ *
+ * @param[in] base_config   Pointer to a `ble_broadcast_base_config`
+ *  struct that shall be 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371257780


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_create(const struct ble_broadcast_create_params
+   *params,
+   struct ble_broadcast_base_config *config_out,
+   ble_audio_broadcast_destroy_fn *destroy_cb,
+   void *args,
+   ble_gap_event_fn *gap_cb);
+
+/**
+ * @brief Start advertisements for given BASE configuration
+ *
+ * This function starts BASE advertisement on by enabling extended and periodic
+ * advertising and creates BASE for this instance.
+ *
+ * @param[in] base_config   Pointer to a `ble_broadcast_base_config`
+ *  struct that shall be 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371255560


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_create(const struct ble_broadcast_create_params
+   *params,
+   struct ble_broadcast_base_config *config_out,
+   ble_audio_broadcast_destroy_fn *destroy_cb,
+   void *args,
+   ble_gap_event_fn *gap_cb);
+
+/**
+ * @brief Start advertisements for given BASE configuration
+ *
+ * This function starts BASE advertisement on by enabling extended and periodic
+ * advertising and creates BASE for this instance.
+ *
+ * @param[in] base_config   Pointer to a `ble_broadcast_base_config`
+ *  struct that shall be 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371252854


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_create(const struct ble_broadcast_create_params
+   *params,
+   struct ble_broadcast_base_config *config_out,
+   ble_audio_broadcast_destroy_fn *destroy_cb,
+   void *args,
+   ble_gap_event_fn *gap_cb);
+
+/**
+ * @brief Start advertisements for given BASE configuration
+ *
+ * This function starts BASE advertisement on by enabling extended and periodic
+ * advertising and creates BASE for this instance.
+ *
+ * @param[in] base_config   Pointer to a `ble_broadcast_base_config`
+ *  struct that shall be 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371246749


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_create(const struct ble_broadcast_create_params
+   *params,
+   struct ble_broadcast_base_config *config_out,
+   ble_audio_broadcast_destroy_fn *destroy_cb,
+   void *args,
+   ble_gap_event_fn *gap_cb);
+
+/**
+ * @brief Start advertisements for given BASE configuration
+ *
+ * This function starts BASE advertisement on by enabling extended and periodic
+ * advertising and creates BASE for this instance.
+ *
+ * @param[in] base_config   Pointer to a `ble_broadcast_base_config`
+ *  struct that shall be 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371246364


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_create(const struct ble_broadcast_create_params
+   *params,
+   struct ble_broadcast_base_config *config_out,
+   ble_audio_broadcast_destroy_fn *destroy_cb,
+   void *args,
+   ble_gap_event_fn *gap_cb);
+
+/**
+ * @brief Start advertisements for given BASE configuration
+ *
+ * This function starts BASE advertisement on by enabling extended and periodic
+ * advertising and creates BASE for this instance.
+ *
+ * @param[in] base_config   Pointer to a `ble_broadcast_base_config`
+ *  struct that shall be 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371243115


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */

Review Comment:
   as in 
https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371242163, I'll 
remove it entirely



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371242163


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {

Review Comment:
   So my idea for this was that `ble_broadcast_create_params` is `in` 
parameter. So it's used to configure instances and so on. If function is 
successful, `ble_broadcast_base_config` will be filled with `out` values, some 
copied from `ble_broadcast_create_params`, some generated, like 
`base->broadcast_id`. On second thought I see that this is not the best, I 
think I'll remove this parameter and save what's needed in host, so the app 
doesn't need to save `ble_broadcast_base_config` on it's own. And BASE can be 
identified just by `adv_instance`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371227772


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_create(const struct ble_broadcast_create_params
+   *params,
+   struct ble_broadcast_base_config *config_out,
+   ble_audio_broadcast_destroy_fn *destroy_cb,
+   void *args,
+   ble_gap_event_fn *gap_cb);
+
+/**
+ * @brief Start advertisements for given BASE configuration
+ *
+ * This function starts BASE advertisement on by enabling extended and periodic
+ * advertising and creates BASE for this instance.

Review Comment:
   Hmm the wording I used here seems confusing. So `ble_audio_broadcast_create` 
created BASE in host, but here we 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371222069


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_create(const struct ble_broadcast_create_params
+   *params,
+   struct ble_broadcast_base_config *config_out,
+   ble_audio_broadcast_destroy_fn *destroy_cb,
+   void *args,
+   ble_gap_event_fn *gap_cb);
+
+/**
+ * @brief Start advertisements for given BASE configuration
+ *
+ * This function starts BASE advertisement on by enabling extended and periodic
+ * advertising and creates BASE for this instance.

Review Comment:
   You're right, I'll remove it from here, it's a leftover



-- 
This is an automated message from the Apache Git 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371222069


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;
+ *  A non-zero value on failure.
+ */
+int ble_audio_broadcast_create(const struct ble_broadcast_create_params
+   *params,
+   struct ble_broadcast_base_config *config_out,
+   ble_audio_broadcast_destroy_fn *destroy_cb,
+   void *args,
+   ble_gap_event_fn *gap_cb);
+
+/**
+ * @brief Start advertisements for given BASE configuration
+ *
+ * This function starts BASE advertisement on by enabling extended and periodic
+ * advertising and creates BASE for this instance.

Review Comment:
   You're right, I'll remove it from here, it's a leftover



-- 
This is an automated message from the Apache Git 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371221521


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE
+ *  advertisement.
+ *
+ * @return  0 on success;

Review Comment:
   As far as I can see it's either that or what I used:
   ```c
/*
* @return  0 on success;
*  A non-zero value on failure.
*/
   ```
   I can see it in L2CAP, I can change it obviously



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371218466


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`
+ * @param[in] gap_cbGAP event callback to be associated with BASE

Review Comment:
   Yes, this is generic one. If you mean callback for events related to big 
it's declared in BIG, here: 
https://github.com/apache/mynewt-nimble/pull/1619/files#diff-b1517448655ef48c5df75a3f4575a12dd70843b36608468fbc001057d3f5f1efR103



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371215551


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE
+ *  advertisement is destroyed.
+ * @param[in] args  Optional arguments to be passed to `destroy_cb`

Review Comment:
   I'm planning to add sample that acts as usb soundcard for pc, where all of 
this API will be used. But that requires some additional code, outside of scope 
of this PR, like LC3. For now I added shell commands to test this code. I think 
it would be nice to add unittests too, when this API is semi-established I'll 
add them I think



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-25 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371212124


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+};
+
+struct ble_broadcast_update_params {
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */
+uint8_t adv_instance;
+
+/** Additional data to include in Extended Advertising  */
+uint8_t *svc_data;
+
+/** Additional data length  */
+uint16_t svc_data_len;
+
+/** Broadcast ID */
+uint32_t broadcast_id;
+};
+
+typedef int ble_audio_broadcast_destroy_fn(struct ble_audio_base *base,
+   void *args);
+
+/** BASE configuration describing broadcast advertisement */
+struct ble_broadcast_base_config {
+/** Advertising instance used by broadcast */
+uint8_t adv_instance;
+
+/** Pointer to BASE configuration */
+struct ble_audio_base *base;
+
+/** BIG parameters */
+struct ble_iso_big_params *big_params;
+
+/**
+ * Optional callback associated with broadcasting instance, called on
+ * destroying broadcast
+ */
+ble_audio_broadcast_destroy_fn *destroy_cb;
+
+/** Pointer to args for `destroy_cb`  */
+void *args;
+};
+
+/**
+ * @brief Create Broadcast Audio Source Endpoint and configure advertising
+ * instance
+ *
+ * This function configures advertising instance for extended and periodic
+ * advertisements to be ready for broadcast with BASE configuration.
+ *
+ * @param[in] paramsPointer to a `ble_broadcast_base_params`
+ *  structure that defines BASE, extended
+ *  advertising and periodic advertising
+ *  configuration.
+ * @param[out] config_out   Pointer to a `ble_broadcast_base_config`
+ *  structure to return configuration of created
+ *  BASE advertisement.
+ * @param[in] destroy_cbOptional callback to be called when BASE

Review Comment:
   I'm not sure either but this is how we discussed this offline. AFAIK it's 
the similar logic as with extended and periodic: periodic is auxilary of 
extended, and similary BIGInfo is auxilary of periodic. But when extended is 
stopped periodic is still being advertised. So when we want to stop all 
advertisements, we need to stop both extended, periodic and terminate BIG. 
Without it, extended and periodic would stop but BIGInfo would still advertise. 
Am I correct here @andrzej-kaczmarek ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-24 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371185902


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;

Review Comment:
   Hmm I don't see in spec this length requirement. Could you give a paragraph? 
`LOCAL NAME` AD type doesn't seem to have length requirement, neither complete 
or shortened.  GATT characteristic can have lenght in range 0 to 248. Is it 
somewhere in BAP maybe? If so I'd add this to documentation and added check in 
implementation



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-24 Thread via GitHub


KKopyscinski commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1371179117


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */

Review Comment:
   in `host/ble_gap.h` it's just ` Advertising instance`. Maybe keep it 
consistent?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-24 Thread via GitHub


kolodgrz commented on code in PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#discussion_r1368775358


##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;

Review Comment:
   It could be worth to include here information about length ? `minimum of 4 
and a
   maximum of 32 human-readable characters.` Or it would be somehow handled 
internally ?



##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */
+struct ble_audio_base *base;
+
+/** Parameters used to configure Extended advertising */
+struct ble_gap_ext_adv_params *extended_params;
+
+/** Parameters used to configure Periodic advertising */
+struct ble_gap_periodic_adv_params *periodic_params;
+
+/** Broadcast name - null terminated.
+ * Set NULL to not include in advertising
+ */
+const char *name;
+
+/** Advertising instance */

Review Comment:
   number ?



##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef H_BLE_AUDIO_BROADCAST_
+#define H_BLE_AUDIO_BROADCAST_
+
+#include 
+#include "host/ble_gap.h"
+#include "host/ble_iso.h"
+#include "host/ble_audio_common.h"
+
+struct ble_broadcast_create_params {
+/** BASE to broadcast */

Review Comment:
   I think it would be self descriptive: `Broadcast Audio Source Endpoint`



##
nimble/host/include/host/ble_audio_broadcast.h:
##
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional 

Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-23 Thread via GitHub


KKopyscinski commented on PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#issuecomment-1774592877

   @kolodgrz please review


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] nimble/host: Initial Broadcast implementation [mynewt-nimble]

2023-10-20 Thread via GitHub


KKopyscinski commented on PR #1619:
URL: https://github.com/apache/mynewt-nimble/pull/1619#issuecomment-1772603978

   This code is still being tested. Auracast package (that is simplified 
broadcast) implementation is pending


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org