1 /* btp_vcp.h - Bluetooth tester headers */ 2 3 /* 4 * Copyright (c) 2023 Codecoup 5 * 6 * SPDX-License-Identifier: Apache-2.0 7 */ 8 9 #include <zephyr/sys/util.h> 10 11 #define BTP_VCP_READ_SUPPORTED_COMMANDS 0x01 12 struct btp_vcp_read_supported_commands_rp { 13 uint8_t data[0]; 14 } __packed; 15 16 #define BTP_VCP_VOL_CTLR_DISCOVER 0x02 17 struct btp_vcp_discover_cmd { 18 bt_addr_le_t address; 19 } __packed; 20 21 #define BTP_VCP_VOL_CTLR_STATE_READ 0x03 22 struct btp_vcp_state_read_cmd { 23 bt_addr_le_t address; 24 } __packed; 25 26 #define BTP_VCP_VOL_CTLR_FLAGS_READ 0x04 27 struct btp_vcp_flags_read_cmd { 28 bt_addr_le_t address; 29 } __packed; 30 31 #define BTP_VCP_VOL_CTLR_VOL_DOWN 0x05 32 struct btp_vcp_ctlr_vol_down_cmd { 33 bt_addr_le_t address; 34 } __packed; 35 36 #define BTP_VCP_VOL_CTLR_VOL_UP 0x06 37 struct btp_vcp_ctlr_vol_up_cmd { 38 bt_addr_le_t address; 39 } __packed; 40 41 #define BTP_VCP_VOL_CTLR_UNMUTE_VOL_DOWN 0x07 42 struct btp_vcp_ctlr_unmute_vol_down_cmd { 43 bt_addr_le_t address; 44 } __packed; 45 46 #define BTP_VCP_VOL_CTLR_UNMUTE_VOL_UP 0x08 47 struct btp_vcp_ctlr_unmute_vol_up_cmd { 48 bt_addr_le_t address; 49 } __packed; 50 51 #define BTP_VCP_VOL_CTLR_SET_VOL 0x09 52 struct btp_vcp_ctlr_set_vol_cmd { 53 bt_addr_le_t address; 54 uint8_t volume; 55 } __packed; 56 57 #define BTP_VCP_VOL_CTLR_UNMUTE 0x0a 58 struct btp_vcp_ctlr_unmute_cmd { 59 bt_addr_le_t address; 60 } __packed; 61 62 #define BTP_VCP_VOL_CTLR_MUTE 0x0b 63 struct btp_vcp_ctlr_mute_cmd { 64 bt_addr_le_t address; 65 } __packed; 66 67 /* VCP events */ 68 #define BTP_VCP_DISCOVERED_EV 0x80 69 struct btp_vcp_discovered_ev { 70 bt_addr_le_t address; 71 uint8_t att_status; 72 struct { 73 uint16_t control_handle; 74 uint16_t flag_handle; 75 uint16_t state_handle; 76 } vcs_handles; 77 78 struct { 79 uint16_t state_handle; 80 uint16_t location_handle; 81 uint16_t control_handle; 82 uint16_t desc_handle; 83 } vocs_handles; 84 85 struct { 86 uint16_t state_handle; 87 uint16_t gain_handle; 88 uint16_t type_handle; 89 uint16_t status_handle; 90 uint16_t control_handle; 91 uint16_t desc_handle; 92 } aics_handles; 93 } __packed; 94 95 #define BTP_VCP_STATE_EV 0x81 96 struct btp_vcp_state_ev { 97 bt_addr_le_t address; 98 uint8_t att_status; 99 uint8_t volume; 100 uint8_t mute; 101 } __packed; 102 103 #define BTP_VCP_FLAGS_EV 0x82 104 struct btp_vcp_volume_flags_ev { 105 bt_addr_le_t address; 106 uint8_t att_status; 107 uint8_t flags; 108 } __packed; 109 110 #define BTP_VCP_PROCEDURE_EV 0x83 111 struct btp_vcp_procedure_ev { 112 bt_addr_le_t address; 113 uint8_t att_status; 114 uint8_t opcode; 115 } __packed; 116