Skip to content

Commit cc12a69

Browse files
authored
Merge pull request #277 from smartdevicelink/bugfix/send-rpc-wrong-method
Fix example apps to use sendRpcResolve
2 parents 3e6d3bc + 3b1fde0 commit cc12a69

17 files changed

Lines changed: 85 additions & 92 deletions

File tree

examples/js/hello-sdl/SDL.min.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.

examples/js/hello-sdl/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@
168168
.setMainField2('')
169169
.setMainField3('');
170170

171-
this._sdlManager.sendRpc(showCountdown); // don't wait for a response
171+
this._sdlManager.sendRpcResolve(showCountdown); // don't wait for a response
172172

173173
await this._sleep();
174174
}
175175

176176
// tear down the app
177-
await this._sdlManager.sendRpc(new SDL.rpc.messages.UnregisterAppInterface());
177+
await this._sdlManager.sendRpcResolve(new SDL.rpc.messages.UnregisterAppInterface());
178178

179179
this._sdlManager.dispose();
180180
}

examples/node/hello-sdl-tcp/SDL.min.js

Lines changed: 14 additions & 15 deletions
Large diffs are not rendered by default.

examples/node/hello-sdl-tcp/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ class AppClient {
163163
.setMainField2('')
164164
.setMainField3('');
165165

166-
this._sdlManager.sendRpc(showCountdown); // don't wait for a response
166+
this._sdlManager.sendRpcResolve(showCountdown); // don't wait for a response
167167

168168
await this._sleep();
169169
}
170170

171171
// tear down the app
172-
await this._sdlManager.sendRpc(new SDL.rpc.messages.UnregisterAppInterface());
172+
await this._sdlManager.sendRpcResolve(new SDL.rpc.messages.UnregisterAppInterface());
173173

174174
this._sdlManager.dispose();
175175
}

examples/node/hello-sdl/SDL.min.js

Lines changed: 14 additions & 15 deletions
Large diffs are not rendered by default.

examples/webengine/hello-sdl/SDL.min.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.

examples/webengine/hello-sdl/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@
162162
.setMainField2('')
163163
.setMainField3('');
164164

165-
this._sdlManager.sendRpc(showCountdown); // don't wait for a response
165+
this._sdlManager.sendRpcResolve(showCountdown); // don't wait for a response
166166

167167
await this._sleep();
168168
}
169169

170170
// tear down the app
171-
await this._sdlManager.sendRpc(new SDL.rpc.messages.UnregisterAppInterface());
171+
await this._sdlManager.sendRpcResolve(new SDL.rpc.messages.UnregisterAppInterface());
172172

173173
this._sdlManager.dispose();
174174
}

lib/js/dist/SDL.min.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/manager/SdlManager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ class SdlManager extends _SdlManagerBase {
184184
// Icon not uploaded yet
185185
const uploadResult = await this._fileManager.uploadArtwork(this._lifecycleConfig.getAppIcon());
186186
if (uploadResult) {
187-
await this.sendRpc(
187+
await this.sendRpcResolve(
188188
new SetAppIcon().setFileName(this._lifecycleConfig.getAppIcon().getName())
189189
);
190190
}
191191
} else {
192192
// Icon already uploaded
193-
await this.sendRpc(
193+
await this.sendRpcResolve(
194194
new SetAppIcon().setFileName(this._lifecycleConfig.getAppIcon().getName())
195195
);
196196
}
@@ -241,7 +241,7 @@ class SdlManager extends _SdlManagerBase {
241241
changeRegistration.setTtsName(lifecycleConfigUpdate.getTtsName());
242242
}
243243

244-
this.sendRpc(changeRegistration)
244+
this.sendRpcResolve(changeRegistration)
245245
.then((response) => {
246246
this._lifecycleConfig.setLanguageDesired(actualLanguage);
247247
this._lifecycleConfig.setHmiDisplayLanguageDesired(actualLanguage);

lib/js/src/manager/file/_FileManagerBase.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class _FileManagerBase extends _SubManagerBase {
8989

9090
const listFiles = new ListFiles();
9191

92-
const rpcResponse = await this._lifecycleManager.sendRpcMessage(listFiles);
92+
const rpcResponse = await this._lifecycleManager.sendRpcResolve(listFiles);
9393
if (rpcResponse.getSuccess()) {
9494
this._bytesAvailable = rpcResponse.getSpaceAvailable() ? rpcResponse.getSpaceAvailable() : SPACE_AVAILABLE_MAX_VALUE;
9595
const filenames = rpcResponse.getFilenames();
@@ -113,7 +113,7 @@ class _FileManagerBase extends _SubManagerBase {
113113
const deleteFile = new DeleteFile()
114114
.setSdlFileName(fileName);
115115

116-
const rpcResponse = await this._lifecycleManager.sendRpcMessage(deleteFile);
116+
const rpcResponse = await this._lifecycleManager.sendRpcResolve(deleteFile);
117117
const isSuccess = rpcResponse.getSuccess();
118118
if (isSuccess) {
119119
this._bytesAvailable = rpcResponse.getSpaceAvailable() ? rpcResponse.getSpaceAvailable() : SPACE_AVAILABLE_MAX_VALUE;
@@ -164,7 +164,7 @@ class _FileManagerBase extends _SubManagerBase {
164164
}
165165
const putFile = await this._createPutFile(sdlFile);
166166

167-
const putFileResponse = await this._lifecycleManager.sendRpcMessage(putFile);
167+
const putFileResponse = await this._lifecycleManager.sendRpcResolve(putFile);
168168
if (putFileResponse.getSuccess()) {
169169
this._bytesAvailable = putFileResponse.getSpaceAvailable() !== null ? putFileResponse.getSpaceAvailable() : SPACE_AVAILABLE_MAX_VALUE;
170170
this._remoteFiles.push(sdlFile.getName());

0 commit comments

Comments
 (0)