Skip to content
Snippets Groups Projects
Commit 8647cbad authored by Alvise de'Faveri's avatar Alvise de'Faveri
Browse files

[TMTC] Add ack and update mavlink_skyward_lib submodule.

parent 499bd024
No related branches found
No related tags found
No related merge requests found
[submodule "libs/miosix-kernel"] [submodule "libs/miosix-kernel"]
path = libs/miosix-kernel path = libs/miosix-kernel
url = https://github.com/carpikes/miosix-kernel.git url = https://github.com/carpikes/miosix-kernel.git
branch = testing branch = master
[submodule "libs/mavlink_skyward_lib"] [submodule "libs/mavlink_skyward_lib"]
path = libs/mavlink_skyward_lib path = libs/mavlink_skyward_lib
url = https://github.com/skyward-er/mavlink_skyward_lib url = https://github.com/skyward-er/mavlink_skyward_lib
Subproject commit 0b9ed3c06795986bf6a815b6539b38ade5ebe9d4 Subproject commit 8a9dbf0678cf4e956f2e6960b30e3732cf03ca9d
...@@ -45,11 +45,6 @@ public: ...@@ -45,11 +45,6 @@ public:
printf("Received ping\n"); printf("Received ping\n");
} }
/* TEST_MSG message handler */
static void handleTestMsg(mavlink_test_msg_t* msg) {
printf("Received test message\n");
}
}; };
#endif #endif
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* Constructor: initialise objects (has memory allocation). * Constructor: initialise objects (has memory allocation).
*/ */
TMTCManager::TMTCManager() { TMTCManager::TMTCManager() {
gamma = new Gamma868("/dev/tty"); gamma = new Gamma868("/dev/radio");
outBuffer = new CircularBuffer(TMTC_OUT_BUFFER_SIZE); outBuffer = new CircularBuffer(TMTC_OUT_BUFFER_SIZE);
//TODO: check gamma status and configuration //TODO: check gamma status and configuration
senderThread = miosix::Thread::create(senderLauncher, TMTC_SENDER_STACKSIZE, TMTC_SENDER_PRIORITY, senderThread = miosix::Thread::create(senderLauncher, TMTC_SENDER_STACKSIZE, TMTC_SENDER_PRIORITY,
...@@ -90,8 +90,7 @@ void TMTCManager::runReceiver() { ...@@ -90,8 +90,7 @@ void TMTCManager::runReceiver() {
msg.msgid, msg.seq, msg.compid, msg.sysid); msg.msgid, msg.seq, msg.compid, msg.sysid);
// If the received message is not an ACK, send an ACK back to ground // If the received message is not an ACK, send an ACK back to ground
// TODO: create ACK message in mavlink if(msg.msgid != MAVLINK_MSG_ID_ACK)
// if(msg.msgid != MAVLINK_MSG_ID_ACK)
sendAck(&msg); sendAck(&msg);
// Handle the message depending on the message type // Handle the message depending on the message type
...@@ -103,13 +102,6 @@ void TMTCManager::runReceiver() { ...@@ -103,13 +102,6 @@ void TMTCManager::runReceiver() {
TCHandler::handlePing(&ping); TCHandler::handlePing(&ping);
break; break;
} }
case MAVLINK_MSG_ID_TEST_MSG:
{
mavlink_test_msg_t test;
mavlink_msg_test_msg_decode(&msg, &test);
TCHandler::handleTestMsg(&test);
break;
}
} }
} }
...@@ -122,7 +114,7 @@ void TMTCManager::runReceiver() { ...@@ -122,7 +114,7 @@ void TMTCManager::runReceiver() {
void TMTCManager::sendAck(mavlink_message_t* msg){ void TMTCManager::sendAck(mavlink_message_t* msg){
// Create ack message // Create ack message
mavlink_message_t ack_msg; mavlink_message_t ack_msg;
//TODO: mavlink_msg_ack_pack(SYS_ID,COMPONENT_ID, &ack_msg, msg->msgid, msg->seq); mavlink_msg_ack_pack(1, 1, &ack_msg, msg->msgid, msg->seq);
// Send message back to the sender through the callback // Send message back to the sender through the callback
bool ackSent = enqueueMsg( (uint8_t*)&ack_msg, sizeof(ack_msg) ); bool ackSent = enqueueMsg( (uint8_t*)&ack_msg, sizeof(ack_msg) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment