self test wip

This commit is contained in:
Jakob Meier 2021-04-26 14:25:23 +02:00
parent bbb50e4b4f
commit ebdc492ed1
3 changed files with 7 additions and 0 deletions

View File

@ -21,6 +21,7 @@ void IMTQHandler::doStartUp(){
if(mode == _MODE_START_UP){
//TODO: Set to MODE_ON again
setMode(MODE_NORMAL);
communicationStep = CommunicationStep::SELT_TEST;
}
}
@ -31,6 +32,10 @@ void IMTQHandler::doShutDown(){
ReturnValue_t IMTQHandler::buildNormalDeviceCommand(
DeviceCommandId_t * id) {
switch (communicationStep) {
case CommunicationStep::SELF_TEST:
*id = IMTQ::SELF_TEST;
communicationStep = CommunicationStep::GET_ENG_HK_DATA;
break;
case CommunicationStep::GET_ENG_HK_DATA:
*id = IMTQ::GET_ENG_HK_DATA;
communicationStep = CommunicationStep::START_MTM_MEASUREMENT;

View File

@ -58,6 +58,7 @@ private:
uint8_t commandBuffer[IMTQ::MAX_COMMAND_SIZE];
enum class CommunicationStep {
SELF_TEST,
GET_ENG_HK_DATA,
START_MTM_MEASUREMENT,
GET_CAL_MTM_MEASUREMENT,

View File

@ -13,6 +13,7 @@ namespace IMTQ {
static const DeviceCommandId_t GET_CAL_MTM_MEASUREMENT = 0x5;
/** Requests the raw values measured by the built-in MTM XEN1210 */
static const DeviceCommandId_t GET_RAW_MTM_MEASUREMENT = 0x6;
static const DeviceCommandId_t SELF_TEST = 0x7;
static const uint8_t GET_TEMP_REPLY_SIZE = 2;
static const uint8_t CFGR_CMD_SIZE = 3;