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

Fix build warnings for examples #37

Merged
merged 5 commits into from
Jun 21, 2024
Merged

Fix build warnings for examples #37

merged 5 commits into from
Jun 21, 2024

Conversation

2bndy5
Copy link
Member

@2bndy5 2bndy5 commented Jun 17, 2024

resolves #35

@TMRh20
Copy link
Member

TMRh20 commented Jun 18, 2024

On

RF24NetworkHeader hdr(0, 1);
this bit of code was intended to send a timestamp back to the sender, so I would prefer if the previous code would grab the senders address from the header and respond with a timestamp.

if ((ok = mesh.renewAddress()))
renew address should == 04444 if failure, RF24Network address on success, can you fix this while in there?

@2bndy5
Copy link
Member Author

2bndy5 commented Jun 18, 2024

 if ((ok = mesh.renewAddress())) 

This is a bit tricky. I'm not used to assigning a value while evaluating a condition (in C++, rust has better syntax for that). I think the requested fix would involve setting ok based on the renewAddress() result. In this instance ok is (supposedly) set to true if renewAddress() succeeds (or otherwise false), right?

@TMRh20
Copy link
Member

TMRh20 commented Jun 18, 2024

In this instance ok is (supposedly) set to true if renewAddress() succeeds (or otherwise false), right?

Yup. How about something like ok = (mesh.renewAddress() == MESH_DEFAULT_ADDRESS) ? false : true;

@2bndy5
Copy link
Member Author

2bndy5 commented Jun 18, 2024

How about something like ok = (mesh.renewAddress() == MESH_DEFAULT_ADDRESS) ? false : true;

That's actually kinda redundant, (mesh.renewAddress() != MESH_DEFAULT_ADDRESS) would evaluate equivalently.

@TMRh20
Copy link
Member

TMRh20 commented Jun 18, 2024

Hey, I'm still waking up, realized that as soon as I posted it.

@2bndy5
Copy link
Member Author

2bndy5 commented Jun 20, 2024

I'm not actually setup to hardware test this lib. Have you run this with the latest changes (as requested)?

@TMRh20
Copy link
Member

TMRh20 commented Jun 20, 2024

Not yet, likely sometime today if all goes as planned.

Copy link
Member

@TMRh20 TMRh20 left a comment

Choose a reason for hiding this comment

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

Good to go!

@2bndy5 2bndy5 merged commit 1dc0134 into master Jun 21, 2024
8 checks passed
@2bndy5 2bndy5 deleted the fix-warnings branch June 21, 2024 11:34
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.

address build warnings in ncurses example
2 participants