From 80e7f48b4241fd3dc4d96e82058d73a30412ffa2 Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Fri, 25 Sep 2026 15:27:21 +0800 Subject: [PATCH 1/4] Update Claude and IDE ignores --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 68d2dc7..1bc0be3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,8 @@ # Claude local only configs .claude/*.local.* +.claude/worktrees/ + +# IDE - JetBrains +.idea/ +*.iml From cae5ddd7381ad4a47a8ee5a7af84d8f5dd170ada Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Fri, 25 Sep 2026 15:32:05 +0800 Subject: [PATCH 2/4] Format README.me --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f24076d..35c6f44 100644 --- a/README.md +++ b/README.md @@ -58,12 +58,12 @@ bgl-read --list ### Output formats -| `--format` | Description | -|---|---| -| `json` | Device info and readings as pretty-printed JSON | -| `csv` | One reading per row, header included | -| `records` | Raw ASTM record text as received from the meter (useful for debugging) | -| `bytes` | Hex dump of every HID packet exchanged (TX and RX) | +| `--format` | Description | +|------------|------------------------------------------------------------------------| +| `json` | Device info and readings as pretty-printed JSON | +| `csv` | One reading per row, header included | +| `records` | Raw ASTM record text as received from the meter (useful for debugging) | +| `bytes` | Hex dump of every HID packet exchanged (TX and RX) | Timestamps are in the meter's own local time (no timezone attached — the device has no concept of timezone). @@ -74,14 +74,14 @@ has no concept of timezone). All Contour Next devices share USB vendor ID `0x1A79` (Ascensia / Bayer). -| Product ID | Device | -|------------|--------| -| `0x7800` | Contour Next One (USB-only variant) | -| `0x7440` | Contour Next USB | -| `0x7350` | Contour Next | -| `0x7900` | Ascensia Contour Next | -| `0x6220` | Contour Next Link | -| `0x6230` | Contour Next Link 2.4 | +| Product ID | Device | +|------------|-------------------------------------| +| `0x7800` | Contour Next One (USB-only variant) | +| `0x7440` | Contour Next USB | +| `0x7350` | Contour Next | +| `0x7900` | Ascensia Contour Next | +| `0x6220` | Contour Next Link | +| `0x6230` | Contour Next Link 2.4 | The tool opens the first matching device it finds. Run `--list` to see what is connected. From ac8eeafd826026593d6ea8d894bac3f3817c4a5e Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Fri, 25 Sep 2026 15:32:33 +0800 Subject: [PATCH 3/4] Reduce device physical reads on general capture --- bin/capture-bgl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/capture-bgl b/bin/capture-bgl index c45d551..a8e9ea2 100755 --- a/bin/capture-bgl +++ b/bin/capture-bgl @@ -18,7 +18,12 @@ echo_err() { # Ensure the captures directory exists mkdir -p "${CAP_DIR}/${DATE_CAP}" -cargo run -- --format csv --progress --output "${CAP_DIR}/${DATE_CAP}/${PREFIX}-bgl.csv" -cargo run -- --format json --progress --output "${CAP_DIR}/${DATE_CAP}/${PREFIX}-bgl.json" +# Read records first, to reduce device calls cargo run -- --format records --progress --output "${CAP_DIR}/${DATE_CAP}/${PREFIX}-bgl.txt" +# Generate CSV and JSON from the records capture +cargo run -- --from-records "${CAP_DIR}/${DATE_CAP}/${PREFIX}-bgl.txt" --format csv --output "${CAP_DIR}/${DATE_CAP}/${PREFIX}-bgl.csv" +cargo run -- --from-records "${CAP_DIR}/${DATE_CAP}/${PREFIX}-bgl.txt" --format json --output "${CAP_DIR}/${DATE_CAP}/${PREFIX}-bgl.json" +# Finally, re-capture to get the bytes +# TODO: Need to fix this so that a proper binary is generated and that can generate +# the records file, which can in turn generate the other formats? cargo run -- --format bytes --progress --output "${CAP_DIR}/${DATE_CAP}/${PREFIX}-bgl.hex" From 3aff95437aeb0f8be52e827fc7e3edcb0f901b6f Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Fri, 25 Sep 2026 15:32:49 +0800 Subject: [PATCH 4/4] Remove unused function --- bin/capture-bgl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/capture-bgl b/bin/capture-bgl index a8e9ea2..aafc97a 100755 --- a/bin/capture-bgl +++ b/bin/capture-bgl @@ -11,10 +11,6 @@ CAP_DIR="${PRJ_DIR}/captures" DATE_CAP=$(date "+%Y%m%d") PREFIX="${1:-unknown}" -echo_err() { - echo "$1" >&2 -} - # Ensure the captures directory exists mkdir -p "${CAP_DIR}/${DATE_CAP}"