gpiod 2.2.1__tar.gz → 2.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gpiod-2.2.1/gpiod.egg-info → gpiod-2.2.3}/PKG-INFO +1 -1
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/chip.py +1 -2
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/ext/chip.c +24 -15
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/ext/common.c +9 -5
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/ext/internal.h +2 -1
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/ext/request.c +26 -13
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/line_settings.py +1 -1
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/version.py +1 -1
- {gpiod-2.2.1 → gpiod-2.2.3/gpiod.egg-info}/PKG-INFO +1 -1
- {gpiod-2.2.1 → gpiod-2.2.3}/include/gpiod.h +8 -8
- gpiod-2.2.3/libgpiod-version.txt +1 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/setup.py +5 -1
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/tests_line_settings.py +1 -1
- gpiod-2.2.1/libgpiod-version.txt +0 -1
- {gpiod-2.2.1 → gpiod-2.2.3}/MANIFEST.in +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/README.md +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/build_tests.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/__init__.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/chip_info.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/edge_event.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/exception.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/ext/line-config.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/ext/line-settings.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/ext/module.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/info_event.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/internal.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/line.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/line_info.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod/line_request.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod.egg-info/SOURCES.txt +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod.egg-info/dependency_links.txt +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/gpiod.egg-info/top_level.txt +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/chip-info.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/chip.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/edge-event.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/info-event.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/internal.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/internal.h +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/line-config.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/line-info.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/line-request.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/line-settings.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/misc.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/request-config.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/lib/uapi/gpio.h +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/pyproject.toml +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/setup.cfg +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/__init__.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/__main__.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/gpiosim/__init__.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/gpiosim/chip.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/gpiosim/ext.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/helpers.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/procname/__init__.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/procname/ext.c +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/tests_chip.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/tests_chip_info.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/tests_edge_event.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/tests_info_event.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/tests_line.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/tests_line_info.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/tests_line_request.py +0 -0
- {gpiod-2.2.1 → gpiod-2.2.3}/tests/tests_module.py +0 -0
|
@@ -14,7 +14,6 @@ from collections import Counter
|
|
|
14
14
|
from collections.abc import Iterable
|
|
15
15
|
from datetime import timedelta
|
|
16
16
|
from errno import ENOENT
|
|
17
|
-
from select import select
|
|
18
17
|
from typing import Union, Optional
|
|
19
18
|
|
|
20
19
|
__all__ = "Chip"
|
|
@@ -226,7 +225,7 @@ class Chip:
|
|
|
226
225
|
config: dict[tuple[Union[int, str]], Optional[LineSettings]],
|
|
227
226
|
consumer: Optional[str] = None,
|
|
228
227
|
event_buffer_size: Optional[int] = None,
|
|
229
|
-
output_values: Optional[dict[
|
|
228
|
+
output_values: Optional[dict[Union[int, str], Value]] = None,
|
|
230
229
|
) -> LineRequest:
|
|
231
230
|
"""
|
|
232
231
|
Request a set of lines for exclusive usage.
|
|
@@ -75,31 +75,34 @@ static PyObject *chip_get_info(chip_object *self, PyObject *Py_UNUSED(ignored))
|
|
|
75
75
|
struct gpiod_chip_info *info;
|
|
76
76
|
PyObject *type, *ret;
|
|
77
77
|
|
|
78
|
-
type =
|
|
78
|
+
type = Py_gpiod_GetModuleAttrString("gpiod.chip_info", "ChipInfo");
|
|
79
79
|
if (!type)
|
|
80
80
|
return NULL;
|
|
81
81
|
|
|
82
82
|
info = gpiod_chip_get_info(self->chip);
|
|
83
|
-
if (!info)
|
|
83
|
+
if (!info) {
|
|
84
|
+
Py_DECREF(type);
|
|
84
85
|
return PyErr_SetFromErrno(PyExc_OSError);
|
|
86
|
+
}
|
|
85
87
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
ret = PyObject_CallFunction(type, "ssI",
|
|
89
|
+
gpiod_chip_info_get_name(info),
|
|
90
|
+
gpiod_chip_info_get_label(info),
|
|
91
|
+
gpiod_chip_info_get_num_lines(info));
|
|
92
|
+
gpiod_chip_info_free(info);
|
|
93
|
+
Py_DECREF(type);
|
|
94
|
+
return ret;
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
static PyObject *make_line_info(struct gpiod_line_info *info)
|
|
95
98
|
{
|
|
96
|
-
PyObject *type;
|
|
99
|
+
PyObject *type, *ret;
|
|
97
100
|
|
|
98
|
-
type =
|
|
101
|
+
type = Py_gpiod_GetModuleAttrString("gpiod.line_info", "LineInfo");
|
|
99
102
|
if (!type)
|
|
100
103
|
return NULL;
|
|
101
104
|
|
|
102
|
-
|
|
105
|
+
ret = PyObject_CallFunction(type, "IsOsiOiiiiOk",
|
|
103
106
|
gpiod_line_info_get_offset(info),
|
|
104
107
|
gpiod_line_info_get_name(info),
|
|
105
108
|
gpiod_line_info_is_used(info) ?
|
|
@@ -115,6 +118,8 @@ static PyObject *make_line_info(struct gpiod_line_info *info)
|
|
|
115
118
|
gpiod_line_info_is_debounced(info) ?
|
|
116
119
|
Py_True : Py_False,
|
|
117
120
|
gpiod_line_info_get_debounce_period_us(info));
|
|
121
|
+
Py_DECREF(type);
|
|
122
|
+
return ret;
|
|
118
123
|
}
|
|
119
124
|
|
|
120
125
|
static PyObject *chip_get_line_info(chip_object *self, PyObject *args)
|
|
@@ -168,10 +173,6 @@ chip_read_info_event(chip_object *self, PyObject *Py_UNUSED(ignored))
|
|
|
168
173
|
struct gpiod_info_event *event;
|
|
169
174
|
struct gpiod_line_info *info;
|
|
170
175
|
|
|
171
|
-
type = Py_gpiod_GetGlobalType("InfoEvent");
|
|
172
|
-
if (!type)
|
|
173
|
-
return NULL;
|
|
174
|
-
|
|
175
176
|
Py_BEGIN_ALLOW_THREADS;
|
|
176
177
|
event = gpiod_chip_read_info_event(self->chip);
|
|
177
178
|
Py_END_ALLOW_THREADS;
|
|
@@ -186,11 +187,19 @@ chip_read_info_event(chip_object *self, PyObject *Py_UNUSED(ignored))
|
|
|
186
187
|
return NULL;
|
|
187
188
|
}
|
|
188
189
|
|
|
190
|
+
type = Py_gpiod_GetModuleAttrString("gpiod.info_event", "InfoEvent");
|
|
191
|
+
if (!type) {
|
|
192
|
+
Py_DECREF(info_obj);
|
|
193
|
+
gpiod_info_event_free(event);
|
|
194
|
+
return NULL;
|
|
195
|
+
}
|
|
196
|
+
|
|
189
197
|
event_obj = PyObject_CallFunction(type, "iKO",
|
|
190
198
|
gpiod_info_event_get_event_type(event),
|
|
191
199
|
gpiod_info_event_get_timestamp_ns(event),
|
|
192
200
|
info_obj);
|
|
193
201
|
Py_DECREF(info_obj);
|
|
202
|
+
Py_DECREF(type);
|
|
194
203
|
gpiod_info_event_free(event);
|
|
195
204
|
return event_obj;
|
|
196
205
|
}
|
|
@@ -64,15 +64,19 @@ PyObject *Py_gpiod_SetErrFromErrno(void)
|
|
|
64
64
|
return PyErr_SetFromErrno(exc);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
PyObject *
|
|
67
|
+
PyObject *Py_gpiod_GetModuleAttrString(const char *modname,
|
|
68
|
+
const char *attrname)
|
|
68
69
|
{
|
|
69
|
-
PyObject *
|
|
70
|
+
PyObject *module, *attribute;
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
if (!
|
|
72
|
+
module = PyImport_ImportModule(modname);
|
|
73
|
+
if (!module)
|
|
73
74
|
return NULL;
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
attribute = PyObject_GetAttrString(module, attrname);
|
|
77
|
+
Py_DECREF(module);
|
|
78
|
+
|
|
79
|
+
return attribute;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
unsigned int Py_gpiod_PyLongAsUnsignedInt(PyObject *pylong)
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
#include <Python.h>
|
|
9
9
|
|
|
10
10
|
PyObject *Py_gpiod_SetErrFromErrno(void);
|
|
11
|
-
PyObject *
|
|
11
|
+
PyObject *Py_gpiod_GetModuleAttrString(const char *modname,
|
|
12
|
+
const char *attrname);
|
|
12
13
|
unsigned int Py_gpiod_PyLongAsUnsignedInt(PyObject *pylong);
|
|
13
14
|
void Py_gpiod_dealloc(PyObject *self);
|
|
14
15
|
PyObject *Py_gpiod_MakeRequestObject(struct gpiod_line_request *request,
|
|
@@ -149,10 +149,6 @@ static PyObject *request_get_values(request_object *self, PyObject *args)
|
|
|
149
149
|
if (num_offsets < 0)
|
|
150
150
|
return NULL;
|
|
151
151
|
|
|
152
|
-
type = Py_gpiod_GetGlobalType("Value");
|
|
153
|
-
if (!type)
|
|
154
|
-
return NULL;
|
|
155
|
-
|
|
156
152
|
iter = PyObject_GetIter(offsets);
|
|
157
153
|
if (!iter)
|
|
158
154
|
return NULL;
|
|
@@ -183,25 +179,33 @@ static PyObject *request_get_values(request_object *self, PyObject *args)
|
|
|
183
179
|
if (ret)
|
|
184
180
|
return Py_gpiod_SetErrFromErrno();
|
|
185
181
|
|
|
182
|
+
type = Py_gpiod_GetModuleAttrString("gpiod.line", "Value");
|
|
183
|
+
if (!type)
|
|
184
|
+
return NULL;
|
|
185
|
+
|
|
186
186
|
for (pos = 0; pos < num_offsets; pos++) {
|
|
187
187
|
val = PyObject_CallFunction(type, "i", self->values[pos]);
|
|
188
|
-
if (!val)
|
|
188
|
+
if (!val) {
|
|
189
|
+
Py_DECREF(type);
|
|
189
190
|
return NULL;
|
|
191
|
+
}
|
|
190
192
|
|
|
191
193
|
ret = PyList_SetItem(values, pos, val);
|
|
192
194
|
if (ret) {
|
|
193
195
|
Py_DECREF(val);
|
|
196
|
+
Py_DECREF(type);
|
|
194
197
|
return NULL;
|
|
195
198
|
}
|
|
196
199
|
}
|
|
197
200
|
|
|
201
|
+
Py_DECREF(type);
|
|
198
202
|
Py_RETURN_NONE;
|
|
199
203
|
}
|
|
200
204
|
|
|
201
205
|
static PyObject *request_set_values(request_object *self, PyObject *args)
|
|
202
206
|
{
|
|
203
207
|
PyObject *values, *key, *val, *val_stripped;
|
|
204
|
-
Py_ssize_t pos = 0;
|
|
208
|
+
Py_ssize_t pos = 0, index = 0;
|
|
205
209
|
int ret;
|
|
206
210
|
|
|
207
211
|
ret = PyArg_ParseTuple(args, "O", &values);
|
|
@@ -210,8 +214,9 @@ static PyObject *request_set_values(request_object *self, PyObject *args)
|
|
|
210
214
|
|
|
211
215
|
clear_buffers(self);
|
|
212
216
|
|
|
217
|
+
/* Note: pos may not be contiguous. */
|
|
213
218
|
while (PyDict_Next(values, &pos, &key, &val)) {
|
|
214
|
-
self->offsets[
|
|
219
|
+
self->offsets[index] = Py_gpiod_PyLongAsUnsignedInt(key);
|
|
215
220
|
if (PyErr_Occurred())
|
|
216
221
|
return NULL;
|
|
217
222
|
|
|
@@ -219,15 +224,17 @@ static PyObject *request_set_values(request_object *self, PyObject *args)
|
|
|
219
224
|
if (!val_stripped)
|
|
220
225
|
return NULL;
|
|
221
226
|
|
|
222
|
-
self->values[
|
|
227
|
+
self->values[index] = PyLong_AsLong(val_stripped);
|
|
223
228
|
Py_DECREF(val_stripped);
|
|
224
229
|
if (PyErr_Occurred())
|
|
225
230
|
return NULL;
|
|
231
|
+
|
|
232
|
+
index++;
|
|
226
233
|
}
|
|
227
234
|
|
|
228
235
|
Py_BEGIN_ALLOW_THREADS;
|
|
229
236
|
ret = gpiod_line_request_set_values_subset(self->request,
|
|
230
|
-
|
|
237
|
+
index,
|
|
231
238
|
self->offsets,
|
|
232
239
|
self->values);
|
|
233
240
|
Py_END_ALLOW_THREADS;
|
|
@@ -279,10 +286,6 @@ static PyObject *request_read_edge_events(request_object *self, PyObject *args)
|
|
|
279
286
|
max_events = 64;
|
|
280
287
|
}
|
|
281
288
|
|
|
282
|
-
type = Py_gpiod_GetGlobalType("EdgeEvent");
|
|
283
|
-
if (!type)
|
|
284
|
-
return NULL;
|
|
285
|
-
|
|
286
289
|
Py_BEGIN_ALLOW_THREADS;
|
|
287
290
|
ret = gpiod_line_request_read_edge_events(self->request,
|
|
288
291
|
self->buffer, max_events);
|
|
@@ -296,10 +299,17 @@ static PyObject *request_read_edge_events(request_object *self, PyObject *args)
|
|
|
296
299
|
if (!events)
|
|
297
300
|
return NULL;
|
|
298
301
|
|
|
302
|
+
type = Py_gpiod_GetModuleAttrString("gpiod.edge_event", "EdgeEvent");
|
|
303
|
+
if (!type) {
|
|
304
|
+
Py_DECREF(events);
|
|
305
|
+
return NULL;
|
|
306
|
+
}
|
|
307
|
+
|
|
299
308
|
for (i = 0; i < num_events; i++) {
|
|
300
309
|
event = gpiod_edge_event_buffer_get_event(self->buffer, i);
|
|
301
310
|
if (!event) {
|
|
302
311
|
Py_DECREF(events);
|
|
312
|
+
Py_DECREF(type);
|
|
303
313
|
return NULL;
|
|
304
314
|
}
|
|
305
315
|
|
|
@@ -311,6 +321,7 @@ static PyObject *request_read_edge_events(request_object *self, PyObject *args)
|
|
|
311
321
|
gpiod_edge_event_get_line_seqno(event));
|
|
312
322
|
if (!event_obj) {
|
|
313
323
|
Py_DECREF(events);
|
|
324
|
+
Py_DECREF(type);
|
|
314
325
|
return NULL;
|
|
315
326
|
}
|
|
316
327
|
|
|
@@ -318,10 +329,12 @@ static PyObject *request_read_edge_events(request_object *self, PyObject *args)
|
|
|
318
329
|
if (ret) {
|
|
319
330
|
Py_DECREF(event_obj);
|
|
320
331
|
Py_DECREF(events);
|
|
332
|
+
Py_DECREF(type);
|
|
321
333
|
return NULL;
|
|
322
334
|
}
|
|
323
335
|
}
|
|
324
336
|
|
|
337
|
+
Py_DECREF(type);
|
|
325
338
|
return events;
|
|
326
339
|
}
|
|
327
340
|
|
|
@@ -27,7 +27,7 @@ class LineSettings:
|
|
|
27
27
|
# __repr__ generated by @dataclass uses repr for enum members resulting in
|
|
28
28
|
# an unusable representation as those are of the form: <NAME: $value>
|
|
29
29
|
def __repr__(self):
|
|
30
|
-
return "gpiod.LineSettings(direction={}, edge_detection={}, bias={}, drive={}, active_low={}, debounce_period={}, event_clock={}, output_value={})".format(
|
|
30
|
+
return "gpiod.LineSettings(direction=gpiod.line.{}, edge_detection=gpiod.line.{}, bias=gpiod.line.{}, drive=gpiod.line.{}, active_low={}, debounce_period={}, event_clock=gpiod.line.{}, output_value=gpiod.line.{})".format(
|
|
31
31
|
str(self.direction),
|
|
32
32
|
str(self.edge_detection),
|
|
33
33
|
str(self.bias),
|
|
@@ -246,7 +246,7 @@ int gpiod_chip_get_fd(struct gpiod_chip *chip);
|
|
|
246
246
|
* on the chip.
|
|
247
247
|
* @param chip GPIO chip object.
|
|
248
248
|
* @param timeout_ns Wait time limit in nanoseconds. If set to 0, the function
|
|
249
|
-
* returns
|
|
249
|
+
* returns immediately. If set to a negative number, the
|
|
250
250
|
* function blocks indefinitely until an event becomes
|
|
251
251
|
* available.
|
|
252
252
|
* @return 0 if wait timed out, -1 if an error occurred, 1 if an event is
|
|
@@ -498,10 +498,10 @@ bool gpiod_line_info_is_used(struct gpiod_line_info *info);
|
|
|
498
498
|
* @brief Get the name of the consumer of the line.
|
|
499
499
|
* @param info GPIO line info object.
|
|
500
500
|
* @return Name of the GPIO consumer as it is represented in the kernel.
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
501
|
+
* This function returns a valid pointer to a null-terminated string
|
|
502
|
+
* or NULL if the consumer name is not set.
|
|
503
|
+
* The string lifetime is tied to the line info object so the pointer
|
|
504
|
+
* must not be freed.
|
|
505
505
|
*/
|
|
506
506
|
const char *gpiod_line_info_get_consumer(struct gpiod_line_info *info);
|
|
507
507
|
|
|
@@ -509,7 +509,7 @@ const char *gpiod_line_info_get_consumer(struct gpiod_line_info *info);
|
|
|
509
509
|
* @brief Get the direction setting of the line.
|
|
510
510
|
* @param info GPIO line info object.
|
|
511
511
|
* @return Returns ::GPIOD_LINE_DIRECTION_INPUT or
|
|
512
|
-
*
|
|
512
|
+
* ::GPIOD_LINE_DIRECTION_OUTPUT.
|
|
513
513
|
*/
|
|
514
514
|
enum gpiod_line_direction
|
|
515
515
|
gpiod_line_info_get_direction(struct gpiod_line_info *info);
|
|
@@ -518,7 +518,7 @@ gpiod_line_info_get_direction(struct gpiod_line_info *info);
|
|
|
518
518
|
* @brief Get the edge detection setting of the line.
|
|
519
519
|
* @param info GPIO line info object.
|
|
520
520
|
* @return Returns ::GPIOD_LINE_EDGE_NONE, ::GPIOD_LINE_EDGE_RISING,
|
|
521
|
-
*
|
|
521
|
+
* ::GPIOD_LINE_EDGE_FALLING or ::GPIOD_LINE_EDGE_BOTH.
|
|
522
522
|
*/
|
|
523
523
|
enum gpiod_line_edge
|
|
524
524
|
gpiod_line_info_get_edge_detection(struct gpiod_line_info *info);
|
|
@@ -1164,7 +1164,7 @@ int gpiod_line_request_get_fd(struct gpiod_line_request *request);
|
|
|
1164
1164
|
* @brief Wait for edge events on any of the requested lines.
|
|
1165
1165
|
* @param request GPIO line request.
|
|
1166
1166
|
* @param timeout_ns Wait time limit in nanoseconds. If set to 0, the function
|
|
1167
|
-
* returns
|
|
1167
|
+
* returns immediately. If set to a negative number, the
|
|
1168
1168
|
* function blocks indefinitely until an event becomes
|
|
1169
1169
|
* available.
|
|
1170
1170
|
* @return 0 if wait timed out, -1 if an error occurred, 1 if an event is
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.2
|
|
@@ -70,6 +70,7 @@ def fetch_tarball(command):
|
|
|
70
70
|
def wrapper(self):
|
|
71
71
|
# Just-in-time import of tarfile and urllib.request so these are
|
|
72
72
|
# not required for Yocto to build a vendored or linked package
|
|
73
|
+
import sys
|
|
73
74
|
import tarfile
|
|
74
75
|
from tempfile import TemporaryDirectory
|
|
75
76
|
from urllib.request import urlretrieve
|
|
@@ -122,7 +123,10 @@ def fetch_tarball(command):
|
|
|
122
123
|
# Unpack the downloaded tarball
|
|
123
124
|
log.info(f"unpacking: {tarball_filename}")
|
|
124
125
|
with tarfile.open(downloaded_tarball) as f:
|
|
125
|
-
|
|
126
|
+
if sys.version_info < (3, 12):
|
|
127
|
+
f.extractall(temp_dir)
|
|
128
|
+
else:
|
|
129
|
+
f.extractall(temp_dir, filter=tarfile.fully_trusted_filter)
|
|
126
130
|
|
|
127
131
|
# Copy the include and lib directories we need to build libgpiod
|
|
128
132
|
base_dir = path.join(temp_dir, f"libgpiod-{LIBGPIOD_VERSION}")
|
|
@@ -69,7 +69,7 @@ class LineSettingsStringRepresentation(TestCase):
|
|
|
69
69
|
def test_repr(self):
|
|
70
70
|
self.assertEqual(
|
|
71
71
|
repr(self.settings),
|
|
72
|
-
"gpiod.LineSettings(direction=Direction.OUTPUT, edge_detection=Edge.NONE, bias=Bias.AS_IS, drive=Drive.OPEN_SOURCE, active_low=True, debounce_period=datetime.timedelta(0), event_clock=Clock.MONOTONIC, output_value=Value.INACTIVE)",
|
|
72
|
+
"gpiod.LineSettings(direction=gpiod.line.Direction.OUTPUT, edge_detection=gpiod.line.Edge.NONE, bias=gpiod.line.Bias.AS_IS, drive=gpiod.line.Drive.OPEN_SOURCE, active_low=True, debounce_period=datetime.timedelta(0), event_clock=gpiod.line.Clock.MONOTONIC, output_value=gpiod.line.Value.INACTIVE)",
|
|
73
73
|
)
|
|
74
74
|
|
|
75
75
|
cmp = eval(repr(self.settings))
|
gpiod-2.2.1/libgpiod-version.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.1.3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|