Changeset 119
- Timestamp:
- 06/01/07 00:37:42 (2 years ago)
- Files:
-
- branches/dev/python/Makefile.in (modified) (1 diff)
- branches/dev/python/Wiimote.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dev/python/Makefile.in
r118 r119 21 21 22 22 distclean: clean 23 rm Makefile 23 24 24 25 .PHONY: all install uninstall clean distclean branches/dev/python/Wiimote.c
r118 r119 22 22 * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> 23 23 * * added Wiimote_FromC 24 * * added get_acc_cal 24 25 * 25 26 * 2007-05-27 Arthur Peters <amp@singingwizard.org> … … 68 69 static PyObject *Wiimote_get_mesg(Wiimote *self); 69 70 static PyObject *Wiimote_get_state(Wiimote *self, void *closure); 71 static PyObject *Wiimote_get_acc_cal(Wiimote *self, PyObject *args, 72 PyObject *kwds); 70 73 71 74 static PyObject *Wiimote_request_status(Wiimote *self); … … 95 98 {"get_mesg", (PyCFunction)Wiimote_get_mesg, METH_NOARGS, 96 99 "blocking call to get messages"}, 100 {"get_acc_cal", (PyCFunction)Wiimote_get_acc_cal, 101 METH_VARARGS | METH_KEYWORDS, "get accelerometer calibration"}, 97 102 {"request_status", (PyCFunction)Wiimote_request_status, METH_NOARGS, 98 103 "request status message"}, … … 487 492 } 488 493 494 static PyObject *Wiimote_get_acc_cal(Wiimote *self, PyObject *args, 495 PyObject *kwds) 496 { 497 static char *kwlist[] = { "ext_type", NULL }; 498 int ext_type; 499 struct acc_cal acc_cal; 500 PyObject *PyAccCal; 501 502 if (!PyArg_ParseTupleAndKeywords(args, kwds, 503 "i:cwiid.Wiimote.get_acc_cal", kwlist, 504 &ext_type)) { 505 return NULL; 506 } 507 508 if (cwiid_get_acc_cal(self->wiimote, ext_type, &acc_cal)) { 509 PyErr_SetString(PyExc_IOError, "Wiimote get acc cal error"); 510 return NULL; 511 } 512 513 if (!(PyAccCal = Py_BuildValue("([i,i,i],[i,i,i])", acc_cal.zero[0], 514 acc_cal.zero[1], acc_cal.zero[2], 515 acc_cal.one[0], acc_cal.one[1], 516 acc_cal.one[2]))) { 517 return NULL; 518 } 519 520 return PyAccCal; 521 } 522 489 523 static PyObject *Wiimote_request_status(Wiimote *self) 490 524 {
