2021-10-21 12:04:16 +02:00
|
|
|
/**
|
|
|
|
* @file
|
2022-10-11 13:53:49 +02:00
|
|
|
* @brief Internal APIs for Bluetooth CSIP
|
2021-10-21 12:04:16 +02:00
|
|
|
*
|
2022-10-11 13:53:49 +02:00
|
|
|
* Copyright (c) 2021-2022 Nordic Semiconductor ASA
|
2021-10-21 12:04:16 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2024-05-20 19:40:04 +02:00
|
|
|
#include <stdint.h>
|
2021-10-21 12:04:16 +02:00
|
|
|
|
2024-05-20 19:40:04 +02:00
|
|
|
#include <zephyr/bluetooth/audio/csip.h>
|
|
|
|
#include <zephyr/bluetooth/conn.h>
|
|
|
|
#include <zephyr/bluetooth/gatt.h>
|
2021-11-24 12:40:30 +01:00
|
|
|
|
2022-10-11 13:53:49 +02:00
|
|
|
#define BT_CSIP_SIRK_TYPE_ENCRYPTED 0x00
|
|
|
|
#define BT_CSIP_SIRK_TYPE_PLAIN 0x01
|
2021-11-24 12:40:30 +01:00
|
|
|
|
2022-10-11 13:53:49 +02:00
|
|
|
#define BT_CSIP_RELEASE_VALUE 0x01
|
|
|
|
#define BT_CSIP_LOCK_VALUE 0x02
|
2021-11-24 12:40:30 +01:00
|
|
|
|
2024-05-28 15:55:57 +02:00
|
|
|
struct bt_csip_sirk {
|
2021-11-24 11:06:13 +01:00
|
|
|
uint8_t type;
|
2024-05-28 15:55:57 +02:00
|
|
|
uint8_t value[BT_CSIP_SIRK_SIZE];
|
2021-11-24 11:06:13 +01:00
|
|
|
} __packed;
|
|
|
|
|
2024-02-06 12:04:16 +01:00
|
|
|
struct bt_csip_set_coordinator_svc_inst *bt_csip_set_coordinator_lookup_instance_by_index(
|
|
|
|
const struct bt_conn *conn, uint8_t idx);
|
|
|
|
|
|
|
|
struct bt_csip_set_coordinator_svc_inst {
|
|
|
|
uint8_t set_lock;
|
|
|
|
|
|
|
|
uint16_t start_handle;
|
|
|
|
uint16_t end_handle;
|
2024-05-28 15:55:57 +02:00
|
|
|
uint16_t sirk_handle;
|
2024-02-06 12:04:16 +01:00
|
|
|
uint16_t set_size_handle;
|
|
|
|
uint16_t set_lock_handle;
|
|
|
|
uint16_t rank_handle;
|
|
|
|
|
|
|
|
uint8_t idx;
|
|
|
|
struct bt_gatt_subscribe_params sirk_sub_params;
|
|
|
|
struct bt_gatt_discover_params sirk_sub_disc_params;
|
|
|
|
struct bt_gatt_subscribe_params size_sub_params;
|
|
|
|
struct bt_gatt_discover_params size_sub_disc_params;
|
|
|
|
struct bt_gatt_subscribe_params lock_sub_params;
|
|
|
|
struct bt_gatt_discover_params lock_sub_disc_params;
|
|
|
|
|
|
|
|
struct bt_conn *conn;
|
|
|
|
struct bt_csip_set_coordinator_set_info *set_info;
|
|
|
|
};
|
|
|
|
|
2024-05-29 10:07:53 +02:00
|
|
|
struct bt_csip_set_coordinator_csis_inst *
|
|
|
|
bt_csip_set_coordinator_csis_inst_by_handle(struct bt_conn *conn, uint16_t start_handle);
|