add updatecheck for v5

This commit is contained in:
John
2023-06-11 10:46:07 +02:00
parent 7f0328cbae
commit dd7c668af4
4 changed files with 19 additions and 9 deletions
+4 -2
View File
@@ -3,9 +3,11 @@ version=`head -n 1 ../../VERSION`
revision=`git describe --always` revision=`git describe --always`
echo "ebusd=${version},${revision}" > versions.txt echo "ebusd=${version},${revision}" > versions.txt
echo "ebusd=${version},${revision}" > oldversions.txt echo "ebusd=${version},${revision}" > oldversions.txt
devver=`curl -s https://adapter.ebusd.eu/firmware/ChangeLog|grep "Version "|head -n 1|sed -e 's#.*<code[^>]*>##' -e 's#<.*##' -e 's# ##'` devver=`curl -s https://adapter.ebusd.eu/v31/firmware/ChangeLog|grep "<h[0-9].*>Version "|head -n 1|sed -e 's#.*<code[^>]*>##' -e 's#<.*##' -e 's# ##'`
devbl=`curl -s https://adapter.ebusd.eu/firmware/ChangeLog|grep "Bootloader "|head -n 1|sed -e 's#.*<code[^>]*>##' -e 's#<.*##' -e 's# ##'` devbl=`curl -s https://adapter.ebusd.eu/v31/firmware/ChangeLog|grep "<h[0-9].*>Bootloader version"|head -n 1|sed -e 's#.*<code[^>]*>##' -e 's#<.*##' -e 's# ##'`
echo "device=${devver},${devbl}" >> versions.txt echo "device=${devver},${devbl}" >> versions.txt
devver=`curl -s https://adapter.ebusd.eu/v5/ChangeLog|grep "<h[0-9].*>Version "|head -n 1|sed -e 's#.*<code[^>]*>##' -e 's#<.*##' -e 's# ##'`
echo "device=${devver},${devver}" >> versions.txt
files=`find config/de -type f -or -type l` files=`find config/de -type f -or -type l`
../../src/lib/ebus/test/test_filereader $files|sed -e 's#^config/de/##' -e 's#^\([^ ]*\) #\1=#' -e 's# #,#g'|sort >> versions.txt ../../src/lib/ebus/test/test_filereader $files|sed -e 's#^config/de/##' -e 's#^\([^ ]*\) #\1=#' -e 's# #,#g'|sort >> versions.txt
files=`find config/en -type f -or -type l` files=`find config/en -type f -or -type l`
+2 -2
View File
@@ -23,11 +23,11 @@ $ref = @file_get_contents('ebusd-configuration/.git/refs/heads/master');
} }
?> ?>
<p>latest ebusd version: <?=$versions['ebusd'][0]?></p> <p>latest ebusd version: <?=$versions['ebusd'][0]?></p>
<p>latest device firmware: <?=$versions['device'][0]?></p> <p>latest device firmware: v5=<?=$versions['devicesame'][0]?>, v3*=<?=$versions['device'][0]?></p>
<p>config files:<table><thead><th>File</th><th>German</th><th>English</th></thead><tbody> <p>config files:<table><thead><th>File</th><th>German</th><th>English</th></thead><tbody>
<?php <?php
$func = function($v, $k) { $func = function($v, $k) {
if ($k==='ebusd' || $k==='device') { if ($k==='ebusd' || $k==='device' || $k==='devicesame') {
return; return;
} }
echo "<tr><td>$k</td>"; echo "<tr><td>$k</td>";
+11 -3
View File
@@ -10,7 +10,12 @@ function readVersions($old=false) {
global $versions; global $versions;
$val = explode('=', $val); $val = explode('=', $val);
if (count($val)>1) { if (count($val)>1) {
$versions[$val[0]] = explode(',', $val[1]); $key = $val[0];
$val = explode(',', $val[1]);
if ($key==='device' && count($val)===2 && $val[0]===$val[1]) {
$key = 'devicesame';
}
$versions[$key] = $val;
} }
}; };
array_walk($v, $func); array_walk($v, $func);
@@ -33,8 +38,11 @@ function checkUpdate($ebusdVersion, $ebusdRelease, $architecture, $deviceVersion
if ($deviceVersion && @$versions['device']) { if ($deviceVersion && @$versions['device']) {
$feat = strtok($deviceVersion, '.'); $feat = strtok($deviceVersion, '.');
$ver = strtok('.'); $ver = strtok('.');
if ($ver && $ver!==$versions['device'][0]) { if ($ver) {
$ret .= ', device firmware '.$versions['device'][0].' available'; $key = ($ver===strtok('.')) ? 'devicesame' : 'device';
if ($ver!==$versions[$key][0]) {
$ret .= ', device firmware '.$versions[$key][0].' available';
}
} }
} }
$newerAvailable = 0; $newerAvailable = 0;
+2 -2
View File
@@ -710,8 +710,8 @@ bool Device::handleEnhancedBufferedData(symbol_t* value, ArbitrationState* arbit
case 0x0200: case 0x0200:
case 0x0500: // with firmware version and jumper info case 0x0500: // with firmware version and jumper info
case 0x0800: // with firmware version, jumper info, and bootloader version case 0x0800: // with firmware version, jumper info, and bootloader version
stream << static_cast<unsigned>(m_infoBuf[0]) << "." // version minor stream << std::hex << static_cast<unsigned>(m_infoBuf[1]) // features mask
<< std::hex << static_cast<unsigned>(m_infoBuf[1]); // features mask << static_cast<unsigned>(m_infoBuf[0]) << "."; // version minor
if (m_infoLen >= 5) { if (m_infoLen >= 5) {
stream << "[" << std::setfill('0') << std::setw(2) << std::hex << static_cast<unsigned>(m_infoBuf[2]) stream << "[" << std::setfill('0') << std::setw(2) << std::hex << static_cast<unsigned>(m_infoBuf[2])
<< std::setw(2) << static_cast<unsigned>(m_infoBuf[3]) << "]"; << std::setw(2) << static_cast<unsigned>(m_infoBuf[3]) << "]";