WIP: somethings wrong.. #19
@ -107,31 +107,33 @@ ReturnValue_t TmTcBridge::handleTmQueue() {
|
|||||||
TmTcMessage message;
|
TmTcMessage message;
|
||||||
const uint8_t* data = nullptr;
|
const uint8_t* data = nullptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
|
ReturnValue_t status = HasReturnvaluesIF::RETURN_OK;
|
||||||
for (ReturnValue_t result = tmTcReceptionQueue->receiveMessage(&message);
|
for (ReturnValue_t result = tmTcReceptionQueue->receiveMessage(&message);
|
||||||
result == RETURN_OK; result = tmTcReceptionQueue->receiveMessage(&message))
|
result == RETURN_OK; result = tmTcReceptionQueue->receiveMessage(&message))
|
||||||
{
|
{
|
||||||
if(communicationLinkUp == false) {
|
if(communicationLinkUp == false) {
|
||||||
result = storeDownlinkData(&message);
|
storeDownlinkData(&message);
|
||||||
return result;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = tmStore->getData(message.getStorageId(), &data, &size);
|
result = tmStore->getData(message.getStorageId(), &data, &size);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "TmTcBridge::handleTmQueue: Invalid store "
|
||||||
|
"ID!" << std::endl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = sendTm(data, size);
|
result = sendTm(data, size);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::warning << "TmTcBridge: Could not send TM packet" << std::endl;
|
sif::warning << "TmTcBridge: Could not send TM packet" << std::endl;
|
||||||
tmStore->deleteData(message.getStorageId());
|
status = HasReturnvaluesIF::RETURN_FAILED;
|
||||||
return result;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tmStore->deleteData(message.getStorageId());
|
tmStore->deleteData(message.getStorageId());
|
||||||
}
|
}
|
||||||
return RETURN_OK;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo: make it configurable whether old data is deleted.
|
||||||
ReturnValue_t TmTcBridge::storeDownlinkData(TmTcMessage *message) {
|
ReturnValue_t TmTcBridge::storeDownlinkData(TmTcMessage *message) {
|
||||||
store_address_t storeId = 0;
|
store_address_t storeId = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user