11// ============================================================================
22// Purpose: Fixture for QUTEST
3- // Last updated for version 7.3.0
4- // Last updated on 2023-07-26
3+ // Last Updated for Version: 7.3.1
4+ // Date of the Last Update: 2023-12-11
55//
6- // Q u a n t u m L e a P s
7- // ------------------------
8- // Modern Embedded Software
6+ // Q u a n t u m L e a P s
7+ // ------------------------
8+ // Modern Embedded Software
99//
10- // Copyright (C) 2005-2020 Quantum Leaps. All rights reserved.
10+ // Copyright (C) 2005 Quantum Leaps, LLC . All rights reserved.
1111//
1212// This program is open source software: you can redistribute it and/or
1313// modify it under the terms of the GNU General Public License as published
2525// GNU General Public License for more details.
2626//
2727// You should have received a copy of the GNU General Public License
28- // along with this program. If not, see <www.gnu.org/licenses>.
28+ // along with this program. If not, see <www.gnu.org/licenses/ >.
2929//
3030// Contact information:
3131// <www.state-machine.com/licensing>
32+ 3233// ============================================================================
3334#include " qpcpp.hpp"
3435#include " qhsmtst.hpp"
@@ -40,10 +41,11 @@ namespace APP {
4041
4142enum {
4243 BSP_DISPLAY = QP::QS_USER,
44+ CMD,
4345};
4446
4547void BSP_display (char const *msg) {
46- QS_BEGIN_ID (BSP_DISPLAY, 0U ) // application -specific record
48+ QS_BEGIN_ID (BSP_DISPLAY, 0U ) // app -specific record
4749 QS_STR (msg);
4850 QS_END ()
4951}
@@ -64,21 +66,33 @@ void QS::onTestSetup(void) {
6466void QS::onTestTeardown (void ) {
6567}
6668// ............................................................................
67- void QS::onCommand (uint8_t cmdId,
68- uint32_t param1, uint32_t param2, uint32_t param3)
69+ void QS::onCommand (std:: uint8_t cmdId, std:: uint32_t param1 ,
70+ std:: uint32_t param2, std:: uint32_t param3)
6971{
7072 Q_UNUSED_PAR (param1);
7173 Q_UNUSED_PAR (param2);
7274 Q_UNUSED_PAR (param3);
7375
76+ // PRINTF_S("<TARGET> Command id=%d param=%d\n", (int)cmdId, (int)param);
7477 switch (cmdId) {
75- case 0U : {
76- break ;
78+ case 0U : {
79+ QS_BEGIN_ID (APP::CMD, 0U ) // app-specific record
80+ QS_END ()
81+ break ;
82+ }
83+ case 1U : {
84+ bool ret = APP::QHsmTst_isIn (param1);
85+ QS_BEGIN_ID (APP::CMD, 0U ) // app-specific record
86+ QS_U8 (0U , ret ? 1 : 0 );
87+ QS_U8 (0U , (uint8_t )param1);
88+ QS_END ()
89+ break ;
7790 }
7891 default :
7992 break ;
8093 }
8194}
95+
8296// ............................................................................
8397// callback function to "massage" the event, if necessary
8498void QS::onTestEvt (QEvt *e) {
@@ -119,6 +133,7 @@ int main(int argc, char *argv[]) {
119133 // dictionaries...
120134 QS_OBJ_DICTIONARY (the_sm);
121135 QS_USR_DICTIONARY (BSP_DISPLAY);
136+ QS_USR_DICTIONARY (CMD);
122137
123138 return QP::QF::run ();
124139}
0 commit comments