Skip to content

Commit eae70ff

Browse files
made meth_generic_api_read_data optional and better default
1 parent cda8479 commit eae70ff

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

include/methods.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,7 @@ PyObject* meth_generic_api_get_status(PyObject* self, PyObject* args);
16501650

16511651
// if (!PyArg_ParseTuple(args, arg_parse("ObbI:", __FUNCTION__), &obj, &apiIndex, &instanceIndex, &length)) {
16521652
#define _DOC_GENERIC_API_READ_DATA \
1653-
MODULE_NAME ".generic_api_send_command(device, api_index, instance_index, length)\n" \
1653+
MODULE_NAME ".generic_api_read_data(device, api_index, instance_index, [length])\n" \
16541654
"\n" \
16551655
"Reads data in a generic way.\n" \
16561656
"\n" \
@@ -1659,7 +1659,7 @@ PyObject* meth_generic_api_get_status(PyObject* self, PyObject* args);
16591659
"\tapi_index (:class:`int`): api_index.\n\n" \
16601660
"\tinstance_index (:class:`int`): instance_index.\n\n" \
16611661
"\tfunction_index (:class:`int`): function_index.\n\n" \
1662-
"\tlength (:class:`int`): Length of the data to read.\n\n" \
1662+
"\tlength (:class:`int`): (optional) Length of the data to read. defaults to `GENERIC_API_DATA_BUFFER_SIZE`\n\n" \
16631663
"\n" \
16641664
"Raises:\n" \
16651665
"\t:class:`" MODULE_NAME ".RuntimeError`\n" \

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
MAJOR_VERSION = 910
1212
MINOR_VERSION = 10
13-
POST_VERSION = 5
13+
POST_VERSION = 6
1414

1515
if POST_VERSION:
1616
VERSION_STRING = '%d.%d-%d' % (MAJOR_VERSION, MINOR_VERSION, POST_VERSION)

src/methods.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3964,8 +3964,8 @@ PyObject* meth_generic_api_read_data(PyObject* self, PyObject* args)
39643964
PyObject* obj = NULL;
39653965
unsigned char apiIndex = 0;
39663966
unsigned char instanceIndex = 0;
3967-
unsigned int length = 0;
3968-
if (!PyArg_ParseTuple(args, arg_parse("ObbI:", __FUNCTION__), &obj, &apiIndex, &instanceIndex, &length)) {
3967+
unsigned int length = GENERIC_API_DATA_BUFFER_SIZE;
3968+
if (!PyArg_ParseTuple(args, arg_parse("Obb|I:", __FUNCTION__), &obj, &apiIndex, &instanceIndex, &length)) {
39693969
return NULL;
39703970
}
39713971
// Get the device handle

0 commit comments

Comments
 (0)