stuff stored in local poo lnow

This commit is contained in:
2020-12-14 22:50:15 +01:00
parent 29c07461b3
commit 48386a8e3f
3 changed files with 20 additions and 7 deletions

View File

@ -3,7 +3,8 @@
MGMHandlerLIS3MDL::MGMHandlerLIS3MDL(object_id_t objectId,
object_id_t deviceCommunication, CookieIF* comCookie):
DeviceHandlerBase(objectId, deviceCommunication, comCookie) {
DeviceHandlerBase(objectId, deviceCommunication, comCookie),
dataset(this) {
#if OBSW_ENHANCED_PRINTOUT == 1
debugDivider = new PeriodicOperationDivider(10);
#endif
@ -253,6 +254,13 @@ ReturnValue_t MGMHandlerLIS3MDL::interpretDeviceReply(DeviceCommandId_t id,
sif::info << "Z: " << mgmZ << " \xC2\xB5T" << std::endl;
}
#endif
ReturnValue_t result = dataset.read(20);
if(result == HasReturnvaluesIF::RETURN_OK) {
dataset.fieldStrengthX = mgmX;
dataset.fieldStrengthY = mgmY;
dataset.fieldStrengthZ = mgmZ;
dataset.commit(20);
}
break;
}
@ -266,6 +274,11 @@ ReturnValue_t MGMHandlerLIS3MDL::interpretDeviceReply(DeviceCommandId_t id,
<< std::endl;
}
#endif
ReturnValue_t result = dataset.read(20);
if(result == HasReturnvaluesIF::RETURN_OK) {
dataset.temperature = tempValue;
dataset.commit(20);
}
break;
}
@ -371,7 +384,7 @@ void MGMHandlerLIS3MDL::fillCommandAndReplyMap() {
* We dont read single registers, we just expect special
* reply from he Readall_MGM
*/
insertInCommandAndReplyMap(MGMLIS3MDL::READ_CONFIG_AND_DATA, 1);
insertInCommandAndReplyMap(MGMLIS3MDL::READ_CONFIG_AND_DATA, 1, &dataset);
insertInCommandAndReplyMap(MGMLIS3MDL::READ_TEMPERATURE, 1);
insertInCommandAndReplyMap(MGMLIS3MDL::SETUP_MGM, 1);
insertInCommandAndReplyMap(MGMLIS3MDL::IDENTIFY_DEVICE, 1);