QM  7.0.0
Model-Based Design Tool
Loading...
Searching...
No Matches
QP License Certificate File

QM Session FileCurrent Item

As described in the QM™ introduction, the code generated by QM™ is licensed under the same dual-license model↑ as the underlying QP™ framework↑, for which the code has been generated.

By default, the QM code generator assumes that the underlying QP™ framework is used under the open source GNU General Public License (GPL)↑, and for compliance with the GPL, QM generates the required top-level file comments. Additionally, starting with QM version 7, in the default unlicensed mode the QM Code Generator is limited to 20 states. The following screen shot shows a QM code generation attempt that exceeds the number of states limit:


QM code generation exceeding the number of states limit

To replace the GPL-compliant comments and remove 20 states limitation, the QM modeling tool requires a QP License Certificate↑, which must be registered with a given QM model.

Remarks
The 20 states limit has been introduced in response to the growing infringement on the QP framework licensing↑ as well as non-compliance with the GPL.

Registering QP License Certificate

When the underlying QP Framework is licensed commercially, the Licensee receives a QP License Certificate↑, which can be registered with QM by means of the Code Generation License Dialog Box. After registering a commercial license, QM generates top-level file comments that reflect the commercial license terms. Also, the code generation is unlimited with respect to the number of generated states.

Note
If you are a commercial licensee and for some reason you did not receive your QP License Certificate file, please send email with your license number to support@state-machine.com↑ to request your copy.


Code Generation License Dialog (Commercial License)
Note
The QP License Certificate is validated against the current date and the certificate is marked as expired if it is no longer valid.
Also, the QP License Certificate is validated against the QP Framework type and is marked as not covering the selected framework if that framework is not listed among the licensed "Framewrok(s)".
Attention
After registering a QP License Certificate, it is stored in the QM Model File. If the QP License Certificate file is updated (e.g., Support Term for the commercial license is extended), the QP License Certificate must be re-registered by means of the Code Generation License Dialog Box.

Generated Code

After registering the QP License Certificate, the QM tool will generate top-level file comments with the commercial license information.

The following code snippet shows the top-level file comment generated from the QP License Certificate example discussed above.

//$file${.::egizmo.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//
// Model: egizmo.qm
// File: ${.::egizmo.c}
//
// This code has been generated by QM 7.0.0 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This generated code is covered by the following QP license:
// License # : QPC-SP-230817A
// Issued to : Bamboozle Technologies, Inc.
// Framework(s) : qpc
// Support ends : 2025-08-17
//
// Copyright (c) 2024-2025 Bamboozle Technologies, Inc. All rights reserved.
//
// SPDX-License-Identifier: LicenseRef-QL-Single-Product
//
// THIS SINGLE PRODUCT LICENSE IS VALID SOLELY FOR THE FOLLOWING PRODUCT:
// "eGizmo Shuffle 2nd Generation"
//
//$endhead${.::egizmo.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#include "qpc.h" /* QP/C framework API */
#include "egizmo.h" /* Board Support Package interface */
/* ask QM to declare the Blinky class --------------------------------------*/
//$declare${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//${AOs::Blinky} .............................................................
typedef struct {
// protected:
QActive super;
// private:
QTimeEvt timeEvt;
} Blinky;
// protected:
static QState Blinky_initial(Blinky * const me, void const * const par);
static QState Blinky_off(Blinky * const me, QEvt const * const e);
static QState Blinky_on(Blinky * const me, QEvt const * const e);
//$enddecl${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/* instantiate the Blinky active object ------------------------------------*/
static Blinky l_blinky;
QActive * const AO_Blinky = &l_blinky.super;
/* ask QM to define the Blinky class ---------------------------------------*/
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 750U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
#error qpc version 7.5.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//$define${AOs::Blinky_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//${AOs::Blinky_ctor} ........................................................
void Blinky_ctor(void) {
Blinky *me = (Blinky *)AO_Blinky;
QActive_ctor(&me->super, Q_STATE_CAST(&Blinky_initial));
QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
}
//$enddef${AOs::Blinky_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//$define${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//${AOs::Blinky} .............................................................
//${AOs::Blinky::SM} .........................................................
static QState Blinky_initial(Blinky * const me, void const * const par) {
//${AOs::Blinky::SM::initial}
(void)par; /* unused parameter */
/* arm the private time event to expire in 1/2s
* and periodically every 1/2 second
*/
QTimeEvt_armX(&me->timeEvt,
BSP_TICKS_PER_SEC/2,
BSP_TICKS_PER_SEC/2);
return Q_TRAN(&Blinky_off);
}
//${AOs::Blinky::SM::off} ....................................................
static QState Blinky_off(Blinky * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
//${AOs::Blinky::SM::off}
case Q_ENTRY_SIG: {
BSP_ledOff();
status_ = Q_HANDLED();
break;
}
//${AOs::Blinky::SM::off::TIMEOUT}
case TIMEOUT_SIG: {
status_ = Q_TRAN(&Blinky_on);
break;
}
default: {
status_ = Q_SUPER(&QHsm_top);
break;
}
}
return status_;
}
//${AOs::Blinky::SM::on} .....................................................
static QState Blinky_on(Blinky * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
//${AOs::Blinky::SM::on}
case Q_ENTRY_SIG: {
BSP_ledOn();
status_ = Q_HANDLED();
break;
}
//${AOs::Blinky::SM::on::TIMEOUT}
case TIMEOUT_SIG: {
status_ = Q_TRAN(&Blinky_off);
break;
}
default: {
status_ = Q_SUPER(&QHsm_top);
break;
}
}
return status_;
}
//$enddef${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note
The top-level comments generated with a registered QP License Certificate contain no references to any open-source license because the code will be proprietary.

QM Session FileCurrent Item