-
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
[SDL-0262] New vehicle data SeatOccupancy #351
[SDL-0262] New vehicle data SeatOccupancy #351
Conversation
@santhanamk the PR is ready for Ford review. |
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.
Hi @ymalovanyi I reviewed the PR. Code looks good.
I have a few comments. Please look through it, and see if any changes need to be made.
tests/Test.js
Outdated
}; | ||
|
||
const GENERAL_SEAT_OCCUPANCY = Test.GENERAL_SEAT_OCCUPANCY = new SeatOccupancy() | ||
.setSeatsOccupied([Test.GENERAL_SEAT_STATUS]) |
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.
Given that seatsOccupied
and seatsBelted
are arrays in the 'SeatsOccupancy.js' struct, does the GENERAL_SEAT_STATUS
on line 431 need to be instantiated differently?
For example on line 128 imageTypeSupported
is an array and is set up with the GENERAL_FILETYPE_LIST
using the line GENERAL_IMAGEFIELD.setImageTypeSupported(GENERAL_FILETYPE_LIST);
.
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.
Hi @santhanamk
I've created GENERAL_SEAT_STATUS_LIST and JSON_SEATSTATUS_LIST arrays to make code look cleaner.
|
||
// Valid Tests | ||
Validator.assertEquals(this.stabilityControlsStatus, testStabilityControlsStatus); | ||
Validator.assertEquals(Test.GENERAL_BOOLEAN, testHandsOffSteering); | ||
Validator.assertEquals([Test.GENERAL_WINDOW_STATUS], testWindowStatus); | ||
Validator.assertEquals(this.gearStatus, testGearStatus); | ||
Validator.assertEquals(Test.GENERAL_SEAT_OCCUPANCY, testSeatOccupancy); |
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.
On line 80 are brackets ( [] ) needed around Test.GENERAL_SEAT_OCCUPANCY
similar to line 76 for Test.GENERAL_WINDOW_STATUS
?
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.
No, because seatOccupancy is not an array (SeatOccupancy), compared to windowStatus which is indeed an array (WindowStatus[])
|
||
// Valid Tests | ||
Validator.assertEquals(this.stabilityControlsStatus, testStabilityControlsStatus); | ||
Validator.assertEquals([Test.GENERAL_WINDOW_STATUS], testWindowStatus); | ||
Validator.assertEquals(this.gearStatus, testGearStatus); | ||
Validator.assertEquals(Test.GENERAL_SEAT_OCCUPANCY, testSeatOccupancy); |
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.
On line 78 are brackets ( [] ) needed around Test.GENERAL_SEAT_OCCUPANCY
similar to line 76 for Test.GENERAL_WINDOW_STATUS
?
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.
Also not needed, same as in GetVehicleDataResponseTests.js
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.
Hi @ymalovanyi . The changes you have made from the code review good. I will approve this PR. Thanks.
@santhanamk, thank you for the approval! @crokita, Ford approved this PR, please review. |
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:
Once this PR is fully tested, tag me and Livio will review. Thank you! |
@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. |
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.
Successfully tested against core and sdl_hmi. Everything here looks good. Approved.
Hi @renonick87, after merging, we have some conflicted vehicle data PRs. Could you define which will be reviewed next, then we could prepare it and fix conflicts before your review? |
Fixes #336
Risk
This PR makes minor API changes.
Testing Plan
Unit Tests
Added unit tests cover [SDL 0262] New vehicle data SeatOccupancy changes
Core Tests
VehicleDataType
enum contains additional value"VEHICLEDATA_SEATOCCUPANCY"
SeatStatus
can be received from HMISeatOccupancy
can be received from HMISubscribeVehicleData
,UnsubscribeVehicleData
,GetVehicleData
request messages can be sent withseatOccupancy
parameter defined as boolean valueSubscribeVehicleData
,UnsubscribeVehicleData
response messages containseatOccupancy
parameter defined asVehicleDataResult
structGetVehicleData
,OnVehicleData
response messages containseatOccupancy
parameter defined asSeatOccupancy
structCore version / branch / commit hash / module tested against: smartdevicelink/sdl_core#3585
HMI name / version / branch / commit hash / module tested against: smartdevicelink/sdl_hmi#467
Summary
Applied [SDL 0262] New vehicle data SeatOccupancy changes
Changelog
Breaking Changes
N/A
Enhancements
SeatStatus
,SeatOccupancy
Bug Fixes
N/A
Tasks Remaining:
N/A
CLA