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

Reduced code size of PayloadEncrypt #604

Merged
merged 2 commits into from
Dec 18, 2018
Merged

Conversation

mvds00
Copy link
Contributor

@mvds00 mvds00 commented Dec 4, 2018

No description provided.

Copy link
Contributor

@mluis1 mluis1 left a comment

Choose a reason for hiding this comment

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

Few comments:

  1. Why change the size function parameter type?
    We think that the uint16_t type must be kept. The payload maximum size is 256 (1 byte)
  2. Please apply the coding conventions to the line
    for( uint8_t i = 0; i < (size>=16?16:size); i++ )
    By
    for( uint8_t i = 0; i < ( ( size >= 16 ) ? 16 : size ); i++ )

@mvds00
Copy link
Contributor Author

mvds00 commented Dec 6, 2018

I changed the coding style.

The logic as it stands now, after this commit, needs size to be signed as it may drop below 0 at the last iteration. As I don't want to break existing code (that I possibly don't know of) I didn't want to decrease the range of the size parameter, so I made it 32 bit signed. I changed it into 16 bit signed, which should be perfectly fine indeed.

@mluis1 mluis1 merged commit 3c68c3f into Lora-net:develop Dec 18, 2018
@mluis1 mluis1 added this to the Release Version 4.4.2 milestone Apr 18, 2019
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.

2 participants