diff options
author | RALOVICH, Kristof <tade60@freemail.hu> | 2014-01-19 18:30:19 +0100 |
---|---|---|
committer | RALOVICH, Kristof <tade60@freemail.hu> | 2014-01-19 18:30:19 +0100 |
commit | c7adb3fa73f55fbe86b481f0a945fb06a8cc3fa9 (patch) | |
tree | 729425122cde97d9b90ac23534ed2c75e7dee1e7 /src | |
parent | 40848286d67358e6abe5baabbe1a21e6a918ebaa (diff) |
AntMessage::str2(): decode MESG_STARTUP_MSG_ID
Diffstat (limited to 'src')
-rw-r--r-- | src/AntMessage.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/AntMessage.cpp b/src/AntMessage.cpp index 3a5c180..1d25a9f 100644 --- a/src/AntMessage.cpp +++ b/src/AntMessage.cpp @@ -327,6 +327,40 @@ AntMessage::str2() const } } CHST; sstr << " " << CHST.szChanSt(chanSt); } + else if(getMsgId()==MESG_STARTUP_MSG_ID) + { + enum { + PowerOnReset = 0, + HwResetLine = 1, + UnkReset1 = 2, + UnkReset2 = 4, + UnkReset3 = 8, + UnkReset4 = 16, + CommandReset = 32, + SyncReset = 64, + SuspendReset = 128 + }; + if(getLenPayload()>=1) + { + uint8_t startup=getPayloadRef()[0]; + //lprintf(antpm::LOG_DBG2, "startup 0x%02x\n", startup); + sstr << " startup="; + if(startup==0) sstr << "PowerOnReset,"; + if(startup & HwResetLine) sstr << "HwResetLine,"; + if(startup & UnkReset1) sstr << "UnkReset1,"; + if(startup & UnkReset2) sstr << "UnkReset2,"; + if(startup & UnkReset3) sstr << "UnkReset3,"; + if(startup & UnkReset4) sstr << "UnkReset4,"; + if(startup & CommandReset) sstr << "CommandReset,"; + if(startup & SyncReset) sstr << "SyncReset,"; + if(startup & SuspendReset) sstr << "SuspendReset,"; + } + if(getLenPayload()>1) + { + // print extra bytes if any? + } + + } return sstr.str(); } |