Skip to content

Commit 636a6cb

Browse files
authored
Merge pull request #96 from smartdevicelink/feature/urai-response-rpc
Add UnregisterAppInterfaceResponse
2 parents e366b70 + 6c9345a commit 636a6cb

File tree

9 files changed

+112
-10
lines changed

9 files changed

+112
-10
lines changed

examples/js/hello-sdl/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@
115115
}
116116

117117
// tear down the app
118-
await this._asyncSendRpc(new SDL.rpc.messages.UnregisterAppInterface())
119-
.catch(() => {}); // UnregisterAppInterfaceResponse not implemented yet. catch the error
118+
await this._asyncSendRpc(new SDL.rpc.messages.UnregisterAppInterface());
119+
120120
this._manager.stop();
121121
}
122122
}

examples/node/hello-sdl/MyApp.js

Whitespace-only changes.

examples/node/hello-sdl/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ class HelloSdl {
120120
}
121121

122122
// tear down the app
123-
await this._asyncSendRpc(new SDL.rpc.messages.UnregisterAppInterface())
124-
.catch(() => {}); // UnregisterAppInterfaceResponse not implemented yet. catch the error
123+
await this._asyncSendRpc(new SDL.rpc.messages.UnregisterAppInterface());
124+
125125
this._manager.stop();
126126
}
127127
}

lib/js/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ import { SetAppIconResponse } from './src/rpc/messages/SetAppIconResponse.js';
9494
import { Show } from './src/rpc/messages/Show.js';
9595
import { ShowResponse } from './src/rpc/messages/ShowResponse.js';
9696
import { UnregisterAppInterface } from './src/rpc/messages/UnregisterAppInterface.js';
97+
import { UnregisterAppInterfaceResponse } from './src/rpc/messages/UnregisterAppInterfaceResponse.js';
9798
import { AppInfo } from './src/rpc/structs/AppInfo.js';
9899
import { AudioPassThruCapabilities } from './src/rpc/structs/AudioPassThruCapabilities.js';
99100
import { ButtonCapabilities } from './src/rpc/structs/ButtonCapabilities.js';
@@ -224,6 +225,7 @@ const SDL = {
224225
Show,
225226
ShowResponse,
226227
UnregisterAppInterface,
228+
UnregisterAppInterfaceResponse,
227229
},
228230
structs: {
229231
AppInfo,

lib/js/dist/SDL.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/js/src/rpc/RpcCreator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import { SetAppIconResponse } from './messages/SetAppIconResponse.js';
4444
import { Show } from './messages/Show.js';
4545
import { ShowResponse } from './messages/ShowResponse.js';
4646
import { UnregisterAppInterface } from './messages/UnregisterAppInterface.js';
47+
import { UnregisterAppInterfaceResponse } from './messages/UnregisterAppInterfaceResponse.js';
4748

4849
// other
4950
import { RpcType } from './enums/RpcType.js';
@@ -122,8 +123,9 @@ class RpcCreator {
122123
case FunctionID.UnregisterAppInterface:
123124
if (rpcType === RpcType.REQUEST) {
124125
message = new UnregisterAppInterface(params);
126+
} else if (rpcType === RpcType.RESPONSE) {
127+
message = new UnregisterAppInterfaceResponse(params);
125128
}
126-
// else if (rpcType === RpcType.RESPONSE) TODO: make UnregisterAppInterfaceResponse
127129
break;
128130
default:
129131
message = null;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright (c) 2019, Livio, Inc.
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* Redistributions of source code must retain the above copyright notice, this
9+
* list of conditions and the following disclaimer.
10+
*
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following
13+
* disclaimer in the documentation and/or other materials provided with the
14+
* distribution.
15+
*
16+
* Neither the name of the Livio Inc. nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30+
* POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
33+
import { RpcResponse } from '../RpcResponse.js';
34+
import { FunctionID } from '../enums/FunctionID.js';
35+
36+
class UnregisterAppInterfaceResponse extends RpcResponse {
37+
/**
38+
* @constructor
39+
*/
40+
constructor (store) {
41+
super(store);
42+
this.setFunctionName(FunctionID.UnregisterAppInterface);
43+
}
44+
}
45+
46+
export { UnregisterAppInterfaceResponse };

lib/node/dist/index.js

Lines changed: 53 additions & 3 deletions
Large diffs are not rendered by default.

lib/node/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ import { SetAppIconResponse } from './../js/src/rpc/messages/SetAppIconResponse.
9494
import { Show } from './../js/src/rpc/messages/Show.js';
9595
import { ShowResponse } from './../js/src/rpc/messages/ShowResponse.js';
9696
import { UnregisterAppInterface } from './../js/src/rpc/messages/UnregisterAppInterface.js';
97+
import { UnregisterAppInterfaceResponse } from './../js/src/rpc/messages/UnregisterAppInterfaceResponse.js';
9798
import { AppInfo } from './../js/src/rpc/structs/AppInfo.js';
9899
import { AudioPassThruCapabilities } from './../js/src/rpc/structs/AudioPassThruCapabilities.js';
99100
import { ButtonCapabilities } from './../js/src/rpc/structs/ButtonCapabilities.js';
@@ -226,6 +227,7 @@ const SDL = {
226227
Show,
227228
ShowResponse,
228229
UnregisterAppInterface,
230+
UnregisterAppInterfaceResponse,
229231
},
230232
structs: {
231233
AppInfo,

0 commit comments

Comments
 (0)