Skip to content
New issue

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

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

Already on GitHub? # to your account

Initial implementation of expanded mobile PutFile #2128

Conversation

AByzhynar
Copy link
Contributor

@AByzhynar AByzhynar commented Apr 11, 2018

Fixes #1455

This PR is ready for review.

Risk

This PR makes minor API changes.

Testing Plan

ATF tests scripts will be provided

Summary

Implemented function in PutFile which correctly calculates CRC32 checksum
Added comparison of calculated CRC checksum with received in PutFile
request.
Added PutFile response generation in case of CRC sum mismatch
Fixed handling of unsigned integer values

Tasks Remaining:

  • [ATF test scripts]
  • [Unit tests]

CLA

namespace {

uint32_t GetCrc32CheckSum(const std::vector<uint8_t>& binary_data) {
std::size_t file_size = binary_data.size();
Copy link
Contributor

Choose a reason for hiding this comment

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

@AByzhynar const variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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


namespace {

uint32_t GetCrc32CheckSum(const std::vector<uint8_t>& binary_data) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@AByzhynar documentation would be nice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

const size_t bin_data_size = binary_data.size();

if ((*message_)[strings::msg_params].keyExists(strings::crc32_check_sum)) {
LOG4CXX_DEBUG(logger_, "Binary Data Size: " << bin_data_size);
Copy link
Contributor

Choose a reason for hiding this comment

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

@AByzhynar make it tace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AByzhynar AByzhynar force-pushed the feature/expand_put_file branch from 9e46887 to e55964f Compare April 13, 2018 11:41
Implemented function in PutFile which correctly calculates CRC32
checksum for std::vector<uint8_t>

Added comparison of calculated CRC checksum with received in PutFile
request.
Added PutFile response generation in case of CRC sum mismatch
Fixed handling  of unsigned integer values
@AByzhynar AByzhynar force-pushed the feature/expand_put_file branch from e55964f to 97e267a Compare April 13, 2018 11:44
@AByzhynar AByzhynar merged commit 07c7f3d into smartdevicelink:feature/expand_put_file Apr 13, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants