fixed for hosted OSAL
This commit is contained in:
parent
a4ca61d834
commit
0da95b75a2
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
#include "../../serviceinterface/ServiceInterfaceStream.h"
|
||||||
#include "../../ipc/MutexFactory.h"
|
#include "../../ipc/MutexFactory.h"
|
||||||
#include "../../ipc/MutexHelper.h"
|
#include "../../ipc/MutexGuard.h"
|
||||||
|
|
||||||
MessageQueue::MessageQueue(size_t messageDepth, size_t maxMessageSize):
|
MessageQueue::MessageQueue(size_t messageDepth, size_t maxMessageSize):
|
||||||
messageSize(maxMessageSize), messageDepth(messageDepth) {
|
messageSize(maxMessageSize), messageDepth(messageDepth) {
|
||||||
@ -63,9 +63,7 @@ ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) {
|
|||||||
if(messageQueue.empty()) {
|
if(messageQueue.empty()) {
|
||||||
return MessageQueueIF::EMPTY;
|
return MessageQueueIF::EMPTY;
|
||||||
}
|
}
|
||||||
// not sure this will work..
|
MutexGuard mutexLock(queueLock, MutexIF::TimeoutType::WAITING, 20);
|
||||||
//*message = std::move(messageQueue.front());
|
|
||||||
MutexHelper mutexLock(queueLock, MutexIF::TimeoutType::WAITING, 20);
|
|
||||||
MessageQueueMessage* currentMessage = &messageQueue.front();
|
MessageQueueMessage* currentMessage = &messageQueue.front();
|
||||||
std::copy(currentMessage->getBuffer(),
|
std::copy(currentMessage->getBuffer(),
|
||||||
currentMessage->getBuffer() + messageSize, message->getBuffer());
|
currentMessage->getBuffer() + messageSize, message->getBuffer());
|
||||||
@ -130,7 +128,7 @@ ReturnValue_t MessageQueue::sendMessageFromMessageQueue(MessageQueueId_t sendTo,
|
|||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
if(targetQueue->messageQueue.size() < targetQueue->messageDepth) {
|
if(targetQueue->messageQueue.size() < targetQueue->messageDepth) {
|
||||||
MutexHelper mutexLock(targetQueue->queueLock,
|
MutexGuard mutexLock(targetQueue->queueLock,
|
||||||
MutexIF::TimeoutType::WAITING, 20);
|
MutexIF::TimeoutType::WAITING, 20);
|
||||||
// not ideal, works for now though.
|
// not ideal, works for now though.
|
||||||
MessageQueueMessage* mqmMessage =
|
MessageQueueMessage* mqmMessage =
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "../../serviceinterface/ServiceInterface.h"
|
#include "../../serviceinterface/ServiceInterface.h"
|
||||||
#include "../../ipc/MutexFactory.h"
|
#include "../../ipc/MutexFactory.h"
|
||||||
#include "../../ipc/MutexHelper.h"
|
#include "../../ipc/MutexGuard.h"
|
||||||
|
|
||||||
QueueMapManager* QueueMapManager::mqManagerInstance = nullptr;
|
QueueMapManager* QueueMapManager::mqManagerInstance = nullptr;
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ ReturnValue_t QueueMapManager::addMessageQueue(
|
|||||||
|
|
||||||
MessageQueueIF* QueueMapManager::getMessageQueue(
|
MessageQueueIF* QueueMapManager::getMessageQueue(
|
||||||
MessageQueueId_t messageQueueId) const {
|
MessageQueueId_t messageQueueId) const {
|
||||||
MutexHelper(mapLock, MutexIF::TimeoutType::WAITING, 50);
|
MutexGuard(mapLock, MutexIF::TimeoutType::WAITING, 50);
|
||||||
auto queueIter = queueMap.find(messageQueueId);
|
auto queueIter = queueMap.find(messageQueueId);
|
||||||
if(queueIter != queueMap.end()) {
|
if(queueIter != queueMap.end()) {
|
||||||
return queueIter->second;
|
return queueIter->second;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include <fsfw/ipc/MutexHelper.h>
|
|
||||||
#include "TmTcWinUdpBridge.h"
|
#include "TmTcWinUdpBridge.h"
|
||||||
|
#include <fsfw/ipc/MutexGuard.h>
|
||||||
|
|
||||||
|
|
||||||
TmTcWinUdpBridge::TmTcWinUdpBridge(object_id_t objectId,
|
TmTcWinUdpBridge::TmTcWinUdpBridge(object_id_t objectId,
|
||||||
object_id_t tcDestination, object_id_t tmStoreId, object_id_t tcStoreId,
|
object_id_t tcDestination, object_id_t tmStoreId, object_id_t tcStoreId,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user