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

Add support for changing ublox rate (c++) #37

Merged

Conversation

IgorAnohin
Copy link
Contributor

No description provided.

@IgorAnohin IgorAnohin force-pushed the pr-change-ublox-rate-cpp-support branch 3 times, most recently from 4c270a8 to e7678ad Compare July 10, 2018 19:28
Copy link
Contributor

@staroselskii staroselskii left a comment

Choose a reason for hiding this comment

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

Almost fine. std::memmove stuff might actually be better inlined but this is not really something to be bothered.


int Ublox::_sendMessage(std::uint8_t msg_class, std::uint8_t msg_id, void *msg, std::uint16_t size)
{
unsigned char buffer[buffer_length];
Copy link
Contributor

Choose a reason for hiding this comment

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

it's a const. Make it UBX_BUFFER_LENGTH

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

return SPIdev::transfer(spi_device_name.c_str(), buffer, nullptr, offset, 200000);
}

int Ublox::_spliceMemory(unsigned char *dest, const void *src, std::size_t size, int dest_offset)
Copy link
Contributor

Choose a reason for hiding this comment

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

src should be const

return dest_offset + size;
}

Ublox::CheckSum Ublox::_calculateCheckSum(unsigned char message[], std::size_t size) {
Copy link
Contributor

Choose a reason for hiding this comment

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

unsigned char *message is more conventional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

#include <vector>
#include <list>
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a left-over

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right.

@IgorAnohin IgorAnohin force-pushed the pr-change-ublox-rate-cpp-support branch from e7678ad to 0a11868 Compare July 11, 2018 11:35
Igor Anokhin added 2 commits July 11, 2018 16:24
Add function configureSolutionRate for changing Ublox rate
Also add function for calculating check summs and adding ublox prefix
@IgorAnohin IgorAnohin force-pushed the pr-change-ublox-rate-cpp-support branch from 0a11868 to 2d27427 Compare July 11, 2018 13:24
@staroselskii staroselskii merged commit 15d8b3b into emlid:master Jul 11, 2018
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.

None yet

2 participants