| Tipro API Communicate with Tipro devices

Speakerbox.h
Go to the documentation of this file.
1
17 #ifndef _TIPRO_TIPROHIDAPI_SPEAKERBOX_H_
18 #define _TIPRO_TIPROHIDAPI_SPEAKERBOX_H_
19
20 #include "TiproHidDevice.h"
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /****************************************************************************/
27 /* SPEAKERBOX DEFINES */
28 /****************************************************************************/
29
30 // available devices
31 #define SBX_DEVICE_HANDSFREE 0x00
32 #define SBX_DEVICE_HANDSET 0x01
33 #define SBX_DEVICE_HEADSET 0x02
34 #define SBX_DEVICE_HANDSET_HEADSET 0x03
35 #define SBX_DEVICE_HANDSFREE_HANDSET_HEADSET 0x04
36 #define SBX_DEVICE_ILLEGAL 0xFF
37
38 // microphone
39 #define SBX_MIC_ACTIVE 0x00
40 #define SBX_MIC_MUTE 0x01
42 #define SBX_MIC_LEVEL_P7 0x00
43 #define SBX_MIC_LEVEL_P6 0x01
44 #define SBX_MIC_LEVEL_P5 0x02
45 #define SBX_MIC_LEVEL_P4 0x03
46 #define SBX_MIC_LEVEL_P3 0x04
47 #define SBX_MIC_LEVEL_P2 0x05
48 #define SBX_MIC_LEVEL_P1 0x06
49 #define SBX_MIC_LEVEL_0 0x07
50 #define SBX_MIC_LEVEL_M1 0x08
51 #define SBX_MIC_LEVEL_M2 0x09
52 #define SBX_MIC_LEVEL_M3 0x0A
53 #define SBX_MIC_LEVEL_M4 0x0B
54 #define SBX_MIC_LEVEL_M5 0x0C
55 #define SBX_MIC_LEVEL_M6 0x0D
56 #define SBX_MIC_LEVEL_M7 0x0E
57 #define SBX_MIC_LEVEL_ILLEGAL 0xFF
58
59 #define SBX_MIC_LEVEL_LOW SBX_MIC_LEVEL_M2
60 #define SBX_MIC_LEVEL_MID SBX_MIC_LEVEL_0
61 #define SBX_MIC_LEVEL_HIGH SBX_MIC_LEVEL_P2
62
63 // paramters limited to usefull range
64 #define SBX_MIC_LEVEL_MIN SBX_MIC_LEVEL_P3
65 #define SBX_MIC_LEVEL_MAX SBX_MIC_LEVEL_M3
66
67 // compression settings
68 #define SBX_MIC_COMPRESSION_OFF 0x00
69 #define SBX_MIC_COMPRESSION_LOW 0x01
70 #define SBX_MIC_COMPRESSION_MID 0x02
71 #define SBX_MIC_COMPRESSION_ILLEGAL 0xFF
72
73 #define SBX_MIC_COMPRESSION_MIN SBX_MIC_PROFILE_OFF
74 #define SBX_MIC_COMPRESSION_MAX SBX_MIC_PROFILE_MID
75
76 // optimal distance
77 #define SBX_MIC_DISTANCE_VERY_SHORT 0x00
78 #define SBX_MIC_DISTANCE_SHORT 0x01
79 #define SBX_MIC_DISTANCE_MEDIUM 0x02
80 #define SBX_MIC_DISTANCE_LONG 0x03
81 #define SBX_MIC_DISTANCE_ILLEGAL 0xFF
82
83 #define SBX_MIC_DISTANCE_MIN SBX_MIC_DISTANCE_VERY_SHORT
84 #define SBX_MIC_DISTANCE_MAX SBX_MIC_DISTANCE_LONG
85
86 // noise threshold
87 #define SBX_MIC_THRESHOLD_VERY_LOW 0x10
88 #define SBX_MIC_THRESHOLD_LOW 0x11
89 #define SBX_MIC_THRESHOLD_MID 0x12
90 #define SBX_MIC_THRESHOLD_HIGH 0x13
91 #define SBX_MIC_THRESHOLD_ILLEGAL 0xFF
92
93 #define SBX_MIC_PROFILE_EX_MIN SBX_MIC_THRESHOLD_VERY_LOW
94 #define SBX_MIC_PROFILE_EX_MAX SBX_MIC_THRESHOLD_HIGH
95
96 // sidetone
97 #define SBX_SIDETONE_LEVEL_M6DB 0x00
98 #define SBX_SIDETONE_LEVEL_M9DB 0x01
99 #define SBX_SIDETONE_LEVEL_M12DB 0x02
100 #define SBX_SIDETONE_LEVEL_M15DB 0x03
101 #define SBX_SIDETONE_LEVEL_M18DB 0x04
102 #define SBX_SIDETONE_LEVEL_M21DB 0x05
103 #define SBX_SIDETONE_LEVEL_M24DB 0x06
104 #define SBX_SIDETONE_LEVEL_M27DB 0x07
105 #define SBX_SIDETONE_LEVEL_M30DB 0x08
106 #define SBX_SIDETONE_OFF 0xFE
107 #define SBX_SIDETONE_ILLEGAL 0xFF
108
109 #define SBX_SIDETONE_MIN SBX_SIDETONE_LEVEL_M6DB
110 #define SBX_SIDETONE_MAX SBX_SIDETONE_LEVEL_M30DB
111
112 // speakers
113 #define SBX_SPK_ACTIVE 0x00
114 #define SBX_SPK_MUTE 0x01
116 #define SBX_SPK_LEVEL_MIN 0x00
117 #define SBX_SPK_LEVEL_MAX 0x14
118 #define SBX_SPK_LEVEL_ILLEGAL 0xFF
119
120 #define SBX_ALERT_ACTIVE 0x00
121 #define SBX_ALERT_MUTE 0x01
123 #define SBX_HANDSET_HEADSET_LEVEL_9DB 0x00
124 #define SBX_HANDSET_HEADSET_LEVEL_6DB 0x01
125 #define SBX_HANDSET_HEADSET_LEVEL_3DB 0x02
126 #define SBX_HANDSET_HEADSET_LEVEL_0DB 0x03
127 #define SBX_HANDSET_HEADSET_LEVEL_M6DB 0x04
128 #define SBX_HANDSET_HEADSET_LEVEL_M12DB 0x05
129 #define SBX_HANDSET_HEADSET_LEVEL_M18DB 0x06
130 #define SBX_HANDSET_HEADSET_LEVEL_M24DB 0x07
131 #define SBX_HANDSET_HEADSET_LEVEL_M30DB 0x08
132 #define SBX_HANDSET_HEADSET_LEVEL_M36DB 0x09
133 #define SBX_HANDSET_HEADSET_LEVEL_M42DB 0x0A
134 #define SBX_HANDSET_HEADSET_ILLEGAL 0xFF
135
136 #define SBX_HANDSET_HEADSET_LEVEL_MIN SBX_HANDSET_HEADSET_LEVEL_9DB
137 #define SBX_HANDSET_HEADSET_LEVEL_MAX SBX_HANDSET_HEADSET_LEVEL_M42DB
138
139 #define SBX_ALERT_AS_ALERT 0x00
140 #define SBX_ALERT_AS_VOICE 0x01
141 #define SBX_ALERT_NOT_USED 0x02
142 #define SBX_ALERT_ILLEGAL 0xFF
143
144 // indicators
145 #define SBX_LED_OFF 0x00
146 #define SBX_LED_ON 0x01
147 // Task#98 - supported in >FW 5.xx.61
148 #define SBX_LED_BLINK 0x02
149 #define SBX_LED_BLINK_INV 0x03
150
151 // keys
152 #define SBX_KEY_SB_1 0x01
153 #define SBX_KEY_SB_2 0x02
154 #define SBX_KEY_SB_3 0x03
155 #define SBX_KEY_SB_4 0x04
156 #define SBX_KEY_SB_5 0x05
157 #define SBX_KEY_SB_6 0x06
158 #define SBX_HANDSET_PTT 0x07
159 #define SBX_HEADSET_PTT 0x08
160 #define SBX_HANDSET_HOOK 0x09
161 #define SBX_HEADSET_CONNECTED 0x0A
162
163 //state of the keys
164 #define SBX_KEY_PRESSED 0x80
165 #define SBX_KEY_RELEASED 0x00
167 #define SBX_KEY_ILLEGAL 0xFF
168
169 #define HANDSET_ONHOOK 0x80
170 #define HANDSET_OFFHOOK 0x00
172 #define HEADSET_CONNECTED 0x80
173 #define HEADSET_DISCONNECTED 0x00
176 #define HANDSET_KEY_PRESSED 0x80
177 #define HANDSET_KEY_RELEASED 0x00
179 // LED luminance
180 #define SBX_LED_LUMINANCE_MIN 0x00
181 #define SBX_LED_LUMINANCE_MAX 0x0A
182
183 // PTT LED control
184 #define PTT_LED_OFF 0x00
185 #define PTT_LED_ON 0x10
186 #define PTT_LED_BLINK 0x20
187
188 // RGB PTT LED control (currently not available in HW)
189 #define PTT_LED_OFF 0x00
190 #define PTT_LED_R_ON 0x01
191 #define PTT_LED_R_BLINK 0x02
192 #define PTT_LED_G_ON 0x04
193 #define PTT_LED_G_BLINK 0x0C
194 #define PTT_LED_B_ON 0x10
195 #define PTT_LED_B_BLINK 0x20
196
197 // Auto Luminance (BF10 and SBX)
198 #define AUTO_LUMINANCE_MODE_1 0xE0
199 #define AUTO_LUMINANCE_MODE_2 0xE1
200 #define AUTO_LUMINANCE_MODE_3 0xE2
201 #define AUTO_LUMINANCE_OFF 0x00 // manual mode
202
203 // Analog audio
204 #define SBX_ANALOG_AUDIO_OFF 0x00
205 #define SBX_ANALOG_AUDIO_LEFT 0x01
206 #define SBX_ANALOG_AUDIO_RIGHT 0x02
207 #define SBX_ANALOG_AUDIO_BOTH 0x03
208
209
210 /****************************************************************************/
211 /* SPEAKERBOX FUNCTIONS */
212 /****************************************************************************/
213
221 int TiproSpeakerboxSetSpeakerLevel(TiproHidDevice *device, int nFsNum, int nLevel);
222
230 int TiproSpeakerboxGetSpeakerLevel(TiproHidDevice *device, int nFsNum, int *nLevel);
231
240 int TiproSpeakerboxSetLEDState (TiproHidDevice *device, int nFsNum, int nKey, int nState);
241
250 int TiproSpeakerboxGetLEDState (TiproHidDevice *device, int nFsNum, int nKey, int *nState);
251
259 int TiproSpeakerboxSetExternalDeviceLevel (TiproHidDevice *device, int nFsNum, int nLevel);
260
268 int TiproSpeakerboxGetExternalDeviceLevel (TiproHidDevice *device, int nFsNum, int *nLevel);
269
277 int TiproSpeakerboxGetExternalHeadsetState (TiproHidDevice *device, int nFsNum, int *nState);
278
286 int TiproSpeakerboxMuteMicrophone (TiproHidDevice *device, int nFsNum, int nMute);
287
294 int TiproSpeakerboxGoOnline (TiproHidDevice *device, int nFsNum);
295
303 int TiproSpeakerboxIsOnline (TiproHidDevice *device, int nFsNum, int *nOnline);
304
312 int TiproSpeakerboxSetAlertLine (TiproHidDevice *device, int nFsNum, int nMode);
313
321 int TiproSpeakerboxGetAlertLine (TiproHidDevice *device, int nFsNum, int *nMode);
322
330 int TiproSpeakerboxSetActiveDevice (TiproHidDevice *device, int nFsNum, int nDevice);
331
339 int TiproSpeakerboxGetMicrophoneLevel (TiproHidDevice *device, int nFsNum, int *nLevel);
340
348 int TiproSpeakerboxSetMicrophoneLevel (TiproHidDevice *device, int nFsNum, int nLevel);
349
358 int TiproSpeakerboxSetMicrophoneLevelEx (TiproHidDevice *device, int nFsNum, int nLevel, int nDevice);
359
367 int TiproSpeakerboxGetMicrophoneOptimalDistance (TiproHidDevice *device, int nFsNum, int *nDistance);
368
376 int TiproSpeakerboxSetMicrophoneOptimalDistance (TiproHidDevice *device, int nFsNum, int nDistance);
377
385 int TiproSpeakerboxSetMicrophoneThreshold (TiproHidDevice *device, int nFsNum, int nThreshold);
386
394 int TiproSpeakerboxGetMicrophoneThreshold (TiproHidDevice *device, int nFsNum, int *nThreshold);
395
403 int TiproSpeakerboxSetMicrophoneCompression (TiproHidDevice *device, int nFsNum, int nCompression);
404
412 int TiproSpeakerboxGetMicrophoneCompression (TiproHidDevice *device, int nFsNum, int *nCompression);
413
423 int TiproSpeakerboxSetMicrophoneThresholdEx (TiproHidDevice *device, int nFsNum, int nThreshold, int nDevice);
424
433 int TiproSpeakerboxSetMicrophoneCompressionEx (TiproHidDevice *device, int nFsNum, int nCompression, int nDevice);
434
443 int TiproSpeakerboxGetHandsetStateEx (TiproHidDevice *device, int nHandsetNum, int *nPTTKey, int *nHookState);
444
453 int TiproSpeakerboxGetKeyState (TiproHidDevice *device, int nFsNum, int nKey, int *nState);
454
463 int TiproSpeakerboxSetLEDBlinkSpeed (TiproHidDevice *device, int nFsNum, int nTBlinkA, int nTBlinkB);
464
473 int TiproSpeakerboxGetLEDBlinkSpeed (TiproHidDevice *device, int nFsNum, int *nTBlinkA, int *nTBlinkB);
474
483 int TiproSpeakerboxGetHandsetState(TiproHidDevice *device, int nHandsetNum, int *nPTTKey, int *nHookState);
484
485 #ifdef __cplusplus
486 }
487 #endif
488
489 #endif
TiproSpeakerboxSetMicrophoneLevel
int TiproSpeakerboxSetMicrophoneLevel(TiproHidDevice *device, int nFsNum, int nLevel)
Sets the level of the microphone signal.
TiproHidDevice.h
Represents Tipro device.
TiproSpeakerboxGetExternalHeadsetState
int TiproSpeakerboxGetExternalHeadsetState(TiproHidDevice *device, int nFsNum, int *nState)
Returns the state of the headset.
TiproSpeakerboxGetSpeakerLevel
int TiproSpeakerboxGetSpeakerLevel(TiproHidDevice *device, int nFsNum, int *nLevel)
Returns the level of the speakers.
TiproSpeakerboxGetKeyState
int TiproSpeakerboxGetKeyState(TiproHidDevice *device, int nFsNum, int nKey, int *nState)
Returns state of the keys.
TiproSpeakerboxSetMicrophoneLevelEx
int TiproSpeakerboxSetMicrophoneLevelEx(TiproHidDevice *device, int nFsNum, int nLevel, int nDevice)
Sets the level of the microphone signal.
TiproSpeakerboxSetMicrophoneThreshold
int TiproSpeakerboxSetMicrophoneThreshold(TiproHidDevice *device, int nFsNum, int nThreshold)
Sets the microphone threshold.
TiproSpeakerboxGetMicrophoneLevel
int TiproSpeakerboxGetMicrophoneLevel(TiproHidDevice *device, int nFsNum, int *nLevel)
Returns the level of the microphone signal.
TiproSpeakerboxSetAlertLine
int TiproSpeakerboxSetAlertLine(TiproHidDevice *device, int nFsNum, int nMode)
Sets the function (mode) of the alert line.
TiproSpeakerboxGetAlertLine
int TiproSpeakerboxGetAlertLine(TiproHidDevice *device, int nFsNum, int *nMode)
Returns the function (mode) of the alert line (on-line mode only)
TiproSpeakerboxSetSpeakerLevel
int TiproSpeakerboxSetSpeakerLevel(TiproHidDevice *device, int nFsNum, int nLevel)
Sets the level of the speakers.
TiproSpeakerboxGetHandsetState
int TiproSpeakerboxGetHandsetState(TiproHidDevice *device, int nHandsetNum, int *nPTTKey, int *nHookState)
Returns state of the keys.
TiproSpeakerboxSetMicrophoneCompressionEx
int TiproSpeakerboxSetMicrophoneCompressionEx(TiproHidDevice *device, int nFsNum, int nCompression, int nDevice)
Sets the specific device&#39;s microphone compression.
TiproSpeakerboxGetMicrophoneCompression
int TiproSpeakerboxGetMicrophoneCompression(TiproHidDevice *device, int nFsNum, int *nCompression)
Returns the microphone compression.
TiproSpeakerboxGetLEDBlinkSpeed
int TiproSpeakerboxGetLEDBlinkSpeed(TiproHidDevice *device, int nFsNum, int *nTBlinkA, int *nTBlinkB)
TiproSpeakerboxIsOnline
int TiproSpeakerboxIsOnline(TiproHidDevice *device, int nFsNum, int *nOnline)
Returns On-line / Off-line mode.
TiproSpeakerboxGetHandsetStateEx
int TiproSpeakerboxGetHandsetStateEx(TiproHidDevice *device, int nHandsetNum, int *nPTTKey, int *nHookState)
Returns state of the keys.
TiproSpeakerboxSetLEDBlinkSpeed
int TiproSpeakerboxSetLEDBlinkSpeed(TiproHidDevice *device, int nFsNum, int nTBlinkA, int nTBlinkB)
TiproSpeakerboxGoOnline
int TiproSpeakerboxGoOnline(TiproHidDevice *device, int nFsNum)
Puts speakerbox to On-line mode.
TiproSpeakerboxGetMicrophoneThreshold
int TiproSpeakerboxGetMicrophoneThreshold(TiproHidDevice *device, int nFsNum, int *nThreshold)
Returns the microphone threshold.
TiproSpeakerboxSetExternalDeviceLevel
int TiproSpeakerboxSetExternalDeviceLevel(TiproHidDevice *device, int nFsNum, int nLevel)
Sets the level of the connected headset/handset device.
TiproSpeakerboxSetMicrophoneCompression
int TiproSpeakerboxSetMicrophoneCompression(TiproHidDevice *device, int nFsNum, int nCompression)
Sets the microphone compression.
TiproSpeakerboxGetMicrophoneOptimalDistance
int TiproSpeakerboxGetMicrophoneOptimalDistance(TiproHidDevice *device, int nFsNum, int *nDistance)
Returns the optimal distance of the handsfree microphone.
TiproSpeakerboxGetLEDState
int TiproSpeakerboxGetLEDState(TiproHidDevice *device, int nFsNum, int nKey, int *nState)
Returns the LED state of the illuminated keys.
TiproSpeakerboxMuteMicrophone
int TiproSpeakerboxMuteMicrophone(TiproHidDevice *device, int nFsNum, int nMute)
Mutes/un-mutes the microphone signal.
TiproSpeakerboxSetMicrophoneOptimalDistance
int TiproSpeakerboxSetMicrophoneOptimalDistance(TiproHidDevice *device, int nFsNum, int nDistance)
Sets the optimal distance for the handsfree microphone.
TiproSpeakerboxSetMicrophoneThresholdEx
int TiproSpeakerboxSetMicrophoneThresholdEx(TiproHidDevice *device, int nFsNum, int nThreshold, int nDevice)
Sets the specific device&#39;s microphone threshold.
TiproHidDevice
Definition: TiproHidDevice.h:32
TiproSpeakerboxSetLEDState
int TiproSpeakerboxSetLEDState(TiproHidDevice *device, int nFsNum, int nKey, int nState)
Sets the LED state of the illuminated keys.
TiproSpeakerboxGetExternalDeviceLevel
int TiproSpeakerboxGetExternalDeviceLevel(TiproHidDevice *device, int nFsNum, int *nLevel)
Returns the current level of the connected headset/handset device.
TiproSpeakerboxSetActiveDevice
int TiproSpeakerboxSetActiveDevice(TiproHidDevice *device, int nFsNum, int nDevice)
Sets the device where both speaker and microphone signals will be switched to (on-line mode only) ...