Skip to content

Added handling methods through mavlink #244

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Michal-Mankowski
Copy link
Contributor

  • Listening loop that read uart for the messages from mavlink.
  • Checks the message id and does corresponding action.
  • Sends ack after every method.

@@ -28,6 +29,7 @@ constexpr auto KGPS_UART_baudrate = B115200;
constexpr auto kSystemId = 1;
constexpr auto kComponentId = 200;
constexpr auto kTime = 1000;
constexpr auto kBufferSize = 12;
Copy link
Collaborator

@Mateusz-Krajewski Mateusz-Krajewski Jun 8, 2025

Choose a reason for hiding this comment

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

czemu akurat 12?
skoro masz dostępne MAVLINK_MAX_PACKET_LEN

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Spojrzałem ile bitów trzeba wysłać przed i po wiadomości no i jakiej długości jest największa wiadomość. Wyszło mi 12 z tych szybkich obliczeń.

Comment on lines +82 to +88
auto bytes_read_opt = uart_->Read(kBufferSize);
if (!bytes_read_opt.has_value()) {
continue;
}
auto bytes_read = bytes_read_opt.value();
for (uint8_t byte : bytes_read) {
if (mavlink_parse_char(MAVLINK_COMM_0, byte, &msg, &status)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

skoro i tak to potem dzielisz na uint8, to moze odczytywać po 1 bajcie z uart?

}
}

void RadioApp::SendAck(uint8_t msgId, uint8_t msgSeq, uint8_t status) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

zmien argumenty na enumy z simba mavlink, jak bedziesz mial nowa wersje

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