{"issue":{"created_at":"2011-11-20T18:15:59Z","state":"open","updated_at":"2011-11-20T18:15:59Z","user":{"gravatar_id":"9d45ff5b7ca5fa48e732d21622592652","id":1208666,"url":"https://api.github.com/users/deepnote","login":"deepnote","avatar_url":"https://secure.gravatar.com/avatar/9d45ff5b7ca5fa48e732d21622592652?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":0,"body":"Hi,\r\nsample cant detect product ID. I`ve done this to get it work:\r\n\r\n```C\r\n_device = HidDevices.Enumerate(VendorId, 0xC21E).FirstOrDefault();\r\n```\r\nAnd then it throw exception:\r\n\r\n```C\r\n  public PrecisionMessage(byte[] message)\r\n        {\r\n            if (message != null && message.Length == 4)\r\n            {\r\n                Array.Reverse(message);\r\n                _message = BitConverter.ToUInt32(message, 0);\r\n            }\r\n            else throw new InvalidCastException(\"Cannot convert gamepad message to 32 bit integer.\");\r\n            _buttonsPressed = GetButtonsPressed(this);\r\n        }\r\n```\r\n\r\n```C\r\nSystem.InvalidCastException was unhandled\r\n  Message=Cannot convert gamepad message to 32 bit integer.\r\n  Source=LogitechGamepad\r\n  StackTrace:\r\n       v LogitechGamepad.PrecisionMessage..ctor(Byte[] message) v C:\\Users\\Ivo\\Desktop\\mikeobrien-HidLibrary-d682227\\src\\Samples\\LogitechGamepad\\PrecisionMessage.cs:řádek 40\r\n       v LogitechGamepad.MessageFactory.CreateMessage(Int32 productId, Byte[] messageData) v C:\\Users\\Ivo\\Desktop\\mikeobrien-HidLibrary-d682227\\src\\Samples\\LogitechGamepad\\MessageFactory.cs:řádek 12\r\n       v LogitechGamepad.Program.OnReport(HidReport report) v C:\\Users\\Ivo\\Desktop\\mikeobrien-HidLibrary-d682227\\src\\Samples\\LogitechGamepad\\Program.cs:řádek 55\r\n       v HidLibrary.HidDevice.EndReadReport(IAsyncResult ar) v C:\\Users\\Ivo\\Desktop\\mikeobrien-HidLibrary-d682227\\src\\Current\\HidLibrary\\HidDevice.cs:řádek 242\r\n       v System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(IMessage msg)\r\n       v System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)\r\n       v System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.DoAsyncCall()\r\n       v System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Object o)\r\n       v System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)\r\n       v System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)\r\n       v System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()\r\n       v System.Threading.ThreadPoolWorkQueue.Dispatch()\r\n       v System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()\r\n  InnerException: \r\n\r\n```\r\nWindows 7, x64. Sorry if this is useless observation.\r\n","assignee":null,"id":2296397,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":14,"labels":[],"title":"logitech gamepad sample","html_url":"https://github.com/mikeobrien/HidLibrary/issues/14","closed_at":null,"milestone":null,"url":"https://api.github.com/repos/mikeobrien/HidLibrary/issues/14"},"action":"opened"}