MCPcopy Create free account
hub / github.com/Sapd/HeadsetControl / device

Class device

src/device.h:197–456  ·  view source on GitHub ↗

@brief Defines the basic data of a device * * Also defines function pointers for using supported features */

Source from the content-addressed store, hash-verified

195 * Also defines function pointers for using supported features
196 */
197struct device {
198 /// USB Vendor id
199 uint16_t idVendor;
200 /// USB Product id used (and found as connected), set by device_registry.c
201 uint16_t idProduct;
202 /// The USB Product ids this instance of "struct device" supports
203 const uint16_t* idProductsSupported;
204 /// Size of idProducts
205 int numIdProducts;
206
207 /// Name of device, used as information for the user
208 char device_name[64];
209
210 // Equalizer Infos
211 EqualizerInfo* equalizer;
212 EqualizerPresets* equalizer_presets;
213 ParametricEqualizerInfo* parametric_equalizer;
214
215 wchar_t device_hid_vendorname[64];
216 wchar_t device_hid_productname[64];
217
218 /// Bitmask of currently supported features the software can currently handle
219 int capabilities;
220 /// Details of all capabilities (e.g. to which interface to connect)
221 struct capability_detail capability_details[NUM_CAPABILITIES];
222
223 /** @brief Function pointer for setting headset sidetone
224 *
225 * Forwards the request to the device specific implementation
226 *
227 * @param device_handle The hidapi handle. Must be the same
228 * device as defined here (same ids)
229 * @param num Level of the sidetone, between 0 - 128
230 *
231 * @returns > 0 on success
232 * HSC_ERROR on error specific to this software
233 * -1 HIDAPI error
234 */
235 int (*send_sidetone)(hid_device* hid_device, uint8_t num);
236
237 /** @brief Function pointer for retrieving the headsets battery status
238 *
239 * Forwards the request to the device specific implementation
240 *
241 * @param device_handle The hidapi handle. Must be the same
242 * device as defined here (same ids)
243 *
244 * @returns >= 0 battery level (in %)
245 * BATTERY_LOADING when the battery is currently being loaded
246 * -1 HIDAPI error
247 */
248 BatteryInfo (*request_battery)(hid_device* hid_device);
249
250 /** @brief Function pointer for sending a notification sound to the headset
251 *
252 * Forwards the request to the device specific implementation
253 *
254 * @param device_handle The hidapi handle. Must be the same

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected