1
0
forked from fsfw/fsfw

huge progress on hk + testing

This commit is contained in:
2020-09-19 01:17:43 +02:00
parent 757d2275ea
commit ba56f48e8e
16 changed files with 237 additions and 82 deletions

View File

@ -7,14 +7,14 @@
template<typename T, uint16_t vectorSize>
inline LocalPoolVector<T, vectorSize>::LocalPoolVector(lp_id_t poolId,
HasLocalDataPoolIF* hkOwner, pool_rwm_t setReadWriteMode,
DataSetIF* dataSet) :
HasLocalDataPoolIF* hkOwner, DataSetIF* dataSet,
pool_rwm_t setReadWriteMode):
localPoolId(poolId), valid(false), readWriteMode(setReadWriteMode) {
if(poolId == PoolVariableIF::NO_PARAMETER) {
sif::warning << "LocalPoolVector: 0 passed as pool ID, which is the "
"NO_PARAMETER value!" << std::endl;
sif::warning << "LocalPoolVector: PoolVariableIF::NO_PARAMETER passed "
<< "as pool ID, which is the NO_PARAMETER value!" << std::endl;
}
memset(this->value, 0, vectorSize * sizeof(T));
std::memset(this->value, 0, vectorSize * sizeof(T));
hkManager = hkOwner->getHkManagerHandle();
if (dataSet != nullptr) {
dataSet->registerVariable(this);
@ -23,17 +23,18 @@ inline LocalPoolVector<T, vectorSize>::LocalPoolVector(lp_id_t poolId,
template<typename T, uint16_t vectorSize>
inline LocalPoolVector<T, vectorSize>::LocalPoolVector(lp_id_t poolId,
object_id_t poolOwner, pool_rwm_t setReadWriteMode, DataSetIF *dataSet):
readWriteMode(readWriteMode) {
object_id_t poolOwner, DataSetIF *dataSet, pool_rwm_t setReadWriteMode):
readWriteMode(setReadWriteMode) {
if(poolId == PoolVariableIF::NO_PARAMETER) {
sif::warning << "LocalPoolVector: 0 passed as pool ID, which is the "
"NO_PARAMETER value!" << std::endl;
sif::warning << "LocalPoolVector: PoolVariableIF::NO_PARAMETER passed "
<< "as pool ID, which is the NO_PARAMETER value!" << std::endl;
}
HasLocalDataPoolIF* hkOwner =
objectManager->get<HasLocalDataPoolIF>(poolOwner);
if(hkOwner == nullptr) {
sif::error << "LocalPoolVariable: The supplied pool owner did not implement"
"the correct interface HasHkPoolParametersIF!" << std::endl;
sif::error << "LocalPoolVariable: The supplied pool owner did not "
<< "implement the correct interface HasHkPoolParametersIF!"
<< std::endl;
return;
}
hkManager = hkOwner->getHkManagerHandle();
@ -67,7 +68,7 @@ inline ReturnValue_t LocalPoolVector<T, vectorSize>::readWithoutLock() {
std::dec << " failed." << std::endl;
return result;
}
memcpy(this->value, poolEntry->address, poolEntry->getByteSize());
std::memcpy(this->value, poolEntry->address, poolEntry->getByteSize());
this->valid = poolEntry->valid;
return RETURN_OK;
}
@ -96,7 +97,7 @@ inline ReturnValue_t LocalPoolVector<T, vectorSize>::commitWithoutLock() {
std::dec << " failed.\n" << std::flush;
return result;
}
memcpy(poolEntry->address, this->value, poolEntry->getByteSize());
std::memcpy(poolEntry->address, this->value, poolEntry->getByteSize());
poolEntry->valid = this->valid;
return RETURN_OK;
}