Compare commits
14 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 1b0992928b | |||
| 4edbc7d426 | |||
| 45dce9cf9f | |||
| ac39e1aa01 | |||
| 6ba1285ba7 | |||
| 89acea9503 | |||
| bc24b89eb0 | |||
| d265e7b043 | |||
| e63f05f378 | |||
| ea98de4009 | |||
| 7527142358 | |||
| ff690e6be6 | |||
| 04cb563d8d | |||
| 7dbed50b93 |
112
fix-infinite-loop.patch
Normal file
112
fix-infinite-loop.patch
Normal file
@@ -0,0 +1,112 @@
|
||||
From 8d123d976aa0e68fbc0918db1119282a9f071102 Mon Sep 17 00:00:00 2001
|
||||
From: Jasem Mutlaq <mutlaqja@ikarustech.com>
|
||||
Date: Mon, 15 Dec 2025 17:52:39 +0300
|
||||
Subject: [PATCH] Fix infinite loop when read=0
|
||||
|
||||
---
|
||||
libs/indibase/connectionplugins/ttybase.cpp | 34 +++++++++++++++++++++
|
||||
libs/indicore/indicom.c | 18 +++++++++++
|
||||
2 files changed, 52 insertions(+)
|
||||
|
||||
diff --git a/libs/indibase/connectionplugins/ttybase.cpp b/libs/indibase/connectionplugins/ttybase.cpp
|
||||
index e6247782bd..bfee729ce1 100644
|
||||
--- a/libs/indibase/connectionplugins/ttybase.cpp
|
||||
+++ b/libs/indibase/connectionplugins/ttybase.cpp
|
||||
@@ -166,6 +166,8 @@ TTYBase::TTY_RESPONSE TTYBase::read(uint8_t *buffer, uint32_t nbytes, uint8_t ti
|
||||
|
||||
uint32_t numBytesToRead = nbytes;
|
||||
int bytesRead = 0;
|
||||
+ int zero_read_count = 0;
|
||||
+ const int MAX_ZERO_READS = 3;
|
||||
TTY_RESPONSE timeoutResponse = TTY_OK;
|
||||
*nbytes_read = 0;
|
||||
|
||||
@@ -185,6 +187,21 @@ TTYBase::TTY_RESPONSE TTYBase::read(uint8_t *buffer, uint32_t nbytes, uint8_t ti
|
||||
if (bytesRead < 0)
|
||||
return TTY_READ_ERROR;
|
||||
|
||||
+ if (bytesRead == 0)
|
||||
+ {
|
||||
+ zero_read_count++;
|
||||
+ if (zero_read_count >= MAX_ZERO_READS)
|
||||
+ {
|
||||
+ DEBUGFDEVICE(m_DriverName, m_DebugChannel,
|
||||
+ "%s: Device not responding (zero bytes read %d times)", __FUNCTION__, MAX_ZERO_READS);
|
||||
+ return TTY_READ_ERROR;
|
||||
+ }
|
||||
+ usleep(10000); // 10ms delay before retry
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ zero_read_count = 0; // Reset counter on successful read
|
||||
+
|
||||
DEBUGFDEVICE(m_DriverName, m_DebugChannel, "%d bytes read and %d bytes remaining...", bytesRead,
|
||||
numBytesToRead - bytesRead);
|
||||
for (uint32_t i = *nbytes_read; i < (*nbytes_read + bytesRead); i++)
|
||||
@@ -210,6 +227,8 @@ TTYBase::TTY_RESPONSE TTYBase::readSection(uint8_t *buffer, uint32_t nsize, uint
|
||||
return TTY_ERRNO;
|
||||
|
||||
int bytesRead = 0;
|
||||
+ int zero_read_count = 0;
|
||||
+ const int MAX_ZERO_READS = 3;
|
||||
TTY_RESPONSE timeoutResponse = TTY_OK;
|
||||
*nbytes_read = 0;
|
||||
memset(buffer, 0, nsize);
|
||||
@@ -230,6 +249,21 @@ TTYBase::TTY_RESPONSE TTYBase::readSection(uint8_t *buffer, uint32_t nsize, uint
|
||||
if (bytesRead < 0)
|
||||
return TTY_READ_ERROR;
|
||||
|
||||
+ if (bytesRead == 0)
|
||||
+ {
|
||||
+ zero_read_count++;
|
||||
+ if (zero_read_count >= MAX_ZERO_READS)
|
||||
+ {
|
||||
+ DEBUGFDEVICE(m_DriverName, m_DebugChannel,
|
||||
+ "%s: Device not responding (zero bytes read %d times)", __FUNCTION__, MAX_ZERO_READS);
|
||||
+ return TTY_READ_ERROR;
|
||||
+ }
|
||||
+ usleep(10000); // 10ms delay before retry
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ zero_read_count = 0; // Reset counter on successful read
|
||||
+
|
||||
DEBUGFDEVICE(m_DriverName, m_DebugChannel, "%s: buffer[%d]=%#X (%c)", __FUNCTION__, (*nbytes_read), *read_char, *read_char);
|
||||
|
||||
(*nbytes_read)++;
|
||||
diff --git a/libs/indicore/indicom.c b/libs/indicore/indicom.c
|
||||
index 529db938db..f42e618058 100644
|
||||
--- a/libs/indicore/indicom.c
|
||||
+++ b/libs/indicore/indicom.c
|
||||
@@ -597,6 +597,9 @@ int tty_read_expanded(int fd, char *buf, int nbytes, long timeout_seconds, long
|
||||
buffer = geminiBuffer;
|
||||
}
|
||||
|
||||
+ int zero_read_count = 0;
|
||||
+ const int MAX_ZERO_READS = 3;
|
||||
+
|
||||
while (numBytesToRead > 0)
|
||||
{
|
||||
if ((err = tty_timeout_microseconds(fd, timeout_seconds, timeout_microseconds))) {
|
||||
@@ -610,6 +613,21 @@ int tty_read_expanded(int fd, char *buf, int nbytes, long timeout_seconds, long
|
||||
if (bytesRead < 0)
|
||||
return TTY_READ_ERROR;
|
||||
|
||||
+ if (bytesRead == 0)
|
||||
+ {
|
||||
+ zero_read_count++;
|
||||
+ if (zero_read_count >= MAX_ZERO_READS)
|
||||
+ {
|
||||
+ if (tty_debug)
|
||||
+ IDLog("%s: Device not responding (zero bytes read %d times)\n", __FUNCTION__, MAX_ZERO_READS);
|
||||
+ return TTY_READ_ERROR;
|
||||
+ }
|
||||
+ usleep(10000); // 10ms delay before retry
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ zero_read_count = 0; // Reset counter on successful read
|
||||
+
|
||||
if (tty_debug)
|
||||
{
|
||||
IDLog("%d bytes read and %d bytes remaining...\n", bytesRead, numBytesToRead - bytesRead);
|
||||
37
fix-safety-monitor.patch
Normal file
37
fix-safety-monitor.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
From 7891ede769f350db0b8117e2a3182b204230a055 Mon Sep 17 00:00:00 2001
|
||||
From: Jasem Mutlaq <mutlaqja@ikarustech.com>
|
||||
Date: Thu, 4 Dec 2025 11:34:13 +0300
|
||||
Subject: [PATCH] Fix critical bug in safety monitor where client status check
|
||||
did not trigger a callback
|
||||
|
||||
---
|
||||
drivers/auxiliary/safetymonitor_client.cpp | 15 ++++++---------
|
||||
1 file changed, 6 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/drivers/auxiliary/safetymonitor_client.cpp b/drivers/auxiliary/safetymonitor_client.cpp
|
||||
index 7f1893daf3..a38fe652ef 100644
|
||||
--- a/drivers/auxiliary/safetymonitor_client.cpp
|
||||
+++ b/drivers/auxiliary/safetymonitor_client.cpp
|
||||
@@ -106,16 +106,13 @@ void SafetyMonitorClient::updateProperty(INDI::Property property)
|
||||
{
|
||||
if (property.getDeviceName() == m_DeviceName && property.isNameMatch("SAFETY_STATUS"))
|
||||
{
|
||||
- if (m_SafetyStatusLP.getState() != property.getState())
|
||||
- {
|
||||
- m_SafetyStatusLP = property;
|
||||
- LOGF_INFO("Safety Monitor Client: Updated safety status from %s, state: %s",
|
||||
- m_DeviceName.c_str(), pstateStr(m_SafetyStatusLP.getState()));
|
||||
+ m_SafetyStatusLP = property;
|
||||
+ LOGF_INFO("Safety Monitor Client: Updated safety status from %s, state: %s",
|
||||
+ m_DeviceName.c_str(), pstateStr(m_SafetyStatusLP.getState()));
|
||||
|
||||
- // Notify parent driver of status change
|
||||
- if (m_StatusCallback)
|
||||
- m_StatusCallback();
|
||||
- }
|
||||
+ // Notify parent driver of status change
|
||||
+ if (m_StatusCallback)
|
||||
+ m_StatusCallback();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ccf1999abfe84469a04149142c1cf5383cb6e2ac5e63f7b05d7892fb717c168e
|
||||
size 2958687
|
||||
3
indi-2.1.7.tar.gz
Normal file
3
indi-2.1.7.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1ab6697847eae635873f4270ae200ef5331c87844f52733d4ad201aad0919192
|
||||
size 3265446
|
||||
49
indi.changes
49
indi.changes
@@ -1,3 +1,52 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 18 07:37:44 UTC 2025 - Paolo Stivanin <info@paolostivanin.com>
|
||||
|
||||
- Add fix-safety-monitor.patch
|
||||
- Add fix-infinite-loop.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 2 13:45:57 UTC 2025 - Paolo Stivanin <info@paolostivanin.com>
|
||||
|
||||
- Update to 2.1.7:
|
||||
* Separate build of drivers base classes from drivers by @sterne-jaeger in #2285
|
||||
* Allow using hidapi from system by @mattiaverga in #2272
|
||||
* Power refactor by @knro in #2287
|
||||
* SestoSenso3 Support by @knro in #2288
|
||||
* iOptron iAFS Rotator by @joe13905179063 in #2290
|
||||
* Refactor for INDI:Power Interface by @hcomet in #2291
|
||||
* Fix bug with driver not registering correctly by @jrhuerta in #2293
|
||||
* Add USB ports parameter to initProperties comment by @LuckyEddie47 in #2292
|
||||
* Add Weather Interface support to WandererBoxPlusV3 and WandererBoxProV3 by @grm in #2300
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 13 07:13:48 UTC 2025 - Paolo Stivanin <info@paolostivanin.com>
|
||||
|
||||
- Update to 2.1.6:
|
||||
* Refactoring GeminiFlatPanel driver to support multiple devices
|
||||
* Added check for lightbox capabilities in LI::updateProperties()
|
||||
* Alpaca bridge
|
||||
* Add NUT UPS Safety device support to drivers.xml
|
||||
* Intertial Measurement Unit (IMU) Support
|
||||
* Telescope Simulator, AltAz mount and derotation option
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Sep 28 16:52:12 UTC 2025 - Arjen de Korte <suse+build@de-korte.org>
|
||||
|
||||
- Boost.System has been header only since Boost 1.69.0
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 25 09:27:38 UTC 2025 - Paolo Stivanin <info@paolostivanin.com>
|
||||
|
||||
- Update to 2.1.5.1:
|
||||
* https://github.com/indilib/indi/releases/tag/v2.1.5.1
|
||||
* https://github.com/indilib/indi/releases/tag/v2.1.5
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 24 06:44:18 UTC 2025 - Paolo Stivanin <info@paolostivanin.com>
|
||||
|
||||
- Update to 2.1.4:
|
||||
* https://github.com/indilib/indi/releases/tag/v2.1.4
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 1 11:42:51 UTC 2025 - Paolo Stivanin <info@paolostivanin.com>
|
||||
|
||||
|
||||
17
indi.spec
17
indi.spec
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package indi
|
||||
#
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC and contributors
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
%define so_ver 2
|
||||
Name: indi
|
||||
Version: 2.1.3
|
||||
Version: 2.1.7
|
||||
Release: 0
|
||||
Summary: Instrument Neutral Distributed Interface
|
||||
License: GPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-3.0-or-later
|
||||
@@ -30,9 +30,15 @@ Group: Productivity/Scientific/Astronomy
|
||||
URL: https://www.indilib.org/
|
||||
Source0: https://github.com/indilib/indi/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
Source1: indi-rpmlintrc
|
||||
# PATCH-FIX-UPSTREAM https://github.com/indilib/indi/commit/9ce200b65d65ae2d5e4d25796049273d99fcf41e
|
||||
Patch0: fix-safety-monitor.patch
|
||||
# PATCH-FIX-UPSTREAM https://github.com/indilib/indi/commit/7891ede769f350db0b8117e2a3182b204230a055
|
||||
Patch1: fix-infinite-loop.patch
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc%{?force_gcc_version}-c++ >= 12
|
||||
%if 0%{?suse_version} < 1600
|
||||
BuildRequires: libboost_system-devel
|
||||
%endif
|
||||
BuildRequires: libboost_thread-devel
|
||||
%if 0%{?sle_version} > 150500 || 0%{?suse_version} >= 1600
|
||||
BuildRequires: cfitsio-devel
|
||||
@@ -45,8 +51,8 @@ BuildRequires: liblz4-devel
|
||||
BuildRequires: libnova-devel
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: pugixml-devel
|
||||
BuildRequires: cmake(Qt5Core)
|
||||
BuildRequires: cmake(Qt5Network)
|
||||
BuildRequires: cmake(Qt6Core)
|
||||
BuildRequires: cmake(Qt6Network)
|
||||
BuildRequires: pkgconfig(fftw3)
|
||||
BuildRequires: pkgconfig(gsl)
|
||||
BuildRequires: pkgconfig(libcurl)
|
||||
@@ -163,8 +169,7 @@ export CXXFLAGS="$CFLAGS"
|
||||
%cmake \
|
||||
-DINDI_BUILD_STATIC=OFF \
|
||||
-DUDEVRULES_INSTALL_DIR=%{_udevrulesdir} \
|
||||
-DINDI_BUILD_QT5_CLIENT=ON \
|
||||
-DINDI_BUILD_XISF=ON \
|
||||
-DINDI_BUILD_QT_CLIENT=ON \
|
||||
%if 0%{?force_gcc_version}
|
||||
-DCMAKE_CXX_COMPILER=%{_bindir}/g++-%{?force_gcc_version} \
|
||||
%endif
|
||||
|
||||
Reference in New Issue
Block a user