mirror of https://github.com/nirenjan/libx52.git
Merge branch 'fix-hotplug'
commit
1d1e5781c2
|
@ -22,6 +22,8 @@ The format is based upon [Keep a Changelog].
|
||||||
- Removed dependency on `rsync` during `make install`
|
- Removed dependency on `rsync` during `make install`
|
||||||
- Reduced default logging level of daemon to error only. See
|
- Reduced default logging level of daemon to error only. See
|
||||||
[#38](https://github.com/nirenjan/libx52/issues/38)
|
[#38](https://github.com/nirenjan/libx52/issues/38)
|
||||||
|
- Fixed daemon crash when disconnecting/reconnecting the joystick. See
|
||||||
|
[#43](https://github.com/nirenjan/libx52/issues/43)
|
||||||
|
|
||||||
## [0.2.3] - 2021-09-20
|
## [0.2.3] - 2021-09-20
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -71,11 +71,15 @@ static int _x52_hotplug_callback(libusb_context *ctx,
|
||||||
bool libx52_is_connected(libx52_device *dev)
|
bool libx52_is_connected(libx52_device *dev)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
struct timeval tv = {0};
|
||||||
|
int completed = 0;
|
||||||
|
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Handle events, and then check if the hotplug callbacks have fired */
|
||||||
|
libusb_handle_events_timeout_completed(dev->ctx, &tv, &completed);
|
||||||
|
|
||||||
if (dev->hdl) {
|
if (dev->hdl) {
|
||||||
if (dev->handle_registered) {
|
if (dev->handle_registered) {
|
||||||
|
|
Loading…
Reference in New Issue