gpiod 2.4.1__tar.gz → 2.4.2__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.4.1/gpiod.egg-info → gpiod-2.4.2}/PKG-INFO +1 -1
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/ext/line-settings.c +0 -4
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/ext/request.c +12 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/version.py +1 -1
- {gpiod-2.4.1 → gpiod-2.4.2/gpiod.egg-info}/PKG-INFO +1 -1
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/chip-info.c +3 -3
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/internal.c +1 -1
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/internal.h +1 -1
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/line-request.c +5 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/line-settings.c +1 -1
- gpiod-2.4.2/libgpiod-version.txt +1 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/tests_line_request.py +22 -0
- gpiod-2.4.1/libgpiod-version.txt +0 -1
- {gpiod-2.4.1 → gpiod-2.4.2}/LICENSE +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/MANIFEST.in +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/README.md +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/build_tests.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/__init__.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/_ext.pyi +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/_internal.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/chip.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/chip_info.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/edge_event.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/exception.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/ext/chip.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/ext/common.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/ext/internal.h +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/ext/line-config.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/ext/module.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/info_event.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/line.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/line_info.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/line_request.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/line_settings.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod/py.typed +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod.egg-info/SOURCES.txt +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod.egg-info/dependency_links.txt +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/gpiod.egg-info/top_level.txt +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/include/gpiod.h +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/chip.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/edge-event.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/info-event.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/line-config.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/line-info.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/misc.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/request-config.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/lib/uapi/gpio.h +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/pyproject.toml +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/setup.cfg +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/setup.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/__init__.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/__main__.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/gpiosim/__init__.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/gpiosim/chip.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/gpiosim/ext.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/helpers.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/system/__init__.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/system/ext.c +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/tests_chip.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/tests_chip_info.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/tests_edge_event.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/tests_info_event.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/tests_line.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/tests_line_info.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/tests_line_settings.py +0 -0
- {gpiod-2.4.1 → gpiod-2.4.2}/tests/tests_module.py +0 -0
|
@@ -70,10 +70,6 @@ line_settings_init(line_settings_object *self, PyObject *args, PyObject *kwargs)
|
|
|
70
70
|
gpiod_line_settings_set_debounce_period_us(self->settings,
|
|
71
71
|
debounce_period);
|
|
72
72
|
|
|
73
|
-
ret = gpiod_line_settings_set_edge_detection(self->settings, edge);
|
|
74
|
-
if (ret)
|
|
75
|
-
return set_error();
|
|
76
|
-
|
|
77
73
|
ret = gpiod_line_settings_set_output_value(self->settings,
|
|
78
74
|
output_value);
|
|
79
75
|
if (ret)
|
|
@@ -149,6 +149,12 @@ static PyObject *request_get_values(request_object *self, PyObject *args)
|
|
|
149
149
|
if (num_offsets < 0)
|
|
150
150
|
return NULL;
|
|
151
151
|
|
|
152
|
+
if (num_offsets > (Py_ssize_t)self->num_lines) {
|
|
153
|
+
PyErr_SetString(PyExc_ValueError,
|
|
154
|
+
"number of offsets exceeds the number of requested lines");
|
|
155
|
+
return NULL;
|
|
156
|
+
}
|
|
157
|
+
|
|
152
158
|
iter = PyObject_GetIter(offsets);
|
|
153
159
|
if (!iter)
|
|
154
160
|
return NULL;
|
|
@@ -212,6 +218,12 @@ static PyObject *request_set_values(request_object *self, PyObject *args)
|
|
|
212
218
|
if (!ret)
|
|
213
219
|
return NULL;
|
|
214
220
|
|
|
221
|
+
if (PyObject_Size(values) > (Py_ssize_t)self->num_lines) {
|
|
222
|
+
PyErr_SetString(PyExc_ValueError,
|
|
223
|
+
"number of offsets exceeds the number of requested lines");
|
|
224
|
+
return NULL;
|
|
225
|
+
}
|
|
226
|
+
|
|
215
227
|
clear_buffers(self);
|
|
216
228
|
|
|
217
229
|
/* Note: pos may not be contiguous. */
|
|
@@ -57,7 +57,7 @@ gpiod_chip_info_from_uapi(struct gpiochip_info *uapi_info)
|
|
|
57
57
|
* GPIO device must have a name - don't bother checking this field. In
|
|
58
58
|
* the worst case (would have to be a weird kernel bug) it'll be empty.
|
|
59
59
|
*/
|
|
60
|
-
strncpy(info->name, uapi_info->name,
|
|
60
|
+
strncpy(info->name, uapi_info->name, GPIO_MAX_NAME_SIZE);
|
|
61
61
|
|
|
62
62
|
/*
|
|
63
63
|
* The kernel sets the label of a GPIO device to "unknown" if it
|
|
@@ -65,9 +65,9 @@ gpiod_chip_info_from_uapi(struct gpiochip_info *uapi_info)
|
|
|
65
65
|
* we got an empty string, do the same.
|
|
66
66
|
*/
|
|
67
67
|
if (uapi_info->label[0] == '\0')
|
|
68
|
-
strncpy(info->label, "unknown",
|
|
68
|
+
strncpy(info->label, "unknown", GPIO_MAX_NAME_SIZE);
|
|
69
69
|
else
|
|
70
|
-
strncpy(info->label, uapi_info->label,
|
|
70
|
+
strncpy(info->label, uapi_info->label, GPIO_MAX_NAME_SIZE);
|
|
71
71
|
|
|
72
72
|
return info;
|
|
73
73
|
}
|
|
@@ -41,7 +41,7 @@ int gpiod_set_output_value(enum gpiod_line_value in,
|
|
|
41
41
|
int gpiod_ioctl(int fd, unsigned long request, void *arg);
|
|
42
42
|
|
|
43
43
|
void gpiod_line_mask_zero(uint64_t *mask);
|
|
44
|
-
bool gpiod_line_mask_test_bit(const uint64_t *mask, int nr);
|
|
44
|
+
bool gpiod_line_mask_test_bit(const uint64_t *mask, unsigned int nr);
|
|
45
45
|
void gpiod_line_mask_set_bit(uint64_t *mask, unsigned int nr);
|
|
46
46
|
void gpiod_line_mask_assign_bit(uint64_t *mask, unsigned int nr, bool value);
|
|
47
47
|
|
|
@@ -24,6 +24,11 @@ gpiod_line_request_from_uapi(struct gpio_v2_line_request *uapi_req,
|
|
|
24
24
|
{
|
|
25
25
|
struct gpiod_line_request *request;
|
|
26
26
|
|
|
27
|
+
if (uapi_req->num_lines > GPIO_V2_LINES_MAX) {
|
|
28
|
+
errno = EINVAL;
|
|
29
|
+
return NULL;
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
request = malloc(sizeof(*request));
|
|
28
33
|
if (!request)
|
|
29
34
|
return NULL;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.2.4
|
|
@@ -676,6 +676,28 @@ class LineRequestSurvivesParentChip(TestCase):
|
|
|
676
676
|
req.release()
|
|
677
677
|
|
|
678
678
|
|
|
679
|
+
class UsingMoreLinesThanRequestedNotAllowed(TestCase):
|
|
680
|
+
def setUp(self) -> None:
|
|
681
|
+
self.sim = gpiosim.Chip(num_lines=4)
|
|
682
|
+
|
|
683
|
+
def tearDown(self) -> None:
|
|
684
|
+
del self.sim
|
|
685
|
+
|
|
686
|
+
def test_line_get_more_values_than_requested_lines(self) -> None:
|
|
687
|
+
with gpiod.request_lines(
|
|
688
|
+
self.sim.dev_path, config={0: gpiod.LineSettings(direction=Direction.INPUT)}
|
|
689
|
+
) as req:
|
|
690
|
+
with self.assertRaises(ValueError):
|
|
691
|
+
req.get_values(list(range(64)))
|
|
692
|
+
|
|
693
|
+
def test_line_set_more_values_than_requested_lines(self) -> None:
|
|
694
|
+
with gpiod.request_lines(
|
|
695
|
+
self.sim.dev_path, config={0: gpiod.LineSettings(direction=Direction.OUTPUT)}
|
|
696
|
+
) as req:
|
|
697
|
+
with self.assertRaises(ValueError):
|
|
698
|
+
req.set_values({i: Value.ACTIVE for i in range(64)})
|
|
699
|
+
|
|
700
|
+
|
|
679
701
|
class LineRequestStringRepresentation(TestCase):
|
|
680
702
|
def setUp(self) -> None:
|
|
681
703
|
self.sim = gpiosim.Chip(num_lines=8)
|
gpiod-2.4.1/libgpiod-version.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.2.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|