From 12bc284834997570abeec484dee50d3e7e51d36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Eckel?= Date: Mon, 10 Jun 2024 12:18:26 +0200 Subject: [PATCH] added version command to improve bug management and issue tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Eckel --- .github/workflows/release_rddl.yaml | 4 ++++ tasmota/include/i18n.h | 1 + tasmota/tasmota_support/support_command.ino | 10 +++++++++- tasmota/tasmota_xdrv_driver/xdrv_129_rddl_network.ino | 10 +++++++++- tasmota/user_config_override_sample.h | 3 +-- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_rddl.yaml b/.github/workflows/release_rddl.yaml index 888b75258155..015651dc2629 100644 --- a/.github/workflows/release_rddl.yaml +++ b/.github/workflows/release_rddl.yaml @@ -30,6 +30,10 @@ jobs: git tag ${{ github.event.inputs.tag }} git push origin ${{ github.event.inputs.tag }} + - name: Define source code Tag version + run: | + sed -i 's/rddl-v0.0.0/${{ github.event.inputs.tag }}/' tasmota/user_config_override_sample.h + - name: Detele potentially existing cache run: rm -rf .cache diff --git a/tasmota/include/i18n.h b/tasmota/include/i18n.h index 58edaa3813ca..98ec813ec232 100644 --- a/tasmota/include/i18n.h +++ b/tasmota/include/i18n.h @@ -280,6 +280,7 @@ #define D_CMND_NOTARIZE "Notarize" #define D_CMND_REMOVE_FILES "RemoveFiles" #define D_CMND_CIDSTOBEQUERIED "CIDsToBeQueried" +#define D_CMND_VERSION "Version" #define D_CMND_STATUS "Status" #define D_STATUS1_PARAMETER "PRM" #define D_STATUS2_FIRMWARE "FWR" diff --git a/tasmota/tasmota_support/support_command.ino b/tasmota/tasmota_support/support_command.ino index da454959af09..7b29a6ae5650 100644 --- a/tasmota/tasmota_support/support_command.ino +++ b/tasmota/tasmota_support/support_command.ino @@ -48,6 +48,7 @@ const char kTasmotaCommands[] PROGMEM = "|" // No prefix D_CMND_PLANETMINTCHAINID "|" D_CMND_MACHINEDATA "|" D_CMND_POPCHALLENGE "|" D_CMND_ATTESTMACHINE "|" D_CMND_NOTARIZATION_PERIODICITY "|" D_CMND_NOTARIZE "|" D_CMND_REMOVE_FILES "|" D_CMND_POPINIT "|" D_CMND_CHALLENGE "|" D_CMND_POPCHALLENGERESULT "|" D_CMND_REDEEMCLAIMS "|" D_CMND_CREATEACCOUNT "|" D_CMND_CIDSTOBEQUERIED "|" + D_CMND_VERSION "|" #ifdef USE_I2C D_CMND_I2CSCAN "|" D_CMND_I2CDRIVER "|" #endif @@ -93,6 +94,7 @@ void (* const TasmotaCommand[])(void) PROGMEM = { &CmndPlanetmintChainID, &CmndMachineData, &CmndPoPChallenge, &CmndAttestMachine, &CmndNotarizationPeriodicity, &CmndNotarize, &CmndRemoveFiles, &CmndPoPInit, &CmndChallenge, &CmndPoPChallengeResult, &CmndRedeemClaims, &CmndCreateAccount, &CmndCIDsToBeQueried, + &CmndVersion, #ifdef USE_I2C &CmndI2cScan, &CmndI2cDriver, #endif @@ -979,7 +981,6 @@ void CmndPoPChallenge(void) { else{ Response_P( "{ \"%s\": \"%s\" }", D_CMND_POPCHALLENGE, "Please define a challenge" ); } - MqttPublishPrefixTopicRulesProcess_P(STAT, D_CMND_POPCHALLENGERESULT, Settings->flag5.mqtt_status_retain); ResponseClear(); } @@ -1170,6 +1171,13 @@ void CmndCIDsToBeQueried(void) { ResponseClear(); } +void CmndVersion(void) { + Response_P( "{ \"%s\": \"%s\" }", D_CMND_VERSION, RDDL_VERSION); + + CmndStatusResponse(41); + ResponseClear(); +} + void CmndStatus(void) { int32_t payload = XdrvMailbox.payload; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_129_rddl_network.ino b/tasmota/tasmota_xdrv_driver/xdrv_129_rddl_network.ino index 648aeeeab414..0d6cbc684bc9 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_129_rddl_network.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_129_rddl_network.ino @@ -137,6 +137,7 @@ void SetExecutePoP(){ executePoP = true; } + void releaseNotarizationMutex() { g_mutex_running_notarization = false; @@ -226,7 +227,14 @@ void InitializePoPWorkflow(){ AddLog(2, "PoP: initialize PoP challenge"); // select CID - uint32_t cidsToBeQueried = (uint32_t)atoi(sdkGetSetting( SET_CIDS_TO_BE_QUERIED)); + uint32_t cidsToBeQueried = 1; + char* cids2Bqueried = sdkGetSetting(SET_CIDS_TO_BE_QUERIED); + if( cids2Bqueried == NULL or strcmp( (const char*) cids2Bqueried, "") == 0 ) + cidsToBeQueried = 2; + uint32_t tmpCids2Bqueried = (uint32_t)atoi(cids2Bqueried); + if( tmpCids2Bqueried > 0 ){ + cidsToBeQueried = tmpCids2Bqueried; + } char* cid = getCIDofChallengee( cidsToBeQueried ); if( cid == NULL ){ AddLog(2, "{ \"PoP\": no cid retrieved }"); diff --git a/tasmota/user_config_override_sample.h b/tasmota/user_config_override_sample.h index 896d050ebe77..e87486376aca 100644 --- a/tasmota/user_config_override_sample.h +++ b/tasmota/user_config_override_sample.h @@ -87,8 +87,7 @@ Examples : // !!! Remember that your changes GOES AT THE BOTTOM OF THIS FILE right before the last #endif !!! */ - - +#define RDDL_VERSION "rddl-v0.0.0" #endif // _USER_CONFIG_OVERRIDE_H_