summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/hwdmodule.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/hwdmodule.cpp b/src/hwdmodule.cpp
index d0565df..3d21e08 100644
--- a/src/hwdmodule.cpp
+++ b/src/hwdmodule.cpp
@@ -11,8 +11,27 @@ static PyObject * hwd_stop_server(PyObject * self, PyObject * args)
}
+static PyObject * hwd_get_value(PyObject * self, PyObject * args)
+{
+ const int value = hwd::get_value();
+ return PyLong_FromLong(value);
+}
+
+
+static PyObject * hwd_set_value(PyObject * self, PyObject * args)
+{
+ int value = 0;
+ if (!PyArg_ParseTuple(args, "i", &value))
+ return NULL;
+ hwd::set_value(value);
+ Py_RETURN_NONE;
+}
+
+
static PyMethodDef HwdMethods[] = {
{"stop_server", hwd_stop_server, METH_VARARGS, "Shutdown daemon instance"},
+ {"get_value", hwd_get_value, METH_VARARGS, "Gets value from the daemon instance"},
+ {"set_value", hwd_set_value, METH_VARARGS, "Sets integer value in the daemon instance"},
{NULL, NULL, 0, NULL}
};