Today's the day. Renamed platform to framework.
This commit is contained in:
THANKYOU
action
ActionHelper.cppActionHelper.hActionMessage.cppActionMessage.hCommandActionHelper.cppCommandActionHelper.hCommandsActionsIF.hHasActionsIF.hSimpleActionHelper.cppSimpleActionHelper.h
container
ArrayList.hBinaryTree.hFIFO.hFixedArrayList.hFixedMap.hFixedOrderedMultimap.hHybridIterator.hIsDerivedFrom.hLinkedElementDecorator.hPlacementFactory.hRingBufferBase.hSinglyLinkedList.hgroup.hlistTest.cpp.ignore
controller
coordinates
datalinklayer
BCFrame.hCCSDSReturnValuesIF.hClcw.cppClcw.hClcwIF.hDataLinkLayer.cppDataLinkLayer.hFarm1StateIF.hFarm1StateLockout.cppFarm1StateLockout.hFarm1StateOpen.cppFarm1StateOpen.hFarm1StateWait.cppFarm1StateWait.hMapPacketExtraction.cppMapPacketExtraction.hMapPacketExtractionIF.hTcTransferFrame.cppTcTransferFrame.hTcTransferFrameLocal.cppTcTransferFrameLocal.hVirtualChannelReception.cppVirtualChannelReception.hVirtualChannelReceptionIF.h
datapool
DataPool.cppDataPool.hDataPoolAdmin.cppDataPoolAdmin.hDataSet.cppDataSet.hDataSetIF.hMakefilePIDReader.hPIDReaderList.hPoolEntry.cppPoolEntry.hPoolEntryIF.hPoolRawAccess.cppPoolRawAccess.hPoolVarList.hPoolVariable.hPoolVariableIF.hPoolVector.h
devicehandlers
AssemblyBase.cppAssemblyBase.hChildHandlerBase.cppChildHandlerBase.hChildHandlerFDIR.cppChildHandlerFDIR.hCookie.hDeviceCommunicationIF.hDeviceHandlerBase.cppDeviceHandlerBase.hDeviceHandlerFDIR.cppDeviceHandlerFDIR.hDeviceHandlerIF.hDeviceHandlerMessage.cppDeviceHandlerMessage.hDeviceTmReportingWrapper.cppDeviceTmReportingWrapper.hHealthDevice.cppHealthDevice.hMakefilePollingSequence.cppPollingSequence.hPollingSequenceExecutableIF.hPollingSlot.cppPollingSlot.hPollingTask.cppPollingTask.h
events
Event.cppEvent.hEventManager.cppEventManager.hEventManagerIF.hEventMessage.cppEventMessage.hEventReportingProxyIF.h
eventmatching
fdir
ConfirmsFailuresIF.hEventCorrelation.cppEventCorrelation.hFDIRBase.cppFDIRBase.hFaultCounter.cppFaultCounter.h
globalfunctions
AsciiConverter.cppAsciiConverter.hDleEncoder.cppDleEncoder.hMakefileType.cppType.hconstants.hconversion.cppconversion.hcrc_ccitt.cppcrc_ccitt.h
matching
math
sign.htimevalOperations.cpptimevalOperations.hhealth
HasHealthIF.hHealthHelper.cppHealthHelper.hHealthMessage.cppHealthMessage.hHealthTable.cppHealthTable.hHealthTableIF.hManagesHealthIF.h
ipc
CommandMessage.cppCommandMessage.hMakefileMessageProxy.cppMessageProxy.hMessageQueue.cppMessageQueue.hMessageQueueMessage.cppMessageQueueMessage.hMessageQueueSender.cppMessageQueueSender.hReplyMessage.h
memory
AcceptsMemoryMessagesIF.hHasMemoryIF.hLocalMemory.cppLocalMemory.hMemoryHelper.cppMemoryHelper.hMemoryListAdapter.hMemoryMessage.cppMemoryMessage.hMemoryProxyIF.h
modes
monitoring
AbsLimitMonitor.hDeltaCheckMonitor.hHasMonitorsIF.hLimitCheckMonitor.hLimitMonitor.hLimitViolationReporter.cppLimitViolationReporter.hMonitorBase.hMonitorReporter.hMonitoringHelper.cppMonitoringHelper.hMonitoringIF.hMonitoringListAdapter.cppMonitoringListAdapter.hMonitoringMessage.cppMonitoringMessage.hMonitoringMessageContent.hOneParameterMonitorList.hReceivesMonitoringReportsIF.hTwoValueLimitMonitor.h
objectmanager
osal
parameters
HasParametersIF.hParameterHelper.cppParameterHelper.hParameterMessage.cppParameterMessage.hParameterWrapper.cppParameterWrapper.hReceivesParameterMessagesIF.h
power
privatepool
returnvalues
rmap
RMAP.cppRMAP.hRMAPChannelIF.hRMAPCookie.cppRMAPCookie.hRmapSPWChannel.cppRmapSPWChannel.hrmapStructs.h
serialize
EndianSwapper.hSerialArrayListAdapter.hSerialBufferAdapter.cppSerialBufferAdapter.hSerialFixedArrayListAdapter.hSerialLinkedListAdapter.hSerializeAdapter.hSerializeElement.hSerializeIF.h
serviceinterface
MakefileServiceInterfaceBuffer.cppServiceInterfaceBuffer.hServiceInterfaceStream.cppServiceInterfaceStream.h
storagemanager
subsystem
tasks
ExecutableObjectIF.hMakefileMultiObjectTask.cppMultiObjectTask.hObjectTask.cppObjectTask.hPeriodicTask.cppPeriodicTask.hTaskBase.cppTaskBase.hTaskIF.h
tcdistribution
CCSDSDistributor.cppCCSDSDistributor.hCCSDSDistributorIF.hMakefilePUSDistributor.cppPUSDistributor.hPUSDistributorIF.hTcDistributor.cppTcDistributor.hTcPacketCheck.cppTcPacketCheck.h
timemanager
CCSDSTime.cppCCSDSTime.hCountdown.cppCountdown.hReceivesTimeInfoIF.hTimeMessage.cppTimeMessage.hTimeStamperIF.h
tmstorage
TmStore.cppTmStore.hTmStoreBackendIF.hTmStoreFrontendIF.hTmStoreInfo.hTmStoreManager.cppTmStoreManager.hTmStoreMessage.cppTmStoreMessage.hTmStorePackets.h
tmtcpacket
MakefileSpacePacket.cppSpacePacket.hSpacePacketBase.cppSpacePacketBase.hccsds_header.h
packetmatcher
pus
tmtcservices
AcceptsTelecommandsIF.hAcceptsTelemetryIF.hAcceptsVerifyMessageIF.hCommandingServiceBase.hPusServiceBase.cppPusServiceBase.hPusVerificationReport.cppPusVerificationReport.hServiceTypes.hSourceSequenceCounter.hTmTcMessage.cppTmTcMessage.hVerificationCodes.hVerificationReporter.cppVerificationReporter.h
watchdog
49
datalinklayer/TcTransferFrameLocal.cpp
Normal file
49
datalinklayer/TcTransferFrameLocal.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @file TcTransferFrameLocal.cpp
|
||||
* @brief This file defines the TcTransferFrameLocal class.
|
||||
* @date 27.04.2013
|
||||
* @author baetz
|
||||
*/
|
||||
|
||||
#include <framework/datalinklayer/TcTransferFrameLocal.h>
|
||||
#include <framework/globalfunctions/crc_ccitt.h>
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <string.h>
|
||||
|
||||
TcTransferFrameLocal::TcTransferFrameLocal(bool bypass, bool controlCommand, uint16_t scid,
|
||||
uint8_t vcId, uint8_t sequenceNumber, uint8_t setSegmentHeader, uint8_t* data, uint16_t dataSize, uint16_t forceCrc) {
|
||||
this->frame = (tc_transfer_frame*)&localData;
|
||||
frame->header.flagsAndScid = (bypass << 5) + (controlCommand << 4) + ((scid & 0x0300) >> 8);
|
||||
frame->header.spacecraftId_l = (scid & 0x00FF);
|
||||
frame->header.vcidAndLength_h = (vcId & 0b00111111) << 2;
|
||||
frame->header.length_l = sizeof(TcTransferFramePrimaryHeader) -1;
|
||||
frame->header.sequenceNumber = sequenceNumber;
|
||||
frame->dataField = setSegmentHeader;
|
||||
if (data != NULL) {
|
||||
if (bypass && controlCommand) {
|
||||
memcpy(&(frame->dataField), data, dataSize);
|
||||
uint16_t totalSize = sizeof(TcTransferFramePrimaryHeader) + dataSize + FRAME_CRC_SIZE -1;
|
||||
frame->header.vcidAndLength_h |= (totalSize & 0x0300) >> 8;
|
||||
frame->header.length_l = (totalSize & 0x00FF);
|
||||
uint16_t crc = ::Calculate_CRC(getFullFrame(), getFullSize() -2);
|
||||
this->getFullFrame()[getFullSize()-2] = (crc & 0xFF00) >> 8;
|
||||
this->getFullFrame()[getFullSize()-1] = (crc & 0x00FF);
|
||||
} else if (dataSize <= 1016) {
|
||||
memcpy(&(frame->dataField) +1, data, dataSize);
|
||||
uint16_t dataCrcSize = sizeof(TcTransferFramePrimaryHeader) + 1 + dataSize + FRAME_CRC_SIZE -1;
|
||||
frame->header.vcidAndLength_h |= (dataCrcSize & 0x0300) >> 8;
|
||||
frame->header.length_l = (dataCrcSize & 0x00FF);
|
||||
uint16_t crc = ::Calculate_CRC(getFullFrame(), getFullSize() -2);
|
||||
this->getFullFrame()[getFullSize()-2] = (crc & 0xFF00) >> 8;
|
||||
this->getFullFrame()[getFullSize()-1] = (crc & 0x00FF);
|
||||
} else {
|
||||
debug << "TcTransferFrameLocal: dataSize too large: " << dataSize << std::endl;
|
||||
}
|
||||
} else {
|
||||
//No data in frame
|
||||
}
|
||||
if (forceCrc != 0 ) {
|
||||
localData.data[getFullSize()-2] = (forceCrc & 0xFF00) >> 8;
|
||||
localData.data[getFullSize()-1] = (forceCrc & 0x00FF);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user