most important features working
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
49
mission/devices/devicedefinitions/imtqHelpers.cpp
Normal file
49
mission/devices/devicedefinitions/imtqHelpers.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
#include "imtqHelpers.h"
|
||||
|
||||
size_t imtq::getReplySize(CC::CC cc, size_t* optSecondSize) {
|
||||
switch (cc) {
|
||||
// Software reset is a bit special and can also cause a I2C NAK because
|
||||
// the device might be reset at that moment. Otherwise, 2 bytes should be returned
|
||||
case (CC::CC::SOFTWARE_RESET): {
|
||||
if (optSecondSize != nullptr) {
|
||||
*optSecondSize = 0;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
case (CC::CC::START_ACTUATION_DIPOLE):
|
||||
case (CC::CC::SELF_TEST_CMD):
|
||||
case (CC::CC::START_MTM_MEASUREMENT): {
|
||||
return 2;
|
||||
}
|
||||
case (CC::CC::GET_SYSTEM_STATE): {
|
||||
return 9;
|
||||
}
|
||||
case (CC::CC::GET_RAW_MTM_MEASUREMENT):
|
||||
case (CC::CC::GET_CAL_MTM_MEASUREMENT): {
|
||||
return 15;
|
||||
}
|
||||
case (CC::CC::GET_COIL_CURRENT):
|
||||
case (CC::CC::GET_COMMANDED_DIPOLE):
|
||||
case (CC::CC::GET_COIL_TEMPERATURES): {
|
||||
return 8;
|
||||
}
|
||||
case (CC::CC::GET_SELF_TEST_RESULT): {
|
||||
// Can also be 360 for the all axes self-test!
|
||||
if (optSecondSize != nullptr) {
|
||||
*optSecondSize = 360;
|
||||
}
|
||||
return 120;
|
||||
}
|
||||
case (CC::CC::GET_RAW_HK_DATA):
|
||||
case (CC::CC::GET_ENG_HK_DATA): {
|
||||
return 24;
|
||||
}
|
||||
case (CC::CC::GET_PARAM): {
|
||||
return imtq::replySize::MAX_SET_GET_PARAM_LEN;
|
||||
}
|
||||
default: {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user