Commit Graph
4 Commits
Author SHA1 Message Date
scottp 560ea24f60 Battery monitor: "not available" values decode as NAN
Each battery monitor field has a reserved "not available" raw value:
voltage 0x7FFF, aux 0xFFFF, current 0x3FFFFF, consumed Ah 0xFFFFF and
SOC 0x3FF. The parser decoded them as readings, so an unsynchronised
shunt reported SOC 102.3 % and an unavailable current came out as
-0.001 A after sign extension. They are now NAN in the C core.
Time-to-go stays an integer, with 0xFFFF named VICTRONBLE_TTG_NA. The
Arduino wrapper maps the new NANs to 0, as it already did for aux.

Adds a host test vector with every field not available, and notes in
the README that a battery monitor has now been decoded live on Zephyr
(ESP32-S3, Heltec WiFi LoRa 32 V3).
2026-11-11 13:13:57 +11:00
scottp 318e221170 v0.7.1: rename C core header to victronble_core.h (fixes #2)
src/ held both VictronBLE.h and victronble.h. On case-insensitive
filesystems (Windows, macOS) extracting the library ZIP overwrote one
with the other and the Arduino build failed.

The core header is now victronble_core.h in include/ and src/, and every
include is updated. include/victronble.h stays as a deprecated forwarder
so 0.7.0 Zephyr and host code still builds; it is never in src/.

check_version.sh now fails if two tracked paths differ only in case.
2026-10-09 12:54:06 +11:00
scottp 67ff8721c0 Zephyr: add watch mode (log every Victron advert heard)
victronble_watch_set(true) queues and logs adverts from any Victron
device — MAC, RSSI, record type, key-check byte, decode results — for
device discovery and key debugging at the bench.
2026-08-21 12:38:24 +10:00
scottp b390c0d579 v0.7.0: pure C core + Zephyr module
- Extract all decode/decrypt into a dependency-free C99 core
 (include/victronble.h, src/victronble_core.c): victronble_decode(),
 is_product_adv/key_matches pre-filters, NAN sentinels, LE accessors.
- AES-128-CTR behind a hook: weak-symbol bundled tiny-AES default,
 runtime override (victronble_set_aes_ctr) for PSA/mbedTLS/hardware.
- Arduino VictronBLE class becomes a thin wrapper over the core
 (registry + nonce dedup + rate limit); public C++ API unchanged,
 NAN converted back to the legacy 0 convention.
- Host test vectors (tests/vectors): openssl-generated ciphertext,
 independent of the bundled AES; all five payload shapes + negatives.
- Zephyr module: zephyr/module.yml + Kconfig (CONFIG_VICTRONBLE) +
 observer backend (victronble_zephyr.{h,c}) — scan cb pre-filters and
 queues, dedicated decode thread, listener callbacks, slow passive
 scan defaults, stats counters. docs/ZEPHYR_PORT.md records the plan.
- library.properties: fix URL (gitea, not the nonexistent GitHub).
2026-08-21 11:59:19 +10:00