Skip to content

Commit

Permalink
ab::noack => ab::txAck
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharp38 committed Oct 10, 2023
1 parent 1fc9873 commit b121f9f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/ajax/Abeille.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ function sendToCmd($topic, $payload = '') {
$e['since'] = '-';
else
$e['since'] = floor((time() - strtotime($e['lastComm'])) / 3600);
$e['noack'] = $eqLogic->getStatus('ab::noack', false);
$e['txAck'] = $eqLogic->getStatus('ab::txAck', 'ok');

// Last LQI
if ($eqAddr == "0000")
Expand Down
3 changes: 1 addition & 2 deletions core/class/Abeille.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1778,8 +1778,7 @@ public static function msgFromParser($msg) {

$eqLogic = eqLogic::byLogicalId($net.'/'.$addr, 'Abeille');
if (is_object($eqLogic)) {
$noack = ($msg['txStatus'] == 'ok') ? false : true;
$eqLogic->setStatus('ab::noack', $noack);
$eqLogic->setStatus('ab::txAck', $msg['txStatus']); // ab::txAck == 'ok' or 'noack'
$eqLogic->save();
} else {
log::add('Abeille', 'error', "msgFromParser(eqTxStatusUpdate): Equipement inconnu: ".$net.'/'.$addr);
Expand Down
7 changes: 4 additions & 3 deletions core/class/AbeilleCmdQueue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ function processAcks() {
cmdLog('debug', ' Corresponding cmd not found.');
continue;
}

cmdLog('debug', "cmd=".json_encode($cmd));
// If ACK is requested but failed, removing cmd or it will lead to cmd timeout.
// Note: This is done only if cmd == last sent.
// if ($cmd['ackAps'] && $lastSent)
Expand All @@ -754,11 +754,12 @@ function processAcks() {
if ($eq === false) {
cmdLog('debug', " WARNING: Unknown device: Net=${net} Addr=${addr}");
} else {
cmdLog('debug', "eq=".json_encode($eq));
if ($msg['status'] == '00') { // Ok ?
if ($eq['txStatus'] != 'ok')
if ($eq['txStatus'] !== 'ok')
$eqStatusChanged = 'ok';
} else { // NO ACK ?
if ($eq['txStatus'] != 'noack')
if ($eq['txStatus'] !== 'noack')
$eqStatusChanged = 'noack';
}
if ($eqStatusChanged != '') {
Expand Down
2 changes: 1 addition & 1 deletion core/php/AbeilleCmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ function signalHandler($signal) {
$eqModel = $eqLogic->getConfiguration('ab::eqModel', []);
$eq = array(
'ieee' => $eqLogic->getConfiguration('IEEE', ''),
'txStatus' => $eqLogic->getStatus('ab::noack', 'ok'), // Transmit status: 'ok' or 'noack'
'txStatus' => $eqLogic->getStatus('ab::txAck', 'ok'), // Transmit status: 'ok' or 'noack'
'jsonId' => isset($eqModel['id']) ? $eqModel['id'] : '',
'jsonLocation' => isset($eqModel['location']) ? $eqModel['location'] : 'Abeille',
);
Expand Down
2 changes: 1 addition & 1 deletion core/php/AbeilleSupportKeyInfos.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function devicesInfos() {
$lastComm = $eqLogic->getStatus('lastCommunication');
$extra = ", TIMEOUT (last comm ".$lastComm.")";
$status = "TO";
} else if ($eqLogic->getStatus('ab::noack', false) != false) {
} else if ($eqLogic->getStatus('ab::txAck', 'ok') != 'ok') {
$extra = ", NO-ACK";
$status = "NA";
}
Expand Down
6 changes: 3 additions & 3 deletions desktop/modal/AbeilleHealth.modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ function refreshHealth() {
status = '<span class="label label-default" style="font-size: 1em; cursor: default;">{{Désactivé}}</span>';
else if (addr.substr(2) == "rc") // Remote control ?
status = '<span class="label label-success" style="font-size: 1em; cursor: default;">-</span>';
else if (e.timeout || e.noack) {
else if (e.timeout || (e.txAck == 'noack')) {
if (e.timeout && !e.noack)
s = "{{Time-out}}";
else if (!e.timeout && e.noack)
else if (!e.timeout && (e.txAck == 'noack'))
s = "{{No-ACK}}";
else
s = "{{Time-out}}&{{No-ACK}}";
s = "{{Time-out}}/{{No-ACK}}";
status = '<span class="label label-danger" style="font-size: 1em; cursor: default;">' + s + '</span>';
} else
status = '<span class="label label-success" style="font-size: 1em; cursor: default;">{{OK}}</span>';
Expand Down
2 changes: 1 addition & 1 deletion docs/fr_FR/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ChangeLog

- Interne: Msg 8012 n'est plus transmis à 'AbeilleCmd'.
- Interne: Cmd: Correction changement adresse lors d'une nouvelle annonce.
- Interne: Correction status 'NO-ACK'.
- Interne: Correction status 'NO-ACK' + 'ab::noack' => 'ab::txAck'.

231009-BETA-1
-------------
Expand Down

0 comments on commit b121f9f

Please sign in to comment.