1 /* btp_hap.h - Bluetooth tester headers */ 2 3 /* 4 * Copyright (c) 2023 Codecoup 5 * 6 * SPDX-License-Identifier: Apache-2.0 7 */ 8 9 #include <stdint.h> 10 11 #include <zephyr/bluetooth/addr.h> 12 13 /* HAP commands */ 14 #define BTP_HAP_READ_SUPPORTED_COMMANDS 0x01 15 struct btp_hap_read_supported_commands_rp { 16 uint8_t data[0]; 17 } __packed; 18 19 #define BTP_HAP_HA_OPT_PRESETS_SYNC 0x01 20 #define BTP_HAP_HA_OPT_PRESETS_INDEPENDENT 0x02 21 #define BTP_HAP_HA_OPT_PRESETS_DYNAMIC 0x04 22 #define BTP_HAP_HA_OPT_PRESETS_WRITABLE 0x08 23 24 #define BTP_HAP_HA_INIT 0x02 25 struct btp_hap_ha_init_cmd { 26 uint8_t type; 27 uint16_t opts; 28 } __packed; 29 30 #define BTP_HAP_HARC_INIT 0x03 31 #define BTP_HAP_HAUC_INIT 0x04 32 #define BTP_HAP_IAC_INIT 0x05 33 34 #define BTP_HAP_IAC_DISCOVER 0x06 35 struct btp_hap_iac_discover_cmd { 36 bt_addr_le_t address; 37 } __packed; 38 39 #define BTP_HAP_IAC_SET_ALERT 0x07 40 struct btp_hap_iac_set_alert_cmd { 41 bt_addr_le_t address; 42 uint8_t alert; 43 } __packed; 44 45 #define BTP_HAP_HAUC_DISCOVER 0x08 46 struct btp_hap_hauc_discover_cmd { 47 bt_addr_le_t address; 48 } __packed; 49 50 /* HAP events */ 51 #define BT_HAP_EV_IAC_DISCOVERY_COMPLETE 0x80 52 struct btp_hap_iac_discovery_complete_ev { 53 bt_addr_le_t address; 54 uint8_t status; 55 } __packed; 56 57 #define BT_HAP_EV_HAUC_DISCOVERY_COMPLETE 0x81 58 struct btp_hap_hauc_discovery_complete_ev { 59 bt_addr_le_t address; 60 uint8_t status; 61 uint16_t has_hearing_aid_features_handle; 62 uint16_t has_control_point_handle; 63 uint16_t has_active_preset_index_handle; 64 } __packed; 65