diff --git a/_bin/linux/debug/fsfw-example-linux.elf b/_bin/linux/debug/fsfw-example-linux.elf index 89a7454..03ceab4 100755 Binary files a/_bin/linux/debug/fsfw-example-linux.elf and b/_bin/linux/debug/fsfw-example-linux.elf differ diff --git a/_obj/linux/debug/bsp_linux/fsfwconfig/datapool/dataPoolInit.o b/_obj/linux/debug/bsp_linux/fsfwconfig/datapool/dataPoolInit.o index 77492d4..d7fb5a9 100644 Binary files a/_obj/linux/debug/bsp_linux/fsfwconfig/datapool/dataPoolInit.o and b/_obj/linux/debug/bsp_linux/fsfwconfig/datapool/dataPoolInit.o differ diff --git a/_obj/linux/debug/bsp_linux/fsfwconfig/pollingsequence/PollingSequenceArduinoFunction.o b/_obj/linux/debug/bsp_linux/fsfwconfig/pollingsequence/PollingSequenceArduinoFunction.o index 09035b6..d05c0af 100644 Binary files a/_obj/linux/debug/bsp_linux/fsfwconfig/pollingsequence/PollingSequenceArduinoFunction.o and b/_obj/linux/debug/bsp_linux/fsfwconfig/pollingsequence/PollingSequenceArduinoFunction.o differ diff --git a/_obj/linux/debug/bsp_linux/main.o b/_obj/linux/debug/bsp_linux/main.o index 379cf1b..e914d03 100644 Binary files a/_obj/linux/debug/bsp_linux/main.o and b/_obj/linux/debug/bsp_linux/main.o differ diff --git a/_obj/linux/debug/mission/Controller/ThermalController.o b/_obj/linux/debug/mission/Controller/ThermalController.o index ead32d3..4b8de08 100644 Binary files a/_obj/linux/debug/mission/Controller/ThermalController.o and b/_obj/linux/debug/mission/Controller/ThermalController.o differ diff --git a/_obj/linux/debug/mission/DeviceHandler/ArduinoDeviceHandler.o b/_obj/linux/debug/mission/DeviceHandler/ArduinoDeviceHandler.o index 174de5e..4175fe4 100644 Binary files a/_obj/linux/debug/mission/DeviceHandler/ArduinoDeviceHandler.o and b/_obj/linux/debug/mission/DeviceHandler/ArduinoDeviceHandler.o differ diff --git a/bsp_linux/fsfwconfig/datapool/dataPoolInit.cpp b/bsp_linux/fsfwconfig/datapool/dataPoolInit.cpp index d2194ce..a4a7188 100644 --- a/bsp_linux/fsfwconfig/datapool/dataPoolInit.cpp +++ b/bsp_linux/fsfwconfig/datapool/dataPoolInit.cpp @@ -8,106 +8,64 @@ #include "../../../bsp_linux/fsfwconfig/datapool/dataPoolInit.h" void dataPoolInit(std::map* pool_map) { - uint32_t testVar[1] = { 0 }; - pool_map->insert( - std::pair(datapool::DUMMY1, - new PoolEntry(testVar, 1))); - pool_map->insert( - std::pair(datapool::DUMMY2, - new PoolEntry(testVar, 1))); - pool_map->insert( - std::pair(datapool::DUMMY3, - new PoolEntry(testVar, 1))); - pool_map->insert( - std::pair(datapool::DUMMY4, - new PoolEntry(testVar, 1))); - pool_map->insert( - std::pair(datapool::DUMMY5, - new PoolEntry(testVar, 1))); - pool_map->insert( - std::pair(datapool::DUMMY6, - new PoolEntry(testVar, 1))); - int32_t testVarSigned[1] = { 0 }; - pool_map->insert( - std::pair(datapool::LIMIT_VAR, - new PoolEntry(testVarSigned, 1))); - /*float t_Centroid_PoolId[2] = {0,0}; - pool_map->insert( - std::pair(datapool::Centroid_PoolId, - new PoolEntry(t_Centroid_PoolId, 2))); - uint32_t t_CentroidTime_PoolId[2] = {0,0}; - pool_map->insert( - std::pair(datapool::CentroidTime_PoolId, - new PoolEntry(t_CentroidTime_PoolId, 2)));*/ - - //Here the pool map entries of the Arduino DH are defined + //Here the pool map entries of the DH and CONTROLLER are defined. float Temperature_value[36] = {0}; pool_map->insert( - std::pair(datapool::Temperature_value, + std::pair(datapool::Temperature_value, new PoolEntry(Temperature_value, 36))); unsigned int Temperature_Timestamp[36] = {0}; pool_map->insert( - std::pair(datapool::Temperature_Timestamp, + std::pair(datapool::Temperature_Timestamp, new PoolEntry(Temperature_Timestamp, 36))); float Environmental_value[9] = {0}; pool_map->insert( - std::pair(datapool::Environmental_value, + std::pair(datapool::Environmental_value, new PoolEntry(Environmental_value, 9))); unsigned int Environmental_Timestamp[9] = {0}; pool_map->insert( - std::pair(datapool::Environmental_Timestamp, + std::pair(datapool::Environmental_Timestamp, new PoolEntry(Environmental_Timestamp, 9))); float Accelerometer_value[15] = {0}; pool_map->insert( - std::pair(datapool::Accelerometer_value, + std::pair(datapool::Accelerometer_value, new PoolEntry(Accelerometer_value, 15))); unsigned int Accelerometer_Timestamp[15] = {0}; pool_map->insert( - std::pair(datapool::Accelerometer_Timestamp, + std::pair(datapool::Accelerometer_Timestamp, new PoolEntry(Accelerometer_Timestamp, 15))); - float TEMP_SENSOR_CH1[1] = {0}; pool_map->insert( - std::pair(datapool::TEMP_SENSOR_CH1, + std::pair(datapool::TEMP_SENSOR_CH1, new PoolEntry(TEMP_SENSOR_CH1, 1))); float TEMP_SENSOR_CH2[1] = {0}; pool_map->insert( - std::pair(datapool::TEMP_SENSOR_CH2, + std::pair(datapool::TEMP_SENSOR_CH2, new PoolEntry(TEMP_SENSOR_CH2, 1))); - - /*uint32_t Temp_COMPONENT_1[1] = {0}; - pool_map->insert( - std::pair(datapool::Temp_COMPONENT_1, - new PoolEntry(Temp_COMPONENT_1, 1)));*/ - uint32_t TargetState_COMPONENT_1[1] = {0}; + int8_t TargetState_COMPONENT_1[1] = {0}; pool_map->insert( std::pair(datapool::TargetState_COMPONENT_1, - new PoolEntry(TargetState_COMPONENT_1, 1))); - uint32_t CurrentState_COMPONENT_1[1] = {0}; + new PoolEntry(TargetState_COMPONENT_1, 1))); + int8_t CurrentState_COMPONENT_1[1] = {0}; pool_map->insert( std::pair(datapool::CurrentState_COMPONENT_1, - new PoolEntry(CurrentState_COMPONENT_1, 1))); - uint32_t HeaterRequest_COMPONENT_1[1] = {0}; + new PoolEntry(CurrentState_COMPONENT_1, 1))); + uint8_t HeaterRequest_COMPONENT_1[1] = {0}; pool_map->insert( std::pair(datapool::HeaterRequest_COMPONENT_1, - new PoolEntry(HeaterRequest_COMPONENT_1, 1))); - /*uint32_t Temp_COMPONENT_2[1] = {0}; - pool_map->insert( - std::pair(datapool::Temp_COMPONENT_2, - new PoolEntry(Temp_COMPONENT_2, 1)));*/ - uint32_t TargetState_COMPONENT_2[1] = {0}; + new PoolEntry(HeaterRequest_COMPONENT_1, 1))); + int8_t TargetState_COMPONENT_2[1] = {0}; pool_map->insert( std::pair(datapool::TargetState_COMPONENT_2, - new PoolEntry(TargetState_COMPONENT_2, 1))); - uint32_t CurrentState_COMPONENT_2[1] = {0}; + new PoolEntry(TargetState_COMPONENT_2, 1))); + int8_t CurrentState_COMPONENT_2[1] = {0}; pool_map->insert( std::pair(datapool::CurrentState_COMPONENT_2, - new PoolEntry(CurrentState_COMPONENT_2, 1))); - uint32_t HeaterRequest_COMPONENT_2[1] = {0}; + new PoolEntry(CurrentState_COMPONENT_2, 1))); + uint8_t HeaterRequest_COMPONENT_2[1] = {0}; pool_map->insert( std::pair(datapool::HeaterRequest_COMPONENT_2, - new PoolEntry(HeaterRequest_COMPONENT_2, 1))); + new PoolEntry(HeaterRequest_COMPONENT_2, 1))); } diff --git a/bsp_linux/fsfwconfig/datapool/dataPoolInit.h b/bsp_linux/fsfwconfig/datapool/dataPoolInit.h index c8018b0..c7daa52 100644 --- a/bsp_linux/fsfwconfig/datapool/dataPoolInit.h +++ b/bsp_linux/fsfwconfig/datapool/dataPoolInit.h @@ -12,60 +12,22 @@ namespace datapool { enum opus_variable_id { - DUMMY1 = 0x100000, - DUMMY2 = 0x100001, - DUMMY3 = 0x100002, - DUMMY4 = 0x100003, - DUMMY5 = 0x100004, - DUMMY6 = 0x100005,//TEST VAR - LIMIT_VAR = 0x100006, - TIME_STAMPER = 0x100007, - - /* The IDs of the variables of the Arduino serial output are here defined.*/ - /* - Temperature.start_string = 0x100008, - Temperature.Typ = 0x100009, - Temperature.SPCChNumber = 0x100010, - Temperature.Value_Cnt = 0x100011, - Temperature.temperature = 0x100012, - Temperature.Timestamp = 0x100013, - Temperature.end_string = 0x100014, - - Environmental.start_string = 0x100015, - Environmental.Typ = 0x100016, - Environmental.SPCChNumber = 0x100017, - Environmental.Value_Cnt = 0x100018, - Environmental.Value = 0x100019, - Environmental.Timestamp = 0x100020, - Environmental.end_string = 0x100021, - - Accelerometer.start_string = 0x100022, - Accelerometer.Typ = 0x100023, - Accelerometer.SPCChNumber = 0x100024, - Accelerometer.Value_Cnt = 0x100025, - Accelerometer.Value = 0x100026, - Accelerometer.Timestamp = 0x100027, - Accelerometer.end_string = 0x100028, - */ - - Temperature_value = 0x100008, - Temperature_Timestamp = 0x100009, - Environmental_value = 0x100010, - Environmental_Timestamp = 0x100011, - Accelerometer_value = 0x100012, - Accelerometer_Timestamp = 0x100013, - - TEMP_SENSOR_CH1 = 0x100014, - TEMP_SENSOR_CH2 = 0x100015, - TargetState_COMPONENT_1 = 0x100016, - CurrentState_COMPONENT_1 = 0x100017, - HeaterRequest_COMPONENT_1 = 0x100018, - TargetState_COMPONENT_2 = 0x100019, - CurrentState_COMPONENT_2 = 0x100020, - HeaterRequest_COMPONENT_2 = 0x100021 - //Temp_COMPONENT_1 = 0x100098, - //Temp_COMPONENT_2 = 0x100099, + // The IDs of the variables of the DH and CONTROLLER are here defined. + Temperature_value = 0x100001, + Temperature_Timestamp = 0x100002, + Environmental_value = 0x10003, + Environmental_Timestamp = 0x10004, + Accelerometer_value = 0x10005, + Accelerometer_Timestamp = 0x10006, + TEMP_SENSOR_CH1 = 0x10007, + TEMP_SENSOR_CH2 = 0x10008, + TargetState_COMPONENT_1 = 0x10009, + CurrentState_COMPONENT_1 = 0x100010, + HeaterRequest_COMPONENT_1 = 0x100011, + TargetState_COMPONENT_2 = 0x100012, + CurrentState_COMPONENT_2 = 0x100013, + HeaterRequest_COMPONENT_2 = 0x100014 }; diff --git a/bsp_linux/fsfwconfig/pollingsequence/PollingSequenceArduinoFunction.cpp b/bsp_linux/fsfwconfig/pollingsequence/PollingSequenceArduinoFunction.cpp index 7368191..1674f79 100644 --- a/bsp_linux/fsfwconfig/pollingsequence/PollingSequenceArduinoFunction.cpp +++ b/bsp_linux/fsfwconfig/pollingsequence/PollingSequenceArduinoFunction.cpp @@ -17,9 +17,9 @@ ReturnValue_t pollingSequenceArduinoFunction( uint32_t length = thisSequence->getPeriodMs(); thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0, 0); - thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.3, 1); + thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.2, 1); thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.3, 2); - thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.4, 3); + thisSequence->addSlot(objects::ARDUINO_DEVICE_HANDLER, length * 0.5, 3); if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { return HasReturnvaluesIF::RETURN_OK; diff --git a/mission/DeviceHandler/ArduinoDeviceHandler.cpp b/mission/DeviceHandler/ArduinoDeviceHandler.cpp index 24cbfb3..23997a4 100644 --- a/mission/DeviceHandler/ArduinoDeviceHandler.cpp +++ b/mission/DeviceHandler/ArduinoDeviceHandler.cpp @@ -68,13 +68,25 @@ ReturnValue_t ArduinoDH::scanForReply(const uint8_t *start, size_t len, if (len == *foundLen){ // start character: '[' if (*start == 91 ){ - return APERIODIC_REPLY; + return APERIODIC_REPLY; } else{ return DeviceHandlerIF::LENGTH_MISSMATCH; } } else { return IGNORE_REPLY_DATA; } + /*if (len == *foundLen){ + // start character: '[' + if (*start == 91 ){ + if (*start + 9 == 49) { + return APERIODIC_REPLY; + } + } else{ + return DeviceHandlerIF::LENGTH_MISSMATCH; + } + } else { + return IGNORE_REPLY_DATA; + }*/ } ReturnValue_t ArduinoDH::interpretDeviceReply(DeviceCommandId_t id,