There exists a website of the FSF with more information and contacts regarding GPL violations:
gpl-violations.org/ and even a wikipedia page linking also to the website:
en.wikipedia.org/wiki/Gpl-violations.org

Read More...

Thomas Stibor replied to the topic 'INDI Code Style' in the forum. 3 weeks ago

Hi Jasem,

I think it should work and one could integrate it into the github CI process. It actually works as follows:
For demonstration I ill-formatted:

diff --git a/examples/tutorial_one/simpledevice.cpp b/examples/tutorial_one/simpledevice.cpp
index cbb68f65e..82e5d76eb 100644
--- a/examples/tutorial_one/simpledevice.cpp
+++ b/examples/tutorial_one/simpledevice.cpp
@@ -30,15 +30,14 @@ std::unique_ptr<SimpleDevice> simpleDevice(new SimpleDevice());
 ***************************************************************************************/
 bool SimpleDevice::Connect()
 {
-    IDMessage(getDeviceName(), "Simple device connected successfully!");
-    return true;
+IDMessage(getDeviceName(), "Simple device connected successfully!");
+return true;
 }
 
 /**************************************************************************************
 ** Client is asking us to terminate connection to the device
 ***************************************************************************************/
-bool SimpleDevice::Disconnect()
-{
+bool SimpleDevice::Disconnect() {
     IDMessage(getDeviceName(), "Simple device disconnected successfully!");
     return true;
 }
diff --git a/examples/tutorial_one/simpledevice.h b/examples/tutorial_one/simpledevice.h
index 0b0dbf709..b02ac03c0 100644
--- a/examples/tutorial_one/simpledevice.h
+++ b/examples/tutorial_one/simpledevice.h
@@ -25,7 +25,7 @@
 
 class SimpleDevice : public INDI::DefaultDevice
 {
-    public:
+public:
         SimpleDevice() = default;
 
     protected:

Once the the PR is fetched on github one could integrate into the CI the bash command and script:
$ for f in `git diff --name-only origin/master`; do .circleci/check-codestyle.sh "${f}"; done
***************************************************************************************/
 bool SimpleDevice::Connect()
 {
[STYLE WARNING]     IDMessage(getDeviceName(), "Simple device connected successfully!");
[STYLE WARNING]     return true;
 }
 
 /**************************************************************************************
 ** Client is asking us to terminate connection to the device
 ***************************************************************************************/
[STYLE WARNING] bool SimpleDevice::Disconnect()
[STYLE WARNING] {
     IDMessage(getDeviceName(), "Simple device disconnected successfully!");
     return true;
 }
File examples/tutorial_one/simpledevice.cpp has style warning(s), see https://github.com/indilib/indi/blob/master/README.md
 class SimpleDevice : public INDI::DefaultDevice
 {
[STYLE WARNING]     public:
         SimpleDevice() = default;
 
     protected:
File examples/tutorial_one/simpledevice.h has style warning(s), see https://github.com/indilib/indi/blob/master/README.md

I will try that out and send a PR when it works

Cheers
Thomas

Read More...

Hello Benjamin,

one can quickly check files for compilation in e.g. the DEB package libindi-dev

$ dpkg-query -L libindi-dev
/.
/usr
/usr/include
/usr/include/libindi
/usr/include/libindi/abstractbaseclient.h
/usr/include/libindi/alignment
/usr/include/libindi/alignment/AlignmentSubsystemForDrivers.h
/usr/include/libindi/alignment/AlignmentSubsystemForMathPlugins.h
...
/usr/include/libindi/v4l2_decode.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libindiAlignmentClient.a
/usr/lib/x86_64-linux-gnu/libindiclient.a
/usr/lib/x86_64-linux-gnu/libindidriver.a
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/libindi.pc
/usr/share
/usr/share/doc
/usr/share/doc/libindi-dev
/usr/share/doc/libindi-dev/AUTHORS
/usr/share/doc/libindi-dev/NEWS.gz
/usr/share/doc/libindi-dev/README.gz
/usr/share/doc/libindi-dev/changelog.gz
/usr/share/doc/libindi-dev/copyright
/usr/lib/libindiclient.so
/usr/lib/libindidriver.so
/usr/lib/libindilx200.so
/usr/lib/x86_64-linux-gnu/libindiAlignmentDriver.so
/usr/lib/x86_64-linux-gnu/libindiclient.so
/usr/lib/x86_64-linux-gnu/libindidriver.so
/usr/lib/x86_64-linux-gnu/libindilx200.so

Some compiling needs proper path to header (include) files and shared librararies *.so or archive files (.a).
So to be more specific compiling e.g. indi/examples/tutorial_three/simpleccd.cpp
$ g++ simpleccd.cpp -o simpleccd -I/usr/include/libindi -lindiclient -lindidriver && file simpleccd
simpleccd: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=94b50e8cba51f2f174afab03cc6e7a986f3606e4, for GNU/Linux 3.2.0, not stripped

Or e.g.
indi/examples/tutorial_seven
$g++ simple_telescope_simulator.cpp -o simple_telescope_simulator -I/usr/include/libindi -lindiclient -lindidriver && file simple_telescope_simulator
/usr/bin/ld: /tmp/ccESuSgI.o: undefined reference to symbol 'ln_get_julian_from_sys'
/usr/bin/ld: /lib/x86_64-linux-gnu/libnova-0.16.so.0: error adding symbols: DSO missing from command line
complains that libnova is missing, so adding the proper library as an additional parameter "-llibnova" (requires libnova packaged install) and in addition it requires
/usr/lib/x86_64-linux-gnu/libindiAlignmentDriver.so
one can compile it as follows:
$ g++ simple_telescope_simulator.cpp -o simple_telescope_simulator -I/usr/include/libindi -lindiAlignmentDriver -lnova -lindiclient -lindidriver && file simple_telescope_simulator
simple_telescope_simulator: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=13d9b3c7720caec9ea05288289ee79c28e915b43, for GNU/Linux 3.2.0, not stripped

Cheers
Thomas

Read More...

Thomas Stibor replied to the topic 'INDI Code Style' in the forum. 3 weeks ago

Sticking with astyle is probably a simpler approch and it is already documented in README.md as you mentioned.
With astyle one could also hook into github's CI

steps:
    - script: sudo apt-get install -y astyle
      displayName: 'Install extra package'
    - bash: for f in `git diff --name-only origin/master`; do check_cstyle.sh "${f}"; done
      displayName: 'C style check'

and use e.g. the following script check_cstyle.sh to show the ill-formatted lines:
#!/bin/bash

FILE_TO_CHECK=${1}
RC=0

# Make sure file exists and has proper suffix.
if [[ ! -f "${FILE_TO_CHECK}" ]] || [[ ! "${FILE_TO_CHECK##*\.}" =~ ^[cpp,cxx,c,h,C,H]$ ]]; then
    exit ${RC}
fi

TMP_FILE_DIFF=$(mktemp /tmp/indi.diff.XXXXXXXXX)
TMP_FILE_ASTYLE=$(mktemp /tmp/indi.astyle.XXXXXXXXX)
TMP_FILE_WARNINGS=$(mktemp /tmp/indi.warning.XXXXXXXXX)
ASTYLE_OPTIONS="--style=allman
                --align-reference=name
                --indent-switches
                --indent-modifiers
                --indent-classes
                --pad-oper
                --indent-col1-comments
                --lineend=linux
                --max-code-length=124"

git diff --function-context --unified=1 HEAD ${FILE_TO_CHECK} | sed -e '/diff --git/,+3d;/^@@/d;/^-/d;s/^+/ /' | cut -d' ' -f2- > ${TMP_FILE_DIFF}
astyle ${ASTYLE_OPTIONS} -n < ${TMP_FILE_DIFF} > ${TMP_FILE_ASTYLE}
diff -u ${TMP_FILE_DIFF} ${TMP_FILE_ASTYLE} | tail -n +3 | sed -e '/^-/d;/^@@/d;s/^+/[STYLE WARNING] /' > ${TMP_FILE_WARNINGS}

if [[ -s ${TMP_FILE_WARNINGS} ]]; then
    cat ${TMP_FILE_WARNINGS}
    RC=1
fi

if [[ ${RC} -eq 1 ]]; then
    echo -e "File ${FILE_TO_CHECK} has style warning(s), see" \
         "https://github.com/indilib/indi/blob/master/README.md"
fi

rm -f ${TMP_FILE_DIFF} ${TMP_FILE_ASTYLE} ${TMP_FILE_WARNINGS}

exit ${RC}


Read More...

Thomas Stibor created a new topic ' INDI Code Style' in the forum. 3 weeks ago

Hi there,

is there an official INDI code style (e.g. clang-format) file?
In the core INDI repo exists only the style file

./drivers/spectrograph/shelyak/.clang-format
whereas in the indi-3rdparty repo two additional clang-format files exist:
./.clang-format
./indi-libcamera/libcamera-apps/.clang-format

The .clang-format files differ and are not ensuring a conform code style.

In the main INDI repo
CMakeLists.txt
already contains code for formatting and checking:
# Clang Format support
if(UNIX OR APPLE)
    set(FORMAT_CODE OFF CACHE BOOL "Enable Clang Format")
...

How about unifying the code style with one .clang-format file (for core and 3rdparty)?

Cheers
Thomas

Read More...

Hello Daniel,

the INDI Gphoto driver uses the libgphoto2 library to communicate with the DSLR.
Setting the camera's SD card is basically the same as e.g. using the command line tool and setting:

gphoto2 --set-config capturetarget=1

That is, the RAW or JPEG image is not leaving the camera via any USB out, but is directly stored on the camera's SD card (when inserted) when taking an image or movie.
So saving the image in FITS is not possible when setting the target to SD. To save the image in FITS format, the RAW camera image first has to be read out from the camera
via USB (e.g. on Rpi or any PC) and then converted to FITS format. Once converted to FITS format the FIT headers are set.

Cheers
Thomas

Read More...

Thomas Stibor replied to the topic 'ev.h missing from astroberry' in the forum. 8 months ago

Hmm that is strange. I just booted by RPi and checked the version and installed it without any problems:

[indi@indiberry ~]$ lsb_release -a && apt info libev-dev && sudo apt install -y libev-dev
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
Package: libev-dev
Version: 1:4.25-1
Priority: optional
Section: libdevel
Source: libev
Maintainer: Boyuan Yang <byang@debian.org>
Installed-Size: 214 kB
Depends: libev4 (= 1:4.25-1)
Homepage: http://software.schmorp.de/pkg/libev.html
Download-Size: 125 kB
APT-Sources: http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
Description: static library, header files, and docs for libev
 Static library, header files, and documentation for libev.
 .
 libev provides a full-featured and high-performance event loop that is
 loosely modelled after libevent. It includes relative timers, absolute
 timers with customized rescheduling, synchronous signals, process status
 change events, event watchers dealing with the event loop itself, file
 watchers, and even limited support for fork events. It uses a priority
 queue to manage timers and uses arrays as fundamental data structure. It
 has no artificial limitations on the number of watchers waiting for the
 same event.
 .
 libev supports select, poll, epoll, kqueue, and inotify.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libev4
The following NEW packages will be installed:
  libev-dev libev4
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 160 kB of archives.
After this operation, 292 kB of additional disk space will be used.
Get:1 http://ftp.halifax.rwth-aachen.de/raspbian/raspbian buster/main armhf libev4 armhf 1:4.25-1 [34.5 kB]
Get:2 http://mirror.de.leaseweb.net/raspbian/raspbian buster/main armhf libev-dev armhf 1:4.25-1 [125 kB]
Fetched 160 kB in 0s (357 kB/s)
Selecting previously unselected package libev4:armhf.
(Reading database ... 289593 files and directories currently installed.)
Preparing to unpack .../libev4_1%3a4.25-1_armhf.deb ...
Unpacking libev4:armhf (1:4.25-1) ...
Selecting previously unselected package libev-dev.
Preparing to unpack .../libev-dev_1%3a4.25-1_armhf.deb ...
Unpacking libev-dev (1:4.25-1) ...
Setting up libev4:armhf (1:4.25-1) ...
Setting up libev-dev (1:4.25-1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+rpt2+rpi1) ...
[indi@indiberry ~]$

So probably the most simplest solution is to download that directly from one of the Debian mirror and install the package by hand:
packages.debian.org/buster/libev-dev
packages.debian.org/buster/armhf/libev-dev/filelist

So e.g.
wget http://ftp.cz.debian.org/debian/pool/main/libe/libev/libev-dev_4.25-1_armhf.deb && sudo dpkg --install ./libev-dev_4.25-1_armhf.deb


Read More...

Thomas Stibor replied to the topic 'ev.h missing from astroberry' in the forum. 8 months ago

What Debian version are you running?

[tstibor@apollo ~]$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye


Read More...

Thomas Stibor replied to the topic 'ev.h missing from astroberry' in the forum. 8 months ago

The header file is in package libev-dev (on Debian bullseye, and probably also in earlier Debian versions)

[tstibor@apollo ~]$ apt-file search /usr/include/ev.h
libev-dev: /usr/include/ev.h


Read More...