From ef50829c81c9ea045d072629a8cd436895c26735 Mon Sep 17 00:00:00 2001 From: Scott Penrose Date: Fri, 5 Jun 2026 00:00:25 +1000 Subject: [PATCH] Cleanup READMED and release notes --- .claude/CLAUDE.md | 28 ++++++++++++ README.md | 4 +- UPGRADE_V0.4.md | 106 ---------------------------------------------- 3 files changed, 29 insertions(+), 109 deletions(-) delete mode 100644 UPGRADE_V0.4.md diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 5818ec2..bba1c91 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -320,3 +320,31 @@ cd3b462 ignore local - src/VictronBLE.h - src/crypto/vble_aes.c + +### Session: 2026-06-04 23:58 +**Commits:** +``` +53fa6fa ignore pka file +de6607d Branch version ready for testing with nRF52 +``` +**Modified files:** +- .gitignore +- README.md +- UPGRADE_V0.4.md +- VERSIONS +- library.json +- library.properties + + +### Session: 2026-06-05 00:00 +**Commits:** +``` +53fa6fa ignore pka file +de6607d Branch version ready for testing with nRF52 +``` +**Modified files:** +- .claude/CLAUDE.md +- .gitignore +- README.md +- UPGRADE_V0.4.md + diff --git a/README.md b/README.md index fc37e7b..e9bc96e 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,7 @@ A portable Arduino library for reading Victron Energy device data via Bluetooth Low Energy (BLE) advertisements — runs on both **ESP32** and **nRF52840**. -**⚠️ API CHANGE in v0.4 — not backwards compatible with v0.3.x** - -v0.4 is a major rework of the library internals: new callback API, reduced memory usage, non-blocking scanning. See [VERSIONS](VERSIONS) for full details. A stable **v1.0** release with a consistent, long-term API is coming soon. +v0.6 adds **multi-platform support** (ESP32 + nRF52840) via a hardware-abstracted BLE backend and dependency-free bundled crypto. (v0.5 brought the decoding accuracy fixes and AC charger support; v0.4 reworked the internals — function-pointer callback API, reduced memory usage, non-blocking scanning.) See [VERSIONS](VERSIONS) for full details. A stable **v1.0** release with a consistent, long-term API is coming soon. --- diff --git a/UPGRADE_V0.4.md b/UPGRADE_V0.4.md deleted file mode 100644 index 8b6353c..0000000 --- a/UPGRADE_V0.4.md +++ /dev/null @@ -1,106 +0,0 @@ -# Upgrading to VictronBLE v0.4 - -v0.4 is a breaking API change that simplifies the library significantly. - -## Summary of Changes - -- **Callback**: Virtual class → function pointer -- **Data access**: Inheritance → tagged union (`VictronDevice` with `solar`, `battery`, `inverter`, `dcdc` members) -- **Strings**: Arduino `String` → fixed `char[]` arrays -- **Memory**: `std::map` + heap allocation → fixed array, zero dynamic allocation -- **Removed**: `getLastError()`, `removeDevice()`, `getDevicesByType()`, per-type getter methods, `VictronDeviceConfig` struct, `VictronDeviceCallback` class -- **Removed field**: `panelVoltage` (was unreliably derived from `panelPower / batteryCurrent`) - -## Migration Guide - -### 1. Callback: class → function pointer - -**Before (v0.3):** -```cpp -class MyCallback : public VictronDeviceCallback { - void onSolarChargerData(const SolarChargerData& data) override { - Serial.println(data.deviceName + ": " + String(data.panelPower) + "W"); - } - void onBatteryMonitorData(const BatteryMonitorData& data) override { - Serial.println("SOC: " + String(data.soc) + "%"); - } -}; -MyCallback callback; -victron.setCallback(&callback); -``` - -**After (v0.4):** -```cpp -void onVictronData(const VictronDevice* dev) { - switch (dev->deviceType) { - case DEVICE_TYPE_SOLAR_CHARGER: - Serial.printf("%s: %.0fW\n", dev->name, dev->solar.panelPower); - break; - case DEVICE_TYPE_BATTERY_MONITOR: - Serial.printf("SOC: %.1f%%\n", dev->battery.soc); - break; - } -} -victron.setCallback(onVictronData); -``` - -### 2. Data field access - -Fields moved from flat `SolarChargerData` etc. into the `VictronDevice` tagged union: - -| Old (v0.3) | New (v0.4) | -|---|---| -| `data.deviceName` | `dev->name` (char[32]) | -| `data.macAddress` | `dev->mac` (char[13]) | -| `data.rssi` | `dev->rssi` | -| `data.lastUpdate` | `dev->lastUpdate` | -| `data.batteryVoltage` | `dev->solar.batteryVoltage` | -| `data.batteryCurrent` | `dev->solar.batteryCurrent` | -| `data.panelPower` | `dev->solar.panelPower` | -| `data.yieldToday` | `dev->solar.yieldToday` | -| `data.loadCurrent` | `dev->solar.loadCurrent` | -| `data.chargeState` | `dev->solar.chargeState` (uint8_t, was enum) | -| `data.panelVoltage` | **Removed** - see below | - -### 3. panelVoltage removed - -`panelVoltage` was a derived value (`panelPower / batteryCurrent`) that was unreliable (division by zero when no current, inaccurate due to MPPT conversion). It has been removed. - -If you need an estimate: -```cpp -float panelVoltage = (dev->solar.batteryCurrent > 0.1f) - ? dev->solar.panelPower / dev->solar.batteryCurrent - : 0.0f; -``` - -### 4. getLastError() removed - -Debug output now goes directly to Serial when `setDebug(true)` is enabled. Remove any `getLastError()` calls. - -**Before:** -```cpp -if (!victron.begin(2)) { - Serial.println(victron.getLastError()); -} -``` - -**After:** -```cpp -if (!victron.begin(2)) { - Serial.println("Failed to initialize VictronBLE!"); -} -``` - -### 5. String types - -Device name and MAC are now `char[]` instead of Arduino `String`. Use `Serial.printf()` or `String(dev->name)` if you need a String object. - -### 6. addDevice() parameters - -Parameters changed from `String` to `const char*`. Existing string literals work unchanged. `VictronDeviceConfig` struct is no longer needed. - -```cpp -// Both v0.3 and v0.4 - string literals work the same -victron.addDevice("MySolar", "f69dfcce55eb", - "bf25c098c156afd6a180157b8a3ab1fb", DEVICE_TYPE_SOLAR_CHARGER); -```