Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
portabledsb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
App_Technologies
portabledsb
Commits
71f6c861
Commit
71f6c861
authored
Dec 17, 2015
by
Brendan Long
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix exposing devices in Bridge. Just expose them all until we have config file support.
parent
d71cd9c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
Bridge/Bridge.cpp
Bridge/Bridge.cpp
+22
-6
main.cpp
main.cpp
+1
-1
No files found.
Bridge/Bridge.cpp
View file @
71f6c861
...
...
@@ -145,17 +145,30 @@ bridge::DeviceSystemBridge::InitializeDevices(bool update)
if
(
ret
!=
0
)
goto
Leave
;
if
(
request
)
{
ret
=
request
->
Wait
(
kWaitTimeoutForAdapterOperation
);
if
(
ret
!=
0
)
{
goto
Leave
;
}
}
typedef
AdapterDeviceVector
::
iterator
iterator
;
for
(
iterator
begin
=
deviceList
.
begin
(),
end
=
deviceList
.
end
();
begin
!=
end
;
++
begin
)
{
// TODO: get configuration for device
// TODO: get configuration for device, only expose visible devices
if
(
update
)
UpdateDevice
(
*
begin
,
true
);
ret
=
UpdateDevice
(
*
begin
,
true
);
else
ret
=
CreateDevice
(
*
begin
);
// unfinished
if
(
ret
!=
0
)
DSBLOG_WARN
(
"Failed to %s device: %d"
,
update
?
"update"
:
"create"
,
ret
);
}
// TODO: Save bridge configuration to XML
Leave:
return
ret
==
0
?
ER_OK
:
ER_FAIL
;
}
...
...
@@ -167,12 +180,14 @@ bridge::DeviceSystemBridge::OnAdapterSignal(IAdapterSignal const& signal, void*)
shared_ptr
<
IAdapterDevice
>
adapterDevice
;
std
::
string
const
name
=
signal
.
GetName
();
if
(
name
==
kDeviceArrivalSignal
||
name
==
kDeviceArriaveDeviceHandle
)
if
(
name
==
kDeviceArrivalSignal
||
name
==
kDeviceRemovalSignal
)
{
AdapterValueVector
params
=
signal
.
GetParams
();
for
(
AdapterValueVector
::
const_iterator
itr
=
params
.
begin
();
itr
!=
params
.
end
();
++
itr
)
{
if
((
*
itr
)
->
GetName
()
==
kDeviceArriaveDeviceHandle
)
const
shared_ptr
<
IAdapterValue
>&
param
=
(
*
itr
);
const
std
::
string
&
paramName
=
param
->
GetName
();
if
(
paramName
==
kDeviceArrivalDeviceHandle
||
paramName
==
kDeviceRemovalDeviceHandle
)
{
// TODO: figure out where this signal is generated and figure out how we're
// going to put an arbitrary pointer inside.
...
...
@@ -187,6 +202,7 @@ bridge::DeviceSystemBridge::OnAdapterSignal(IAdapterSignal const& signal, void*)
if
(
name
==
kDeviceArrivalSignal
)
{
CreateDevice
(
adapterDevice
);
}
else
if
(
name
==
kDeviceRemovalSignal
)
{
...
...
main.cpp
View file @
71f6c861
...
...
@@ -66,7 +66,7 @@ int main(int /*argc*/, char* /*argv*/ [])
if
(
ret
!=
0
)
{
std
::
cout
<<
"EnumDevices:"
<<
ret
<<
std
::
endl
;
exit
(
0
)
;
return
1
;
}
for
(
auto
const
&
d
:
deviceList
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment