Skip to content

Conversation

@ymalovanyi
Copy link
Contributor

@ymalovanyi ymalovanyi commented Dec 1, 2020

Fixes #338

Risk

This PR makes minor API changes.

Testing Plan

  • I have verified that I have not introduced new warnings in this PR
  • I have run the unit tests with this PR
  • I have tested this PR against Core and verified behavior

Unit Tests

Added unit tests cover [SDL-0255] Enhance BodyInformation vehicle data changes

Core Tests

  • each of the properties in the struct DoorStatus can be received from HMI
  • each of the values in the enum DoorStatusType can be received from HMI
  • each of the properties in the struct GateStatus can be received from HMI
  • each of the properties in the struct RoofStatus can be received from HMI
  • doorStatuses, gateStatuses, roofStatuses properties are present in BodyInformation struct
  • GetVehicleData response message contains bodyInformation parameter with doorStatuses, gateStatuses, roofStatuses properties

Core version / branch / commit hash / module tested against: smartdevicelink/sdl_core#3584
HMI name / version / branch / commit hash / module tested against: smartdevicelink/sdl_hmi#466

Summary

Applied [SDL-0255] Enhance BodyInformation vehicle data changes

Changelog

Breaking Changes
  • N/A
Enhancements
  • New structs DoorStatus, GateStatus, RoofStatus
  • New enum DoorStatusType
  • Added required getters/setters in related RPC classes
Bug Fixes
  • N/A

Tasks Remaining:

  • N/A

CLA

@ymalovanyi
Copy link
Contributor Author

@santhanamk the PR is ready for Ford review.

Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

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

Hi @ymalovanyi I reviewed this PR. I have a few suggestions on the unit tests. Please see if anything needs to be changed.

];

const JSON_DOORSTATUS = Test.JSON_DOORSTATUS = {
[DoorStatus.KEY_LOCATION]: Test.JSON_GRID,

Choose a reason for hiding this comment

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

@ymalovanyi On line 442 does Test.JSON_GRID need to be changed to Test.GENERAL_GRID?

Copy link
Contributor Author

@ymalovanyi ymalovanyi Dec 8, 2020

Choose a reason for hiding this comment

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

No, because then test will fall, as Grid is a struct. Similarly, as in JSON_WINDOWSTATUS, we have Test.JSON_GRID.

];

const JSON_GATESTATUS = Test.JSON_GATESTATUS = {
[GateStatus.KEY_LOCATION]: Test.JSON_GRID,

Choose a reason for hiding this comment

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

@ymalovanyi On line 459 does Test.JSON_GRID need to be changed to Test.GENERAL_GRID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as in above comment.

[BodyInformation.KEY_PASSENGER_DOOR_AJAR]: Test.GENERAL_BOOLEAN,
[BodyInformation.KEY_REAR_LEFT_DOOR_AJAR]: Test.GENERAL_BOOLEAN,
[BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR]: Test.GENERAL_BOOLEAN,
[BodyInformation.KEY_DOOR_STATUSES]: Test.JSON_DOORSTATUS_LIST,

Choose a reason for hiding this comment

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

@ymalovanyi on line 33 does Test.JSON_DOORSTATUS_LIST need to be changed to Test.GENERAL_DOORSTATUS_LIST?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because then test will fall, as DoorStatus is a struct. That is why we need to use list of JSON's.

[BodyInformation.KEY_REAR_LEFT_DOOR_AJAR]: Test.GENERAL_BOOLEAN,
[BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR]: Test.GENERAL_BOOLEAN,
[BodyInformation.KEY_DOOR_STATUSES]: Test.JSON_DOORSTATUS_LIST,
[BodyInformation.KEY_GATE_STATUSES]: Test.JSON_GATESTATUS_LIST,

Choose a reason for hiding this comment

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

@ymalovanyi on line 34 does Test.JSON_GATESTATUS_LIST need to be changed to Test.GENERAL_GATESTATUS_LIST?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as in comment above, GateStatus is a struct.

[BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR]: Test.GENERAL_BOOLEAN,
[BodyInformation.KEY_DOOR_STATUSES]: Test.JSON_DOORSTATUS_LIST,
[BodyInformation.KEY_GATE_STATUSES]: Test.JSON_GATESTATUS_LIST,
[BodyInformation.KEY_ROOF_STATUSES]: Test.JSON_ROOFSTATUS_LIST,

Choose a reason for hiding this comment

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

@ymalovanyi on line 35 does Test.JSON_ROOFSTATUS_LIST need to be changed to Test.GENERAL_ROOFSTATUS_LIST?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as in comment above, RoofStatus is a struct.


this.getExpectedParameters = function (sdlVersion) {
return {
[DoorStatus.KEY_LOCATION]: Test.JSON_GRID,

Choose a reason for hiding this comment

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

@ymalovanyi on line 18 does Test.JSON_GRID need to be changed to Test.GENERAL_GRID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because then test will fail. We're checking for parameters here, and Grid is a struct. That is why we are passing JSON parameters of the struct, but not the whole struct itself.


this.getExpectedParameters = function (sdlVersion) {
return {
[GateStatus.KEY_LOCATION]: Test.JSON_GRID,

Choose a reason for hiding this comment

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

@ymalovanyi On line 18 does Test.JSON_GRID need to be changed to Test.GENERAL_GRID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as in above comment.


this.getExpectedParameters = function (sdlVersion) {
return {
[RoofStatus.KEY_LOCATION]: Test.JSON_GRID,

Choose a reason for hiding this comment

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

@ymalovanyi On line 19 does Test.JSON_GRID need to be changed to Test.GENERAL_GRID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as in above comment.

return {
[RoofStatus.KEY_LOCATION]: Test.JSON_GRID,
[RoofStatus.KEY_STATUS]: Test.GENERAL_DOORSTATUSTYPE,
[RoofStatus.KEY_STATE]: Test.JSON_WINDOW_STATE,

Choose a reason for hiding this comment

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

@ymalovanyi On line 21 does Test.JSON_WINDOW_STATE need to be changed to Test.GENERAL_WINDOW_STATE?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because WindowState is a struct.

Copy link

@santhanamk santhanamk left a comment

Choose a reason for hiding this comment

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

@ymalovanyi thank you for the clarification. I am approving this PR.

@ymalovanyi ymalovanyi marked this pull request as ready for review December 9, 2020 09:55
@ymalovanyi
Copy link
Contributor Author

@santhanamk, thank you for the approval! @crokita, Ford approved this PR, please review.

@jordynmackool
Copy link

Hi @ymalovanyi and @santhanamk, since the core PR for this feature is not complete, it seems that this PR would have not been tested fully. To ensure the review process goes smoothly:

  1. Please avoid removing sections from the PR template as all the information requested is needed.
  2. Please provide the Core branch/PR that this was tested against.

Once this PR is fully tested, tag me and Livio will review. Thank you!

@vladmu
Copy link
Contributor

vladmu commented Dec 18, 2020

@jordynmackool @crokita the description was fixed to include all sections from the template and the code was tested against the Core and HMI (corresponded links also included in the description). Please review.

…nhance-BodyInformation-vehicle-data

# Conflicts:
#	tests/Test.js
@vladmu
Copy link
Contributor

vladmu commented Jan 15, 2021

@crokita, the PR was updated with the latest develop, please don't merge this PR after the approval before this related rpc_spec PR smartdevicelink/rpc_spec#297 is not merged.

Copy link
Contributor

@renonick87 renonick87 left a comment

Choose a reason for hiding this comment

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

This PR is approved. Waiting on smartdevicelink/rpc_spec#297 to be approved before merging.

@renonick87 renonick87 merged commit 0c79267 into smartdevicelink:develop Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SDL 0255] Enhance BodyInformation vehicle data

5 participants