Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add base RPCs and supporting classes #24

Merged
merged 30 commits into from
Nov 21, 2019
Merged

Add base RPCs and supporting classes #24

merged 30 commits into from
Nov 21, 2019

Conversation

joeygrover
Copy link
Member

@joeygrover joeygrover commented Nov 13, 2019

This PR is ready for review.

Risk

This PR makes minor API changes.

Summary

  • Adding RPCs that are necessary for base connection and registration

Tasks Remaining:

  • RegisterAppInterface
  • RegisterAppInterface Response
  • Show
  • Show Response
  • Go back and update correct static member access
  • PutFile
  • PutFile Response
  • SetAppIcon
  • SetAppIcon Response
  • OnHmiStatus

CLA

lib/rpc_spec/MOBILE_API.xml Outdated Show resolved Hide resolved
@vladmu
Copy link
Contributor

vladmu commented Nov 19, 2019

Please take into attention that the RPC generator will cover almost all 'enums/structs/messages' included in this PR, as a part of the generated code. Also, I noticed the difference between currently existed RPC classes and the new ones, at least in the properties declaration, static in-class vs. added after the class declaration. Should we follow the last principle in our generator instead of the old?

@joeygrover
Copy link
Member Author

We are assuming the generator will be able to cover all the RPC related classes in this PR. However, since we do not have timing on when that will be submitted, approved, merged, we must create the base RPCs we need to test other pieces in the library.

If you check the develop branch you will see that the static members were moved because of JavaScript requirements.

Copy link

@nickschwab nickschwab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments/suggestions/requested changes in-line.

Additional comments:

  • MAP should be prefixed with an underscore to represent a private property. Can be addressed in a later passthrough.
  • Recommend naming boolean parameters/variables with the following prefixes: "is", "has", or "can".

lib/js/src/rpc/enums/BitsPerSample.js Show resolved Hide resolved
lib/js/src/rpc/enums/DisplayType.js Outdated Show resolved Hide resolved
lib/js/src/rpc/enums/DisplayType.js Outdated Show resolved Hide resolved
lib/js/src/rpc/enums/HMILevel.js Show resolved Hide resolved
lib/js/src/rpc/enums/HMILevel.js Outdated Show resolved Hide resolved
lib/js/src/rpc/messages/Show.js Outdated Show resolved Hide resolved
lib/js/src/rpc/messages/Show.js Outdated Show resolved Hide resolved
lib/js/src/rpc/messages/Show.js Show resolved Hide resolved
lib/js/src/rpc/messages/Show.js Show resolved Hide resolved
lib/js/src/rpc/messages/Show.js Show resolved Hide resolved
Copy link
Member Author

@joeygrover joeygrover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments/suggestions/requested changes in-line.

Additional comments:

  • MAP should be prefixed with an underscore to represent a private property. Can be addressed in a later passthrough.
  • Recommend naming boolean parameters/variables with the following prefixes: "is", "has", or "can".
  1. Updated
  2. While I agree it should be this way, the RPC classes should reflect the RPC Spec directly for ease of use with the generator.

Copy link

@nickschwab nickschwab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joeygrover Just a few small-ish things; sorry I didn't catch them all on the first review!

lib/js/src/rpc/enums/FunctionID.js Outdated Show resolved Hide resolved
lib/js/src/rpc/enums/TextFieldName.js Outdated Show resolved Hide resolved
lib/js/src/rpc/messages/RegisterAppInterfaceResponse.js Outdated Show resolved Hide resolved
lib/js/src/rpc/messages/RegisterAppInterfaceResponse.js Outdated Show resolved Hide resolved
lib/js/src/rpc/messages/RegisterAppInterfaceResponse.js Outdated Show resolved Hide resolved
lib/js/src/rpc/structs/ButtonCapabilities.js Outdated Show resolved Hide resolved
lib/js/src/rpc/structs/SoftButton.js Outdated Show resolved Hide resolved
lib/js/src/rpc/structs/SoftButton.js Outdated Show resolved Hide resolved
@smartdevicelink smartdevicelink deleted a comment from nickschwab Nov 21, 2019
Co-Authored-By: Nick Schwab <nick.schwab@livio.io>
@joeygrover joeygrover merged commit c3dadc2 into develop Nov 21, 2019
@joeygrover joeygrover deleted the feature/mvp_rpcs branch November 21, 2019 16:09
* @return {AppInfo}
*/
setAppDisplayName(appDisplayName) {
this.setParameter(AppInfo.KEY_APP_DISPLAY_NAME, appDisplayName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to validate Strings? like this.validateType(String, name);

setSamplingRate(samplingRate) {
this.validateType(SamplingRate, samplingRate)

this.setParameter(AudioPassThruCapabilities.KEY_SAMPLING_RATE, samplingRate);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the param for setSamplingRate is object, so shouldn't we use this.setValue(AudioPassThruCapabilities.KEY_SAMPLING_RATE, samplingRate); instead of this.setParameter(AudioPassThruCapabilities.KEY_SAMPLING_RATE, samplingRate);?

*/
setShortPressAvailable(shortPressAvailable) {

this.setValue(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, shortPressAvailable);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shortPressAvailable param is simple Boolean, shouldn't we use this.setParameter(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE, shortPressAvailable); instead of setValue?

*/
setLongPressAvailable(longPressAvailable) {

this.setValue(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE, longPressAvailable);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@smartdevicelink smartdevicelink locked as off-topic and limited conversation to collaborators Nov 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants