updated tmtc packet base
This commit is contained in:
parent
2790a40d6c
commit
f612b095c1
@ -51,11 +51,10 @@ void TcPacketBase::setData(const uint8_t* pData) {
|
|||||||
tcData = (TcPacketPointer*) pData;
|
tcData = (TcPacketPointer*) pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TcPacketBase::setApplicationData(const uint8_t * pData, uint16_t dataLen) {
|
void TcPacketBase::setAppData(uint8_t * appData, uint16_t dataLen) {
|
||||||
setData(pData);
|
memcpy(&tcData->appData, appData, dataLen);
|
||||||
// packet data length is actual size of data field minus 1
|
|
||||||
SpacePacketBase::setPacketDataLength(dataLen +
|
SpacePacketBase::setPacketDataLength(dataLen +
|
||||||
sizeof(PUSTcDataFieldHeader) + TcPacketBase::CRC_SIZE - 1);
|
sizeof(PUSTcDataFieldHeader) + TcPacketBase::CRC_SIZE - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t TcPacketBase::getSecondaryHeaderFlag() {
|
uint8_t TcPacketBase::getSecondaryHeaderFlag() {
|
||||||
|
@ -168,6 +168,14 @@ public:
|
|||||||
* current content of the packet.
|
* current content of the packet.
|
||||||
*/
|
*/
|
||||||
void setErrorControl();
|
void setErrorControl();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies the supplied data to the internal TC application data field.
|
||||||
|
* @param pData
|
||||||
|
* @param dataLen
|
||||||
|
*/
|
||||||
|
void setAppData(uint8_t * appData, uint16_t dataLen);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* With this method, the packet data pointer can be redirected to another
|
* With this method, the packet data pointer can be redirected to another
|
||||||
* location.
|
* location.
|
||||||
@ -178,12 +186,7 @@ public:
|
|||||||
* @param p_data A pointer to another PUS Telecommand Packet.
|
* @param p_data A pointer to another PUS Telecommand Packet.
|
||||||
*/
|
*/
|
||||||
void setData( const uint8_t* pData );
|
void setData( const uint8_t* pData );
|
||||||
/**
|
|
||||||
* Set application data and corresponding length field.
|
|
||||||
* @param pData
|
|
||||||
* @param dataLen
|
|
||||||
*/
|
|
||||||
void setApplicationData(const uint8_t * pData, uint16_t dataLen);
|
|
||||||
/**
|
/**
|
||||||
* This is a debugging helper method that prints the whole packet content
|
* This is a debugging helper method that prints the whole packet content
|
||||||
* to the screen.
|
* to the screen.
|
||||||
|
@ -102,6 +102,11 @@ void TmPacketBase::initializeTmPacket(uint16_t apid, uint8_t service, uint8_t su
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TmPacketBase::setSourceData(uint8_t* sourceData, size_t sourceSize) {
|
||||||
|
memcpy(getSourceData(), sourceData, sourceSize);
|
||||||
|
setSourceDataSize(sourceSize);
|
||||||
|
}
|
||||||
|
|
||||||
void TmPacketBase::setSourceDataSize(uint16_t size) {
|
void TmPacketBase::setSourceDataSize(uint16_t size) {
|
||||||
setPacketDataLength(size + sizeof(PUSTmDataFieldHeader) + CRC_SIZE - 1);
|
setPacketDataLength(size + sizeof(PUSTmDataFieldHeader) + CRC_SIZE - 1);
|
||||||
}
|
}
|
||||||
|
@ -125,6 +125,13 @@ public:
|
|||||||
* current content of the packet.
|
* current content of the packet.
|
||||||
*/
|
*/
|
||||||
void setErrorControl();
|
void setErrorControl();
|
||||||
|
/**
|
||||||
|
* This sets the source data. It copies the provided data to
|
||||||
|
* the internal TmPacketPointer source data location.
|
||||||
|
* @param sourceData
|
||||||
|
* @param sourceSize
|
||||||
|
*/
|
||||||
|
void setSourceData(uint8_t* sourceData, size_t sourceSize);
|
||||||
/**
|
/**
|
||||||
* With this method, the packet data pointer can be redirected to another
|
* With this method, the packet data pointer can be redirected to another
|
||||||
* location.
|
* location.
|
||||||
|
Loading…
Reference in New Issue
Block a user