restructure repository
This commit is contained in:
fsfw.mk
inc/fsfw
FSFW.hFSFWVersion.h
action
ActionHelper.hActionMessage.hCommandActionHelper.hCommandsActionsIF.hHasActionsIF.hSimpleActionHelper.h
container
ArrayList.hBinaryTree.hDynamicFIFO.hFIFO.hFIFOBase.hFIFOBase.tppFixedArrayList.hFixedMap.hFixedOrderedMultimap.hFixedOrderedMultimap.tppHybridIterator.hIndexedRingMemoryArray.hPlacementFactory.hRingBufferBase.hSharedRingBuffer.hSimpleRingBuffer.hSinglyLinkedList.hgroup.h
controller
coordinates
datalinklayer
BCFrame.hCCSDSReturnValuesIF.hClcw.hClcwIF.hDataLinkLayer.hFarm1StateIF.hFarm1StateLockout.hFarm1StateOpen.hFarm1StateWait.hMapPacketExtraction.hMapPacketExtractionIF.hTcTransferFrame.hTcTransferFrameLocal.hVirtualChannelReception.hVirtualChannelReceptionIF.h
datapool
DataSetIF.hHkSwitchHelper.hPoolDataSetBase.hPoolDataSetIF.hPoolEntry.hPoolEntryIF.hPoolReadGuard.hPoolVarList.hPoolVariableIF.hReadCommitIF.hReadCommitIFAttorney.hSharedDataSetIF.h
datapoollocal.hdatapoollocal
AccessLocalPoolF.hHasLocalDataPoolIF.hLocalDataPoolManager.hLocalDataSet.hLocalPoolDataSetBase.hLocalPoolObjectBase.hLocalPoolVariable.hLocalPoolVariable.tppLocalPoolVector.hLocalPoolVector.tppMarkChangedIF.hProvidesDataPoolSubscriptionIF.hSharedLocalDataSet.hStaticLocalDataSet.hlocalPoolDefinitions.h
devicehandlers
AcceptsDeviceResponsesIF.hAssemblyBase.hCMakeLists.txtChildHandlerBase.hChildHandlerFDIR.hCookieIF.hDeviceCommunicationIF.hDeviceHandlerBase.hDeviceHandlerFailureIsolation.hDeviceHandlerIF.hDeviceHandlerMessage.hDeviceHandlerThermalSet.hDeviceTmReportingWrapper.hHealthDevice.h
events
Event.hEventManager.hEventManagerIF.hEventMessage.hEventReportingProxyIF.h
eventmatching
CMakeLists.txtEventIdRangeMatcher.cppEventIdRangeMatcher.hEventMatchTree.cppEventMatchTree.hEventRangeMatcherBase.hReporterRangeMatcher.cppReporterRangeMatcher.hSeverityRangeMatcher.cppSeverityRangeMatcher.heventmatching.h
fwSubsystemIdRanges.hfdir
globalfunctions
AsciiConverter.hCRC.hDleEncoder.hPeriodicOperationDivider.hType.harrayprinter.hbitutility.hconstants.h
matching
math
sign.htimevalOperations.hhealth
housekeeping
AcceptsHkPacketsIF.hCMakeLists.txtHousekeepingMessage.hHousekeepingPacketDownlink.hHousekeepingSetPacket.hHousekeepingSnapshot.hPeriodicHousekeepingHelper.h
internalError
ipc
CommandMessage.hCommandMessageCleaner.hCommandMessageIF.hFwMessageTypes.hMessageQueueIF.hMessageQueueMessage.hMessageQueueMessageIF.hMessageQueueSenderIF.hMutexFactory.hMutexGuard.hMutexIF.hQueueFactory.hmessageQueueDefinitions.h
memory
AcceptsMemoryMessagesIF.hGenericFileSystemMessage.hHasFileSystemIF.hHasMemoryIF.hMemoryHelper.hMemoryMessage.h
modes
monitoring
AbsLimitMonitor.hHasMonitorsIF.hLimitMonitor.hLimitViolationReporter.hMonitorBase.hMonitorReporter.hMonitoringIF.hMonitoringMessage.hMonitoringMessageContent.hReceivesMonitoringReportsIF.hTriplexMonitor.hTwoValueLimitMonitor.h
objectmanager
osal
Endiness.hInternalErrorCodes.h
common
TcpIpBase.hTcpTmTcBridge.hTcpTmTcServer.hUdpTcPollingTask.hUdpTmTcBridge.htcpipCommon.htcpipHelpers.h
freertos
BinSemaphUsingTask.hBinarySemaphore.hCountingSemaphUsingTask.hCountingSemaphore.hFixedTimeslotTask.hFreeRTOSTaskIF.hMessageQueue.hMutex.hPeriodicTask.hQueueMapManager.hREADME.mdTaskManagement.hTimekeeper.h
host
linux
BinarySemaphore.hCountingSemaphore.hFixedTimeslotTask.hMessageQueue.hMutex.hPeriodicPosixTask.hPosixThread.hTimer.hunixUtility.h
rtems
CpuUsage.hFixedTimeslotTask.hInitTask.hMessageQueue.hMutex.hPeriodicTask.hRTEMSTaskBase.hRtemsBasic.h
windows
parameters
platform.hpower
pus
CService200ModeCommanding.hCService201HealthCommanding.hService17Test.hService1TelecommandVerification.hService20ParameterManagement.hService2DeviceAccess.hService3Housekeeping.hService5EventReporting.hService8FunctionManagement.hService9TimeManagement.h
servicepackets
returnvalues
rmap
serialize
EndianConverter.hSerialArrayListAdapter.hSerialBufferAdapter.hSerialFixedArrayListAdapter.hSerialLinkedListAdapter.hSerializeAdapter.hSerializeElement.hSerializeIF.h
serviceinterface
ServiceInterface.hServiceInterfaceBuffer.hServiceInterfacePrinter.hServiceInterfaceStream.hserviceInterfaceDefintions.h
storagemanager
subsystem
tasks
ExecutableObjectIF.hFixedSequenceSlot.hFixedSlotSequence.hFixedTimeslotTaskIF.hPeriodicTaskIF.hSemaphoreFactory.hSemaphoreIF.hTaskFactory.hTypedef.h
tcdistribution
CCSDSDistributor.hCCSDSDistributorIF.hPUSDistributor.hPUSDistributorIF.hTcDistributor.hTcPacketCheck.h
thermal
AbstractTemperatureSensor.hAcceptsThermalMessagesIF.hHeater.hRedundantHeater.hTemperatureSensor.hThermalComponent.hThermalComponentCore.hThermalComponentIF.hThermalModule.hThermalModuleIF.hThermalMonitorReporter.htcsDefinitions.h
timemanager
CCSDSTime.hClock.hCountdown.hReceivesTimeInfoIF.hStopwatch.hTimeMessage.hTimeStamper.hTimeStamperIF.hclockDefinitions.h
tmstorage
tmtcpacket
tmtcservices
misc
defaultcfg
README.md
fsfwconfig
CMakeLists.txtFSFWConfig.hOBSWConfig.hOBSWVersion.h
devices
events
fsfwconfig.mkipc
objects
pollingsequence
returnvalues
tmtc
logo
src
core
action
container
controller
datapool
datapoollocal
CMakeLists.txtLocalDataPoolManager.cppLocalDataSet.cppLocalPoolDataSetBase.cppLocalPoolObjectBase.cppSharedLocalDataSet.cpp
internal
devicehandlers
AssemblyBase.cppChildHandlerBase.cppChildHandlerFDIR.cppDeviceHandlerBase.cppDeviceHandlerFailureIsolation.cppDeviceHandlerMessage.cppDeviceTmReportingWrapper.cppHealthDevice.cpp
events
fdir
globalfunctions
AsciiConverter.cppCMakeLists.txtCRC.cppDleEncoder.cppPeriodicOperationDivider.cppType.cpparrayprinter.cppbitutility.cpp
math
timevalOperations.cpphealth
housekeeping
internalError
ipc
modes
objectmanager
parameters
power
serialize
serviceinterface
storagemanager
subsystem
tasks
tcdistribution
thermal
AbstractTemperatureSensor.cppCMakeLists.txtHeater.cppRedundantHeater.cppThermalComponent.cppThermalComponentCore.cppThermalModule.cppThermalMonitorReporter.cpp
timemanager
tmtcpacket
tmtcservices
opt
coordinates
datalinklayer
CMakeLists.txtClcw.cppDataLinkLayer.cppFarm1StateLockout.cppFarm1StateOpen.cppFarm1StateWait.cppMapPacketExtraction.cppTcTransferFrame.cppTcTransferFrameLocal.cppVirtualChannelReception.cpp
memory
monitoring
pus
CMakeLists.txtCService200ModeCommanding.cppCService201HealthCommanding.cppService17Test.cppService1TelecommandVerification.cppService20ParameterManagement.cppService2DeviceAccess.cppService3Housekeeping.cppService5EventReporting.cppService8FunctionManagement.cppService9TimeManagement.cpp
rmap
tmstorage
osal
CMakeLists.txt
common
CMakeLists.txtTcpIpBase.cppTcpTmTcBridge.cppTcpTmTcServer.cppUdpTcPollingTask.cppUdpTmTcBridge.cpptcpipCommon.cpp
freertos
BinSemaphUsingTask.cppBinarySemaphore.cppCMakeLists.txtClock.cppCountingSemaphUsingTask.cppCountingSemaphore.cppFixedTimeslotTask.cppMessageQueue.cppMutex.cppMutexFactory.cppPeriodicTask.cppQueueFactory.cppQueueMapManager.cppSemaphoreFactory.cppTaskFactory.cppTaskManagement.cppTimekeeper.cpp
host
CMakeLists.txtClock.cppFixedTimeslotTask.cppMessageQueue.cppMutexFactory.cppPeriodicTask.cppQueueFactory.cppQueueMapManager.cppSemaphoreFactory.cppTaskFactory.cpptaskHelpers.cpp
linux
BinarySemaphore.cppCMakeLists.txtClock.cppCountingSemaphore.cppFixedTimeslotTask.cppInternalErrorCodes.cppMessageQueue.cppMutex.cppMutexFactory.cppPeriodicPosixTask.cppPosixThread.cppQueueFactory.cppSemaphoreFactory.cppTaskFactory.cppTimer.cpptcpipHelpers.cppunixUtility.cpp
rtems
CMakeLists.txtClock.cppCpuUsage.cppFixedTimeslotTask.cppInitTask.cppInternalErrorCodes.cppMessageQueue.cppMutex.cppMutexFactory.cppPeriodicTask.cppQueueFactory.cppRTEMSTaskBase.cppRtemsBasic.cppTaskFactory.cpp
windows
tests
CMakeLists.txtREADME.md
internal
CMakeLists.txtInternalUnitTester.cppInternalUnitTester.hUnittDefinitions.cppUnittDefinitions.h
lcov.shglobalfunctions
internal.mkosal
CMakeLists.txtIntTestMq.cppIntTestMq.hIntTestMutex.cppIntTestMutex.hIntTestSemaphore.cppIntTestSemaphore.h
serialize
tests
CMakeLists.txt
action
container
CMakeLists.txtRingBufferTest.cppTestArrayList.cppTestDynamicFifo.cppTestFifo.cppTestFixedArrayList.cppTestFixedMap.cppTestFixedOrderedMultimap.cppTestPlacementFactory.cpp
datapoollocal
CMakeLists.txtDataSetTest.cppLocalPoolManagerTest.cppLocalPoolOwnerBase.cppLocalPoolOwnerBase.hLocalPoolVariableTest.cppLocalPoolVectorTest.cpp
globalfunctions
mocks
osal
serialize
CMakeLists.txtTestSerialBufferAdapter.cppTestSerialLinkedPacket.cppTestSerialLinkedPacket.hTestSerialization.cpp
storagemanager
tests.mktmtcpacket
user
CMakeLists.txt
testcfg
CMakeLists.txtFSFWConfig.hMakefile-FSFW-TestsTestsConfig.h
cdatapool
devices
events
ipc
objects
pollingsequence
returnvalues
testcfg.mktmtc
testtemplate
unittest
CMakeLists.txt
unlockRealtime.shcore
92
src/core/ipc/MessageQueueMessage.cpp
Normal file
92
src/core/ipc/MessageQueueMessage.cpp
Normal file
@ -0,0 +1,92 @@
|
||||
#include "MessageQueueMessage.h"
|
||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "../globalfunctions/arrayprinter.h"
|
||||
#include <cstring>
|
||||
|
||||
MessageQueueMessage::MessageQueueMessage() :
|
||||
messageSize(getMinimumMessageSize()) {
|
||||
memset(this->internalBuffer, 0, sizeof(this->internalBuffer));
|
||||
}
|
||||
|
||||
MessageQueueMessage::MessageQueueMessage(uint8_t* data, size_t size) :
|
||||
messageSize(this->HEADER_SIZE + size) {
|
||||
if (size <= this->MAX_DATA_SIZE) {
|
||||
memcpy(this->getData(), data, size);
|
||||
this->messageSize = this->HEADER_SIZE + size;
|
||||
}
|
||||
else {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << "MessageQueueMessage: Passed size larger than maximum"
|
||||
"allowed size! Setting content to 0" << std::endl;
|
||||
#endif
|
||||
memset(this->internalBuffer, 0, sizeof(this->internalBuffer));
|
||||
this->messageSize = this->HEADER_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
MessageQueueMessage::~MessageQueueMessage() {
|
||||
}
|
||||
|
||||
const uint8_t* MessageQueueMessage::getBuffer() const {
|
||||
return this->internalBuffer;
|
||||
}
|
||||
|
||||
uint8_t* MessageQueueMessage::getBuffer() {
|
||||
return this->internalBuffer;
|
||||
}
|
||||
|
||||
const uint8_t* MessageQueueMessage::getData() const {
|
||||
return this->internalBuffer + this->HEADER_SIZE;
|
||||
}
|
||||
|
||||
uint8_t* MessageQueueMessage::getData() {
|
||||
return this->internalBuffer + this->HEADER_SIZE;
|
||||
}
|
||||
|
||||
MessageQueueId_t MessageQueueMessage::getSender() const {
|
||||
MessageQueueId_t temp_id;
|
||||
memcpy(&temp_id, this->internalBuffer, sizeof(MessageQueueId_t));
|
||||
return temp_id;
|
||||
}
|
||||
|
||||
void MessageQueueMessage::setSender(MessageQueueId_t setId) {
|
||||
memcpy(this->internalBuffer, &setId, sizeof(MessageQueueId_t));
|
||||
}
|
||||
|
||||
void MessageQueueMessage::print(bool printWholeMessage) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::debug << "MessageQueueMessage content: " << std::endl;
|
||||
#endif
|
||||
if(printWholeMessage) {
|
||||
arrayprinter::print(getData(), getMaximumMessageSize());
|
||||
}
|
||||
else {
|
||||
arrayprinter::print(getData(), getMessageSize());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MessageQueueMessage::clear() {
|
||||
memset(this->getBuffer(), 0, this->MAX_MESSAGE_SIZE);
|
||||
}
|
||||
|
||||
size_t MessageQueueMessage::getMessageSize() const {
|
||||
return this->messageSize;
|
||||
}
|
||||
|
||||
void MessageQueueMessage::setMessageSize(size_t messageSize) {
|
||||
this->messageSize = messageSize;
|
||||
}
|
||||
|
||||
size_t MessageQueueMessage::getMinimumMessageSize() const {
|
||||
return this->MIN_MESSAGE_SIZE;
|
||||
}
|
||||
|
||||
size_t MessageQueueMessage::getMaximumMessageSize() const {
|
||||
return this->MAX_MESSAGE_SIZE;
|
||||
}
|
||||
|
||||
size_t MessageQueueMessage::getMaximumDataSize() const {
|
||||
return this->MAX_DATA_SIZE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user