我正在尝试为具有基于加速度计的方向控制的android制作一个游戏手柄.到目前为止,我已经成功完成了android部分.现在我需要使用Wi-Fi连接计算机I/O端口以获取游戏手柄.我不知道该怎么做.我需要嵌入式系统编程知识.但我甚至不知道从哪里开始?事实上我甚至不知道这是否可能?我通过互联网搜索了很多关于使用并行端口或串口的连接.但是每个页面都说你必须有一个并行端口母连接器才能做到这一点(现在并行端口连接器已经灭绝,因为USB已经取代了它们).我知道当我通过Wi-Fi工作时,我不需要连接任何这些外部连接器的引脚.
我已经在OAuth2中为该请求成功实现了对新令牌的请求:
curl --request POST --url https://some-autentication-server.com/token --header 'content-type: content-type'
Run Code Online (Sandbox Code Playgroud)
提供的身体为:
{
"grant_type"="password",
"username"="username",
"password"="password"
"client_id"="my-client-id"
}
Run Code Online (Sandbox Code Playgroud)
认证后,资源服务器curl可以通过以下方式访问:
curl -i -H "authorization: Bearer token-received-from-auth-server" \
-H "accept: application/json" \
-H "request-id: abcdef" \
-H "consent-status: optedIn" \
-X GET https://my-resource-server.com/path
Run Code Online (Sandbox Code Playgroud)
我在Spring Boot中使用的配置是这样的:
@EnableOAuth2Client
@Configuration
public class OauthClientConfig {
@Bean
public CloseableHttpClient httpClient() throws Exception {
CloseableHttpClient httpClient = null;
try {
httpClient = HttpClientBuilder.create()
.setProxy(new HttpHost("PROXY_HOST_NAME", 3000, "http"))
.build();
} catch (Exception e) {
throw e;
}
return httpClient;
}
@Bean …Run Code Online (Sandbox Code Playgroud) java oauth-2.0 oauth2client spring-boot spring-security-oauth2