lib
xspublic
xscontroller
udev.h
Go to the documentation of this file.
1
2
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
3
// All rights reserved.
4
//
5
// Redistribution and use in source and binary forms, with or without modification,
6
// are permitted provided that the following conditions are met:
7
//
8
// 1. Redistributions of source code must retain the above copyright notice,
9
// this list of conditions, and the following disclaimer.
10
//
11
// 2. Redistributions in binary form must reproduce the above copyright notice,
12
// this list of conditions, and the following disclaimer in the documentation
13
// and/or other materials provided with the distribution.
14
//
15
// 3. Neither the names of the copyright holders nor the names of their contributors
16
// may be used to endorse or promote products derived from this software without
17
// specific prior written permission.
18
//
19
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22
// THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
// SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24
// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
26
// TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
28
// SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
29
// OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
30
// ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
31
//
32
33
34
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
35
// All rights reserved.
36
//
37
// Redistribution and use in source and binary forms, with or without modification,
38
// are permitted provided that the following conditions are met:
39
//
40
// 1. Redistributions of source code must retain the above copyright notice,
41
// this list of conditions, and the following disclaimer.
42
//
43
// 2. Redistributions in binary form must reproduce the above copyright notice,
44
// this list of conditions, and the following disclaimer in the documentation
45
// and/or other materials provided with the distribution.
46
//
47
// 3. Neither the names of the copyright holders nor the names of their contributors
48
// may be used to endorse or promote products derived from this software without
49
// specific prior written permission.
50
//
51
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
52
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
53
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
54
// THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55
// SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
56
// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
58
// TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
59
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
60
// SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
61
// OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
62
// ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
63
//
64
65
#ifndef UDEV
66
#define UDEV
67
68
struct
udev;
69
struct
udev_device;
70
struct
udev_enumerate;
71
struct
udev_list_entry;
72
73
struct
XsLibraryLoader
;
74
75
typedef
struct
udev*
uDEV_new
(
void
);
76
typedef
struct
udev*
uDEV_unref
(
struct
udev* udev);
77
typedef
struct
udev_device*
uDEV_device_unref
(
struct
udev_device* udev_device);
78
typedef
struct
udev_enumerate*
uDEV_enumerate_new
(
struct
udev* udev);
79
typedef
int
uDEV_enumerate_add_match_subsystem
(
struct
udev_enumerate* udev_enumerate,
const
char
* subsystem);
80
typedef
int
uDEV_enumerate_scan_devices
(
struct
udev_enumerate* udev_enumerate);
81
typedef
struct
udev_list_entry*
uDEV_enumerate_get_list_entry
(
struct
udev_enumerate* udev_enumerate);
82
typedef
struct
udev_enumerate*
uDEV_enumerate_unref
(
struct
udev_enumerate* udev_enumerate);
83
typedef
struct
udev_list_entry*
uDEV_list_entry_get_next
(
struct
udev_list_entry* list_entry);
84
typedef
const
char
*
uDEV_list_entry_get_name
(
struct
udev_list_entry* list_entry);
85
typedef
struct
udev_device*
uDEV_device_new_from_syspath
(
struct
udev* udev,
const
char
* syspath);
86
typedef
struct
udev_device*
uDEV_device_get_parent
(
struct
udev_device* udev_device);
87
typedef
const
char
*
uDEV_device_get_devnode
(
struct
udev_device* udev_device);
88
typedef
struct
udev_device*
uDEV_device_get_parent_with_subsystem_devtype
(
struct
udev_device* udev_device,
const
char
* subsystem,
const
char
* devtype);
89
typedef
const
char
*
uDEV_device_get_sysattr_value
(
struct
udev_device* udev_device,
const
char
* sysattr);
90
91
#ifdef __cplusplus
92
class
Udev
93
{
94
public
:
95
Udev
(
void
);
96
~
Udev
(
void
);
97
98
uDEV_new
unew;
99
uDEV_unref
unref;
100
uDEV_device_unref
device_unref;
101
uDEV_enumerate_new
enumerate_new;
102
uDEV_enumerate_add_match_subsystem
enumerate_add_match_subsystem;
103
uDEV_enumerate_scan_devices
enumerate_scan_devices;
104
uDEV_enumerate_get_list_entry
enumerate_get_list_entry;
105
uDEV_enumerate_unref
enumerate_unref;
106
uDEV_list_entry_get_next
list_entry_get_next;
107
uDEV_list_entry_get_name
list_entry_get_name;
108
uDEV_device_new_from_syspath
device_new_from_syspath;
109
uDEV_device_get_parent
device_get_parent;
110
uDEV_device_get_devnode
device_get_devnode;
111
uDEV_device_get_parent_with_subsystem_devtype
device_get_parent_with_subsystem_devtype;
112
uDEV_device_get_sysattr_value
device_get_sysattr_value;
113
114
private
:
115
116
struct
UDEV_API
117
{
118
uDEV_new
* unew;
119
uDEV_unref
* unref;
120
uDEV_device_unref
* device_unref;
121
uDEV_enumerate_new
* enumerate_new;
122
uDEV_enumerate_add_match_subsystem
* enumerate_add_match_subsystem;
123
uDEV_enumerate_scan_devices
* enumerate_scan_devices;
124
uDEV_enumerate_get_list_entry
* enumerate_get_list_entry;
125
uDEV_enumerate_unref
* enumerate_unref;
126
uDEV_list_entry_get_next
* list_entry_get_next;
127
uDEV_list_entry_get_name
* list_entry_get_name;
128
uDEV_device_new_from_syspath
* device_new_from_syspath;
129
uDEV_device_get_parent
* device_get_parent;
130
uDEV_device_get_devnode
* device_get_devnode;
131
uDEV_device_get_parent_with_subsystem_devtype
* device_get_parent_with_subsystem_devtype;
132
uDEV_device_get_sysattr_value
* device_get_sysattr_value;
133
} m_uDev;
134
135
XsLibraryLoader
* m_libraryLoader;
136
137
void
initLibrary();
138
Udev
(
Udev
const
&) =
delete
;
139
Udev
const
& operator = (
Udev
const
&) =
delete
;
140
};
141
#endif
142
143
#endif
uDEV_list_entry_get_name
const typedef char * uDEV_list_entry_get_name(struct udev_list_entry *list_entry)
uDEV_list_entry_get_next
struct udev_list_entry * uDEV_list_entry_get_next(struct udev_list_entry *list_entry)
Definition:
udev.h:83
uDEV_device_get_parent_with_subsystem_devtype
struct udev_device * uDEV_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype)
Definition:
udev.h:88
uDEV_device_get_sysattr_value
const typedef char * uDEV_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr)
uDEV_enumerate_scan_devices
int uDEV_enumerate_scan_devices(struct udev_enumerate *udev_enumerate)
Definition:
udev.h:80
uDEV_device_new_from_syspath
struct udev_device * uDEV_device_new_from_syspath(struct udev *udev, const char *syspath)
Definition:
udev.h:85
uDEV_device_unref
struct udev_device * uDEV_device_unref(struct udev_device *udev_device)
Definition:
udev.h:77
XsLibraryLoader
The Xsens dynamic library loader base class.
Definition:
xslibraryloader.h:93
uDEV_enumerate_get_list_entry
struct udev_list_entry * uDEV_enumerate_get_list_entry(struct udev_enumerate *udev_enumerate)
Definition:
udev.h:81
Udev
Class for dynamic loading of winusb.
uDEV_enumerate_new
struct udev_enumerate * uDEV_enumerate_new(struct udev *udev)
Definition:
udev.h:78
uDEV_enumerate_add_match_subsystem
int uDEV_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem)
Definition:
udev.h:79
uDEV_enumerate_unref
struct udev_enumerate * uDEV_enumerate_unref(struct udev_enumerate *udev_enumerate)
Definition:
udev.h:82
uDEV_unref
struct udev * uDEV_unref(struct udev *udev)
Definition:
udev.h:76
uDEV_device_get_parent
struct udev_device * uDEV_device_get_parent(struct udev_device *udev_device)
Definition:
udev.h:86
uDEV_new
struct udev * uDEV_new(void)
Definition:
udev.h:75
uDEV_device_get_devnode
const typedef char * uDEV_device_get_devnode(struct udev_device *udev_device)
xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:20