56 #include "ble_srv_common.h"
57 #include "app_util_platform.h"
58 #include "drv_audio_config.h"
62 #define BLE_UUID_TSS_SERVICE 0x0500
63 #define BLE_TSS_MAX_DATA_LEN (GATT_MTU_SIZE_DEFAULT - 3)
70 #define PACKED(TYPE) TYPE __attribute__ ((packed))
73 #define BLE_TSS_SPKR_STAT_FINISHED 0x00
74 #define BLE_TSS_SPKR_STAT_BUFFER_WARNING 0x01
75 #define BLE_TSS_SPKR_STAT_BUFFER_READY 0x02
76 #define BLE_TSS_SPKR_STAT_PACKET_DISREGARDED 0x10
77 #define BLE_TSS_SPKR_STAT_INVALID_COMMAND 0x11
79 #define BLE_TSS_MIC_FRAME_SIZE CONFIG_AUDIO_FRAME_SIZE_BYTES
81 typedef uint8_t ble_tss_spkr_stat_t;
83 typedef uint8_t ble_tss_spkr_sample_t;
85 typedef PACKED(
struct
90 }) ble_tss_spkr_freq_t;
94 ble_tss_spkr_freq_t freq;
96 ble_tss_spkr_sample_t sample_id;
102 uint8_t raw[BLE_TSS_MIC_FRAME_SIZE];
107 BLE_TSS_SPKR_MODE_FIRST,
108 BLE_TSS_SPKR_MODE_FREQ,
109 BLE_TSS_SPKR_MODE_PCM,
110 BLE_TSS_SPKR_MODE_SAMPLE,
111 BLE_TSS_SPKR_MODE_LAST
112 } ble_tss_spkr_mode_t;
116 BLE_TSS_MIC_MODE_FIRST,
117 BLE_TSS_MIC_MODE_ADPCM,
118 BLE_TSS_MIC_MODE_SPL,
119 BLE_TSS_MIC_MODE_LAST
120 } ble_tss_mic_mode_t;
122 typedef PACKED(
struct
124 ble_tss_spkr_mode_t spkr_mode;
125 ble_tss_mic_mode_t mic_mode;
128 #define BLE_TSS_CONFIG_SPKR_MODE_MIN (BLE_TSS_SPKR_MODE_FIRST + 1)
129 #define BLE_TSS_CONFIG_SPKR_MODE_MAX (BLE_TSS_SPKR_MODE_LAST - 1)
130 #define BLE_TSS_CONFIG_MIC_MODE_MIN (BLE_TSS_MIC_MODE_FIRST + 1)
131 #define BLE_TSS_CONFIG_MIC_MODE_MAX (BLE_TSS_MIC_MODE_LAST - 1)
135 BLE_TSS_EVT_NOTIF_MIC,
136 BLE_TSS_EVT_CONFIG_RECEIVED,
137 BLE_TSS_EVT_SPKR_RECEIVED,
138 BLE_TSS_EVT_NOTIF_SPKR_STAT
146 ble_tss_evt_type_t evt_type,
157 ble_tss_config_t * p_init_config;
226 #endif // BLE_TSS_H__