{"issue":{"created_at":"2011-11-22T20:19:30Z","state":"closed","updated_at":"2011-11-29T18:56:45Z","user":{"gravatar_id":"8de40b79337c65ed3306cf6f6113f72b","id":61129,"url":"https://api.github.com/users/rpavlik","avatar_url":"https://secure.gravatar.com/avatar/8de40b79337c65ed3306cf6f6113f72b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"rpavlik"},"comments":5,"body":"Following report is an email communication from @jzarl - attachment at https://gist.github.com/0da060e5936046066c87\r\n\r\n---\r\n\r\nOn upgrading our version of wiiuse I encountered a strange bug:\r\nThe first connection (when running a vrpn server) to the Wiimote\r\nworks fine. However, if I turn off the wiimote and then turn it\r\nback on, it does not get reconnected anymore.\r\n\r\nI narrowed the bug down a little bit:\r\nThe behaviour first shows up in revision 1a9293ab296ce949010bbc9401e8e3d6e5a0c6b5\r\n(That revision doesn't compile on its own, but you can apply the\r\nattached \"patch_endian.diff\" from a later revision to make it work)\r\n\r\nBy reducing the changeset in rev 1a9293ab296ce949010bbc9401e8e3d6e5a0c6b5,\r\nI could further narrow down the problem to the following patch:\r\n(to be applied to rev 1572f382abf4ca1bca4a5fd153d51a726097e7f9)\r\n\r\n```\r\ndiff --git a/src/wiiuse.h b/src/wiiuse.h\r\nindex 2a7d500..598a437 100644\r\n--- a/src/wiiuse.h\r\n+++ b/src/wiiuse.h\r\n@@ -589,6 +589,11 @@ typedef struct wiimote_state_t {\r\n       struct vec3b_t exp_accel;\r\n       float exp_r_shoulder;\r\n       float exp_l_shoulder;\r\n+\r\n+       /* motion plus */\r\n+       short drx;\r\n+       short dry;\r\n+       short drz;\r\n\r\n       /* wiiboard */\r\n       uint16_t exp_wb_rtr;\r\n\r\n```\r\n\r\nI must say I'm a little lost here. I understand that the only wiimote_state_t\r\nis the lstate member of the wiimote_t structure. lstate is only ever touched by\r\nsave_state() and state_changed() in events.c.\r\n\r\nI have no idea how introducing a simple member to this structure would introduce\r\nthe bug mentioned above.\r\n\r\nDo you have any idea on what causes this behaviour and how to solve the bug?","assignee":null,"id":2322528,"number":9,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[{"name":"regression","color":"e10c02","url":"https://api.github.com/repos/rpavlik/wiiuse/labels/regression"}],"title":"Regression in reconnection","closed_at":"2011-11-29T18:56:45Z","html_url":"https://github.com/rpavlik/wiiuse/issues/9","url":"https://api.github.com/repos/rpavlik/wiiuse/issues/9","milestone":null},"action":"closed"}