How to communicate with Xbox one controller in uwp?
I can use Windows.Gaming.Input to get the key input of the handle (this is the handle of a third-party manufacturer and has passed Microsoft Certification), but I want to communicate with the device through byte array.
I notice the namespace: Windows.Gaming.Input.Custom, I can connect to the device through this, but through the GipGameControllerProvider.SendMessage/SendReceiveMessage Unable to send any command to device.
So I'd like to ask if there is any way for me to communicate with the xbox controller?
thanks.
Universal Windows Platform (UWP)
-
Victor Chen 106 Reputation points
2020-03-13T02:41:18.323+00:00 Forgot to mention it: I use bus hound to determine if I have successfully sent a command to Xbox one controller
-
Fay Wang - MSFT 5,196 Reputation points
2020-03-13T06:32:24.913+00:00 I'm not sure how to send byte array to xbox one controller and why the SendMessage can't work, so I will ask the team about this.
-
Victor Chen 106 Reputation points
2020-03-13T09:02:09.823+00:00 Great! Thank you very much for your reply, i'm wating :)
And it doesn't have to be a byte array, I just want to be able to send requests and receive data to the device in any way
Thanks again. -
Fay Wang - MSFT 5,196 Reputation points
2020-03-16T09:50:19.613+00:00 WGI.Custom is typically not used to communicate with the Xbox One controller, but rather custom devices. Is there any reason why you aren’t using the GetCurrentReading to get the controller state? Are you trying to send custom commands unsupported by the controller?
-
Victor Chen 106 Reputation points
2020-03-17T01:47:05.447+00:00 Thanks for reply. And yes, what I send is the nonstandard Xbox One controller command. And now, i can send the command to the controller through GipGameControllerProvider.SendMessage(GipMessageClass.Command, 0x0f, buffer), but I still can't get the command from the controller. GipGameControllerProvider.SendReceiveMessage looks like what I want, but calling it will get an error: the request is not supported (exception from HResult: 0x80070032).
-
Victor Chen 106 Reputation points
2020-03-17T01:56:06.23+00:00 It should be noted that GetCurrentReading cannot get custom commands sent by the controller, such as lights color stored in the controller, key mapping and other configurations, because this Xbox one controller adds additional functions.
-
Victor Chen 106 Reputation points
2020-03-24T06:17:42.49+00:00 It may seem unreasonable to me, but I'd like to ask if there is any news now?
-
Fay Wang - MSFT 5,196 Reputation points
2020-03-26T01:31:28.477+00:00 About your last reply, I haven't received a reply from the team yet.
-
Victor Chen 106 Reputation points
2020-03-26T01:34:17.987+00:00 I see, Thank you!
-
Victor Chen 106 Reputation points
2020-04-14T02:09:29.633+00:00 Sorry, I'm crazy about this question. Do you have any reply from the team?
-
Fay Wang - MSFT 5,196 Reputation points
2020-04-15T08:47:29.633+00:00 I'm sorry to say that I haven't received a reply from the team.
-
Victor Chen 106 Reputation points
2020-04-15T09:07:40.973+00:00 It's ok, thanks.
-
Elly 1 Reputation point
2021-11-26T03:32:14.34+00:00 I face the same problem. I saw all the document about Windows.Gaming.Input.Custom class in Microsoft Learn and did not find any smaple code about how to get GipGameControllerProvider since it is not a static class. I tried to new GipGameControllerProvider() but showed the error message "GipGameControllerProvider does not contain a constructor that takes 0 arguments".
I want to use GipGameControllerProvider.SendMessage/SendReceiveMessage to send custom data to XBOX device.
Does anyone knows that how to get or create GipGameControllerProvider?
thanks.
Sign in to comment