Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
b9210b1a
Commit
b9210b1a
authored
Feb 03, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Velleman I/O, specific error message when linked with dummy library
parent
1d148b61
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
6 deletions
+17
-6
otherio/lib/rt/src/os_linux/rt_io_m_usb_agent.c
otherio/lib/rt/src/os_linux/rt_io_m_usb_agent.c
+7
-2
otherio/lib/rt/src/os_linux/rt_io_m_velleman_k8055_board.c
otherio/lib/rt/src/os_linux/rt_io_m_velleman_k8055_board.c
+5
-2
otherio/lib/usb_dummy/src/usb_dummy_functions.c
otherio/lib/usb_dummy/src/usb_dummy_functions.c
+3
-2
src/lib/rt/src/rt_io_base.h
src/lib/rt/src/rt_io_base.h
+2
-0
No files found.
otherio/lib/rt/src/os_linux/rt_io_m_usb_agent.c
View file @
b9210b1a
...
@@ -44,9 +44,14 @@ static pwr_tStatus IoAgentInit( io_tCtx ctx,
...
@@ -44,9 +44,14 @@ static pwr_tStatus IoAgentInit( io_tCtx ctx,
sts
=
libusb_init
(
&
local
->
libusb_ctx
);
sts
=
libusb_init
(
&
local
->
libusb_ctx
);
if
(
sts
!=
0
)
{
if
(
sts
!=
0
)
{
op
->
Status
=
sts
;
if
(
sts
==
io_cLibDummy
)
op
->
Status
=
IO__DUMMYBUILD
;
else
op
->
Status
=
IO__INITFAIL
;
errh_Error
(
"Init of USB agent failed '%s', error status %d"
,
ap
->
Name
,
sts
);
local
->
libusb_ctx
=
0
;
local
->
libusb_ctx
=
0
;
errh_Error
(
"Init of USB agent failed '%s'"
,
ap
->
Name
)
;
return
op
->
Status
;
}
}
else
{
else
{
op
->
Status
=
IO__SUCCESS
;
op
->
Status
=
IO__SUCCESS
;
...
...
otherio/lib/rt/src/os_linux/rt_io_m_velleman_k8055_board.c
View file @
b9210b1a
...
@@ -86,10 +86,13 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
...
@@ -86,10 +86,13 @@ static pwr_tStatus IoCardInit( io_tCtx ctx,
sts
=
libusb_open
(
device
,
&
local
->
libusb_device
);
sts
=
libusb_open
(
device
,
&
local
->
libusb_device
);
if
(
sts
!=
0
)
{
if
(
sts
!=
0
)
{
op
->
Status
=
IO__INITFAIL
;
if
(
sts
==
io_cLibDummy
)
op
->
Status
=
IO__DUMMYBUILD
;
else
op
->
Status
=
IO__INITFAIL
;
((
pwr_sClass_Velleman_K8055
*
)
rp
->
op
)
->
Status
=
op
->
Status
;
((
pwr_sClass_Velleman_K8055
*
)
rp
->
op
)
->
Status
=
op
->
Status
;
local
->
libusb_device
=
0
;
local
->
libusb_device
=
0
;
return
IO__INITFAIL
;
return
op
->
Status
;
}
}
if
(
libusb_kernel_driver_active
(
local
->
libusb_device
,
0
)
!=
0
)
if
(
libusb_kernel_driver_active
(
local
->
libusb_device
,
0
)
!=
0
)
...
...
otherio/lib/usb_dummy/src/usb_dummy_functions.c
View file @
b9210b1a
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
*/
*/
#include <sys/types.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdint.h>
#include "rt_io_base.h"
struct
libusb_context
;
struct
libusb_context
;
struct
libusb_device
;
struct
libusb_device
;
...
@@ -27,12 +28,12 @@ struct libusb_device_descriptor {
...
@@ -27,12 +28,12 @@ struct libusb_device_descriptor {
uint8_t
bNumConfigurations
;
uint8_t
bNumConfigurations
;
};
};
int
libusb_init
(
libusb_context
**
ctx
)
{
return
0
;}
int
libusb_init
(
libusb_context
**
ctx
)
{
return
io_cLibDummy
;}
void
libusb_exit
(
libusb_context
*
ctx
)
{}
void
libusb_exit
(
libusb_context
*
ctx
)
{}
ssize_t
libusb_get_device_list
(
libusb_context
*
ctx
,
ssize_t
libusb_get_device_list
(
libusb_context
*
ctx
,
libusb_device
***
list
)
{
return
0
;}
libusb_device
***
list
)
{
return
0
;}
void
libusb_free_device_list
(
libusb_device
**
list
,
int
unref_devices
)
{}
void
libusb_free_device_list
(
libusb_device
**
list
,
int
unref_devices
)
{}
int
libusb_open
(
libusb_device
*
dev
,
libusb_device_handle
**
handle
)
{
return
0
;}
int
libusb_open
(
libusb_device
*
dev
,
libusb_device_handle
**
handle
)
{
return
io_cLibDummy
;}
void
libusb_close
(
libusb_device_handle
*
dev_handle
)
{}
void
libusb_close
(
libusb_device_handle
*
dev_handle
)
{}
int
libusb_interrupt_transfer
(
libusb_device_handle
*
dev_handle
,
int
libusb_interrupt_transfer
(
libusb_device_handle
*
dev_handle
,
unsigned
char
endpoint
,
unsigned
char
*
data
,
int
length
,
unsigned
char
endpoint
,
unsigned
char
*
data
,
int
length
,
...
...
src/lib/rt/src/rt_io_base.h
View file @
b9210b1a
...
@@ -53,6 +53,8 @@ typedef struct io_sCtx *io_tCtx;
...
@@ -53,6 +53,8 @@ typedef struct io_sCtx *io_tCtx;
#define NULL (void *) 0
#define NULL (void *) 0
#endif
#endif
#define io_cLibDummy -9999
#define IO_CHANLIST_SIZE 250
#define IO_CHANLIST_SIZE 250
#define FIXOUT 2
#define FIXOUT 2
...
...
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