#indigo #api-client #astrophotography #indi #astronomy #api-bindings

libindigo

Rust API for developing INDIGO astronomy clients and devices

1 unstable release

new 0.1.0+INDIGO.2.0.301 Nov 29, 2024

#247 in Hardware support

MIT license

19MB
367K SLoC

C 269K SLoC // 0.1% comments C++ 52K SLoC // 0.1% comments Shell 17K SLoC // 0.2% comments M4 16K SLoC // 0.2% comments Visual Studio Project 7.5K SLoC Rust 2.5K SLoC // 0.1% comments Automake 1.5K SLoC // 0.3% comments Visual Studio Solution 1K SLoC Assembly 283 SLoC // 0.2% comments WebAssembly 269 SLoC HICAD 243 SLoC Prolog 188 SLoC Scons 160 SLoC // 0.3% comments Objective-C 69 SLoC // 0.1% comments Perl 57 SLoC Xcode Config 49 SLoC // 0.7% comments Forge Config 6 SLoC // 0.9% comments Snakemake 1 SLoC // 1.0% comments

Rust API for writing client appliations and device drivers related to astronomy equipment that uses the INDIGO protocol and architecture. It is based on the standard INDIGO open source project that provides an API written in C and is ported to Rust through the bindgen generated FFI bindings.

[!CAUTION] The current version of LibINDIGO-rs should be considered alpha quality, i.e. a first draft for how INDIDGO development could look like with Rust. Please refer to the known issues page for details.

The libindigo-rs API is consists of five public modules:

  • libindigo - Shared API for client and device driver development.
  • libindigo/bus - API related to controlling the INDIGO bus.
  • libindigo/client - API specific for developing INDIGO clients.
  • libindigo/device - API specific for developing INDIGO device drivers.
  • libindigo/server - API specific for managing INDIGO servers.

The client and device modules contains implementations of traits defined in the libindigo API, notable Device

File Structure

tree --gitignore
# files elided for brevity
├── relm/...                    # Example Relm4 Client APP crate for testing libINDIGO.
├── src                         # libINDIGO source code
│   ├── bus.rs                  # internal bus module
│   ├── client.rs               # public API specific to client development
│   ├── device.rs               # public API specific for device and driver development
│   ├── lib.rs                  # generic INDIGO code applicable for both devices and clients
│   ├── property.rs             # internal property module
│   └── server.rs               # internal server module
├── sys                         # INDIGO FFI bindings crate
│   ├── externals               # git submodules
│   │   └── indigo              # -> https://github.com/indigo-astronomy/indigo.git
│   └── build.rs                # generates Rust API using `bindgen`
├── tests                       # integration tests
│   └── sanity.rs               # sanity tests, requires indigo running at localhost
├── Cargo.toml                  # libINDIGO crate definition
├── ISSUES.md                   # known issues
├── NOTES.md                    # development notes
└── READM.md                    # this file

Dependencies

~3–10MB
~114K SLoC