Skip to content
Snippets Groups Projects
Commit b1354f50 authored by Zach Eisele's avatar Zach Eisele
Browse files

fix toc bug

parent 8eba5b0f
No related branches found
No related tags found
1 merge request!77Groundstation gui rough edits
...@@ -82,7 +82,7 @@ class CTOC { ...@@ -82,7 +82,7 @@ class CTOC {
int m_nRadioChannel; int m_nRadioChannel;
CCrazyRadio *m_crRadio; CCrazyRadio *m_crRadio;
CCrazyflie *m_crazyflie; CCrazyflie *m_crazyflie;
int m_nItemCount; uint16_t m_nItemCount;
std::list<struct TOCElement> m_lstTOCElements; std::list<struct TOCElement> m_lstTOCElements;
std::list<struct LoggingBlock> m_lstLoggingBlocks; std::list<struct LoggingBlock> m_lstLoggingBlocks;
std::vector<std::string> m_lstActiveLogging; std::vector<std::string> m_lstActiveLogging;
......
...@@ -90,7 +90,10 @@ bool CTOC::requestMetaData() { ...@@ -90,7 +90,10 @@ bool CTOC::requestMetaData() {
// bReturnvalue = true; // bReturnvalue = true;
// } // }
if(crtpReceived->data()[0] == 0x03) { if(crtpReceived->data()[0] == 0x03) {
m_nItemCount = (uint8_t) crtpReceived->data()[1]; char amount[2];
amount[0] = crtpReceived->data()[1];
amount[1] = crtpReceived->data()[2];
memcpy(&m_nItemCount, amount, sizeof(uint16_t));
bReturnvalue = true; bReturnvalue = true;
} }
......
...@@ -23,7 +23,7 @@ void CCrazyRadio::mainLoop() { ...@@ -23,7 +23,7 @@ void CCrazyRadio::mainLoop() {
(*it)->writeLogData(); (*it)->writeLogData();
} }
//usleep(100); usleep(500);
// Check if the thread has been told to terminate // Check if the thread has been told to terminate
if (this->m_exitThread) { if (this->m_exitThread) {
......
...@@ -494,8 +494,9 @@ void closeoutProgram() { ...@@ -494,8 +494,9 @@ void closeoutProgram() {
cout << "\tBattery" << ": " << crazyflie_info[i].cflieCopter->batteryLevel() << endl; cout << "\tBattery" << ": " << crazyflie_info[i].cflieCopter->batteryLevel() << endl;
crazyflie_info[i].cflieCopter->cycle(); crazyflie_info[i].cflieCopter->cycle();
crazyflie_info[i].cflieCopter->resetLoggingBlocks(); crazyflie_info[i].cflieCopter->resetLoggingBlocks();
crazyflie_info[i].cflieCopter->test_stand->close(); if(crazyflie_info[i].cflieCopter->test_stand != NULL) {
crazyflie_info[i].cflieCopter->test_stand->close();
}
delete crazyflie_info[i].cflieCopter; delete crazyflie_info[i].cflieCopter;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment