Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Fadecandy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scanlime
Fadecandy
Commits
027184cd
Commit
027184cd
authored
11 years ago
by
Micah Elizabeth Scott
Browse files
Options
Downloads
Patches
Plain Diff
Device arrival/departure stubs
parent
4873e46a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/fcserver.cpp
+14
-1
14 additions, 1 deletion
server/fcserver.cpp
server/fcserver.h
+2
-0
2 additions, 0 deletions
server/fcserver.h
with
16 additions
and
1 deletion
server/fcserver.cpp
+
14
−
1
View file @
027184cd
...
@@ -117,9 +117,22 @@ int FCServer::cbHotplug(libusb_context *ctx, libusb_device *device, libusb_hotpl
...
@@ -117,9 +117,22 @@ int FCServer::cbHotplug(libusb_context *ctx, libusb_device *device, libusb_hotpl
{
{
FCServer
*
self
=
static_cast
<
FCServer
*>
(
user_data
);
FCServer
*
self
=
static_cast
<
FCServer
*>
(
user_data
);
printf
(
"Hotplug %d
\n
"
,
event
);
if
(
event
&
LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED
)
{
self
->
usbDeviceArrived
(
device
);
}
if
(
event
&
LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT
)
{
self
->
usbDeviceLeft
(
device
);
}
return
false
;
return
false
;
}
}
void
FCServer
::
usbDeviceArrived
(
libusb_device
*
device
)
{
// New USB device. Is this a device we recognize?
}
void
FCServer
::
usbDeviceLeft
(
libusb_device
*
device
)
{
}
This diff is collapsed.
Click to expand it.
server/fcserver.h
+
2
−
0
View file @
027184cd
...
@@ -62,4 +62,6 @@ private:
...
@@ -62,4 +62,6 @@ private:
static
int
cbHotplug
(
libusb_context
*
ctx
,
libusb_device
*
device
,
libusb_hotplug_event
event
,
void
*
user_data
);
static
int
cbHotplug
(
libusb_context
*
ctx
,
libusb_device
*
device
,
libusb_hotplug_event
event
,
void
*
user_data
);
void
startUSB
(
struct
ev_loop
*
loop
);
void
startUSB
(
struct
ev_loop
*
loop
);
void
usbDeviceArrived
(
libusb_device
*
device
);
void
usbDeviceLeft
(
libusb_device
*
device
);
};
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment