From bef4b2ec35063a85bc9603d3952e67e6eba1577c Mon Sep 17 00:00:00 2001 From: Asbelos Date: Mon, 9 Oct 2023 18:09:48 +0100 Subject: [PATCH 1/2] fix default roster --- DCCEXParser.cpp | 2 +- version.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index fe21549..7b4836e 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -121,7 +121,7 @@ Once a new OPCODE is decided upon, update this list. for (int16_t i=0;;i+=sizeof(flashList[0])) { \ int16_t value=GETHIGHFLASHW(flashList,i); \ if (value==INT16_MAX) break; \ - if (value != 0) StringFormatter::send(stream,F(" %d"),value); \ + StringFormatter::send(stream,F(" %d"),value); \ } diff --git a/version.h b/version.h index a76aef2..1610054 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,8 @@ #include "StringFormatter.h" -#define VERSION "5.0.3" +#define VERSION "5.0.4" +// 5.0.4 - Bugfix: misses default roster. // 5.0.3 - Check bad AT firmware version // 5.0.2 - Bugfix: ESP32 30ms off time // 5.0.1 - Bugfix: execute 30ms off time before rejoin From 8b8e9e491963bcfdd963942e0ae0abfdf1eaf918 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Thu, 12 Oct 2023 11:07:05 +0100 Subject: [PATCH 2/2] clean result from invalid --- DCCEXParser.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 7b4836e..04c0b6d 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -729,11 +729,15 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) SENDFLASHLIST(stream,RMFT2::rosterIdList) } else { - const FSH * functionNames= RMFT2::getRosterFunctions(id); - StringFormatter::send(stream,F(" %d \"%S\" \"%S\""), - id, RMFT2::getRosterName(id), - functionNames == NULL ? RMFT2::getRosterFunctions(0) : functionNames); - } + auto rosterName= RMFT2::getRosterName(id); + if (!rosterName) rosterName=F(""); + + auto functionNames= RMFT2::getRosterFunctions(id); + if (!functionNames) functionNames=RMFT2::getRosterFunctions(0); + if (!functionNames) functionNames=F(""); + StringFormatter::send(stream,F(" %d \"%S\" \"%S\""), + id, rosterName, functionNames); + } #endif StringFormatter::send(stream, F(">\n")); return;