-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
…script_suite into feature/mvp_rpcs # Conflicts: # lib/js/rpc/enums/FunctionID.js
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? |
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 |
There was a problem hiding this 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".
Co-Authored-By: Nick Schwab <nick.schwab@livio.io>
There was a problem hiding this 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".
- Updated
- While I agree it should be this way, the RPC classes should reflect the RPC Spec directly for ease of use with the generator.
There was a problem hiding this 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!
Co-Authored-By: Nick Schwab <nick.schwab@livio.io>
* @return {AppInfo} | ||
*/ | ||
setAppDisplayName(appDisplayName) { | ||
this.setParameter(AppInfo.KEY_APP_DISPLAY_NAME, appDisplayName); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
This PR is ready for review.
Risk
This PR makes minor API changes.
Summary
Tasks Remaining:
CLA