public interface IRDeviceAPIService
Example:
IRHTTPClient httpClient = IRKit.sharedInstance().getHTTPClient();
// Set base URL
httpClient.setDeviceAPIEndpoint("http://192.168.1.1"); // IRKit IP address
// Or from IRPeripheral
httpClient.setDeviceAPIEndpoint(peripheral.getDeviceAPIEndpoint());
// Get Device HTTP API service
IRDeviceAPIService deviceAPI = httpClient.getDeviceAPIService();
// Request parameters
IRDeviceAPIService.PostMessagesRequest req = new IRDeviceAPIService.PostMessagesRequest();
req.format = "raw";
req.freq = 38.0f;
req.data = new int[] {
18031, 8755, 1190, 1190, 1190, // ...
};
// Send POST /messages
deviceAPI.postMessages(req, new Callback() {
@Override
public void success(IRDeviceAPIService.PostMessagesResponse postMessagesResponse, Response response) {
// Success
}
@Override
public void failure(RetrofitError error) {
// Error
}
});
Modifier and Type | Interface and Description |
---|---|
static class |
IRDeviceAPIService.GetHomeResponse
getHome()のレスポンスです。
|
static class |
IRDeviceAPIService.GetMessagesResponse
getMessages()のレスポンスです。
Response of getMessages().
|
static class |
IRDeviceAPIService.PostKeysResponse
postKeys()のレスポンスです。
Response of postKeys().
|
static class |
IRDeviceAPIService.PostMessagesRequest
postMessages()のリクエストパラメータです。
Request parameters for postMessages().
|
static class |
IRDeviceAPIService.PostMessagesResponse
postMessages()のレスポンスです。
Response of postMessages().
|
static class |
IRDeviceAPIService.PostWifiResponse
postWifi()のレスポンスです。
Response of postWifi().
|
Modifier and Type | Method and Description |
---|---|
void |
getHome(<any> callback)
"/"(トップページ)にアクセスします。実質的な影響のないリクエストです。接続確認やヘッダ取得用に使います。
Fetches "/" (root).
|
void |
getMessages(<any> callback)
最も新しい受信した赤外線信号を返します。Long pollingには対応していません。
|
void |
postKeys(TypedInput emptyBody,
<any> callback)
clienttoken を取得します。
|
void |
postMessages(IRDeviceAPIService.PostMessagesRequest request,
<any> callback)
赤外線信号を送信します。
|
void |
postWifi(TypedInput body,
<any> callback)
IRKitをWi-Fiに接続させます。
|
void postKeys(TypedInput emptyBody, <any> callback)
callback
- void getMessages(<any> callback)
callback
- void postMessages(IRDeviceAPIService.PostMessagesRequest request, <any> callback)
request
- callback
- void postWifi(TypedInput body, <any> callback)
callback
- void getHome(<any> callback)
callback
- レスポンスを受け取るコールバック。 Callback for receiving the response.