MCPcopy Create free account
hub / github.com/SFML/SFML / getUsbAttribute

Function getUsbAttribute

src/SFML/Window/Unix/JoystickImpl.cpp:283–291  ·  view source on GitHub ↗

Get a system attribute from a USB device

Source from the content-addressed store, hash-verified

281
282// Get a system attribute from a USB device
283const char* getUsbAttribute(udev_device* udevDevice, const std::string& attributeName)
284{
285 udev_device* udevDeviceParent = udev_device_get_parent_with_subsystem_devtype(udevDevice, "usb", "usb_device");
286
287 if (!udevDeviceParent)
288 return nullptr;
289
290 return udev_device_get_sysattr_value(udevDeviceParent, attributeName.c_str());
291}
292
293// Get a USB attribute for a joystick as an unsigned int
294unsigned int getUsbAttributeUint(udev_device* udevDevice, const std::string& attributeName)

Callers 2

getUsbAttributeUintFunction · 0.85
getJoystickNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected