How jvandervyver/libvoltronic works
Project type and purpose
• This is a C-based driver library (“libvoltronic”) that exposes a single uniform API (voltronic_dev_t) for talking to Voltronic inverter devices.
• It supports multiple transport backends (RS-232 serial, USB HID) but shares a common protocol and CRC logic.
• The library is meant to be embedded in client applications (see src/serial_main.c and src/usb_main.c as examples).
File structure
• Top‐level files:
• Makefile, checkout_dependencies.sh – build and fetch vendored libs
• README.md, LICENSE – documentation & licensing
• / – public headers defining the API and transport interfaces:
• voltronic_dev.h (core API)
• voltronic_dev_serial.h, voltronic_dev_usb.h (factory functions for each backend)
• voltronic_crc.h (CRC helper)
• src/ – implementation of:
• Core protocol logic and API: voltronic_dev.c, voltronic_crc.c
• Concrete backends: voltronic_dev_serial_libserialport.c, voltronic_dev_usb_hidapi.c
• Example mains: serial_main.c, usb_main.c
• lib/ – vendored external dependencies: hidapi, libserialport, libusb
• obj/ – build artifacts
README for additional insights
• Describes the common command/response protocol with CRC16-XMODEM and reserved chars.
• Outlines supported transports: RS232 (via libserialport), USB HID (via HIDAPI/libusb), Bluetooth, RS485 (future).
• Explains build steps and target OS quirks.