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


##########
nimble/host/include/host/ble_audio_common.h:
##########
@@ -0,0 +1,139 @@
+/*
+ * 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 BROADCAST_AUDIO_ANNOUNCEMENT_SVC_UUID               0x1852
+
+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;
+};
+
+typedef int ble_audio_broadcast_sub_free_fn(void *cb_args);
+
+struct ble_audio_subgroup {
+    /** Pointer to next subgroup in BIG */
+    STAILQ_ENTRY(ble_audio_subgroup) next;
+
+    /** Number of BISes in subgroup */
+    uint8_t bis_cnt;
+
+    /** Codec ID */
+    struct ble_audio_codec_id codec_id;
+
+    /** Subgroup level Codec Specific Configuration */
+    uint8_t *codec_spec_config;
+
+    /** Subgroup level Codec Specific Configuration length */
+    uint8_t codec_spec_config_len;
+
+    /** Subgroup Metadata */
+    uint8_t *metadata;
+
+    /** Subgroup Metadata length*/
+    uint8_t metadata_len;
+
+    /** Link list of BISes */
+    STAILQ_HEAD(, ble_audio_bis) bises;
+};
+
+struct ble_audio_big {
+    /** Broadcast ID */
+    uint32_t broadcast_id : 24;
+
+    /** Presentation Delay */
+    uint8_t presentation_delay[3];
+
+    /** Number of subgroups in BIG */
+    uint8_t num_subgroups;
+
+    /** Link list of subgroups */
+    STAILQ_HEAD(, ble_audio_subgroup) subs;
+};
+
+struct ble_audio_codec_config_params {
+    /** Mandatory field, codec sampling frequency. */
+    uint8_t sampling_freq;
+
+    /** Mandatory field, codec frame duration. */
+    uint8_t frame_duration;
+
+    /**
+     * Optional field, bitfield with mapped Audio Locations.
+     * Set to 0 to omit in Codec Specific Configuration LTV construction.
+     */
+    uint32_t audio_channel_alloc;
+
+    /** Mandatory field, codec frame duration. */
+    uint16_t octets_per_codec_frame;
+
+    /**
+     * Optional field, codec frame duration.
+     * Set to 0 to omit in Codec Specific Configuration LTV construction.
+     */
+    uint8_t codec_frame_blocks_per_sdu;
+};
+
+/**
+ * @brief Build Codec Specific Configuration LTV structure
+ *
+ * This function packs Codec Specific Configuration settings into LTV format.
+ *
+ * @param params                Pointer to a `ble_audio_codec_config_params`
+ *                              struct that contains Codec Specific
+ *                              Configuration.
+ * @param codec_config_out      Pointer to a memory that will be filled with
+ *                              Codec Specific Configuration LTV structure.
+ *                              Memory size must be sufficient to fit
+ *                              expected LTV structure size.
+ * @param codec_config_out_len  Total length of constructed Codec Specific
+ *                              Configuration.
+ *
+ * @return                      0 on success;
+ *                              A non-zero value on failure.
+ */
+int ble_audio_build_codec_config(struct ble_audio_codec_config_params *params,

Review Comment:
   const pointer



-- 
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

Reply via email to