控制器 API 参考Controller API reference

通过使用此 REST API,可以获取附加物理控制器的数量并将其关闭。You can get the number of attached physical controllers and turn them off using this REST API.

确定附加物理控制器的数量Determine the number of attached physical controllers

请求Request

可以使用以下请求检查设备上附加的物理控制器的数量。You can check the number of attached physical controllers on the device using the following request.

方法Method | 请求 URIRequest URI :------ | :----- GETGET | /ext/remoteinput/controllers/ext/remoteinput/controllers
URI 参数URI parameters

  • None

请求标头Request headers

  • None

请求正文Request body

  • None

响应Response

  • JSON 数字属性 ConnectedControllerCount,指定附加物理控制器的数量。JSON number property ConnectedControllerCount which specifies the number of attached physical controllers.

状态代码Status code

此 API 具有以下预期状态代码。This API has the following expected status codes.

HTTP 状态代码HTTP status code 描述Description
200200 成功Success
4XX4XX 错误代码Error codes
5XX5XX 错误代码Error codes

断开开发工具包上所有物理控制器的连接Disconnect all physical controllers on the devkit

请求Request

可以使用以下请求断开设备上所有物理控制器的连接。You can disconnect all physical controllers on the device using the following request.

方法Method | 请求 URIRequest URI :------ | :----- DELETEDELETE | /ext/remoteinput/controllers/ext/remoteinput/controllers
URI 参数URI parameters

  • None

请求标头Request headers

  • None

请求正文Request body

  • None

响应Response

  • None

状态代码Status code

此 API 具有以下预期状态代码。This API has the following expected status codes.

HTTP 状态代码HTTP status code 描述Description
204204 断开控制器的请求已成功。The request to disconnect controllers was successful.
4XX4XX 错误代码Error codes
5XX5XX 错误代码Error codes

**可用的设备系列****Available device families**
  • Windows XboxWindows Xbox