/* * Copyright (C) 2022 BlueKitchen GmbH * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * 4. Any redistribution, use, or modification is done solely for * personal benefit and not for any commercial purpose or for * monetary gain. * * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * Please inquire about commercial licensing options at * contact@bluekitchen-gmbh.com * *//* ... *//** * @title Broadcast Audio Scan Service Server (BASS) * * @text The Broadcast Audio Scan Service is used by servers to expose their status with respect * to synchronization to broadcast Audio Streams and associated data, including Broadcast_Codes * used to decrypt encrypted broadcast Audio Streams. Clients can use the attributes exposed by * servers to observe and/or request changes in server behavior. * * To use with your application, add `#import <broadcast_audio_scan_service.gatt>` to your .gatt file. *//* ... */#ifndefBROADCAST_AUDIO_SCAN_SERVICE_SERVER_H#defineBROADCAST_AUDIO_SCAN_SERVICE_SERVER_H#include<stdint.h>#include"btstack_defines.h"#include"le-audio/le_audio.h"#include"broadcast_audio_scan_service_util.h"#ifdefined__cplusplusextern"C"{#endif/* API_START */// memory for list of these structs is allocated by the applicationtypedefstruct{// assigned by client via control pointbass_source_data_tdata;uint8_tupdate_counter;uint8_tsource_id;boolin_use;le_audio_big_encryption_tbig_encryption;uint8_tbad_code[16];uint16_tbass_receive_state_handle;uint16_tbass_receive_state_client_configuration_handle;uint16_tbass_receive_state_client_configuration;...}bass_server_source_t;typedefstruct{hci_con_handle_tcon_handle;uint16_tsources_to_notify;// used for caching long writeuint8_tlong_write_buffer[512];uint16_tlong_write_value_size;uint16_tlong_write_attribute_handle;...}bass_server_connection_t;/** * @brief Init Broadcast Audio Scan Service Server with ATT DB * @param sources_num * @param sources * @param clients_num * @param clients *//* ... */voidbroadcast_audio_scan_service_server_init(uint8_tconstsources_num,bass_server_source_t*sources,uint8_tconstclients_num,bass_server_connection_t*clients);/** * @brief Register packet handler to receive events: * - GATTSERVICE_SUBEVENT_BASS_SERVER_SCAN_STOPPED * - GATTSERVICE_SUBEVENT_BASS_SERVER_SCAN_STARTED * - GATTSERVICE_SUBEVENT_BASS_SERVER_BROADCAST_CODE * - GATTSERVICE_SUBEVENT_BASS_SERVER_SOURCE_ADDED * - GATTSERVICE_SUBEVENT_BASS_SERVER_SOURCE_MODIFIED * - GATTSERVICE_SUBEVENT_BASS_SERVER_SOURCE_DELETED * @param packet_handler *//* ... */voidbroadcast_audio_scan_service_server_register_packet_handler(btstack_packet_handler_tpacket_handler);/** * @brief Set PA state of source. * @param source_index * @param sync_state *//* ... */voidbroadcast_audio_scan_service_server_set_pa_sync_state(uint8_tsource_index,le_audio_pa_sync_state_tsync_state);/** * @brief Add source. * @param source_data * @param source_index *//* ... */voidbroadcast_audio_scan_service_server_add_source(constbass_source_data_t*source_data,uint8_t*source_index);/** * @brief Deinit Broadcast Audio Scan Service Server *//* ... */voidbroadcast_audio_scan_service_server_deinit(void);/* API_END */#ifdefined__cplusplus}extern "C" { ... }#endif/* ... */#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.