Repository navigation
Conversation
- el15-bt/ moves to alientek-el15/; the library starts its own version line at 0.1.0, the apps keep the workspace version - crates.io metadata, crate README, CHANGELOG, LICENSE (a real copy) and a read-only example - apps depend on it by path and version and are not published - provenance: reverse-engineered from the official Android app ATK-xTOOL, cross-checked against DM40GUI (not a port of it) - release.yml attaches the library .crate to every app release - CI lints all targets, checks the library docs and a publish dry run
- tokio: rt (the notification pump task), sync (its channel) and time (scan timeouts, command pacing); the example uses the full runtime
The crate name already says EL15. Breaking: - EL15Status becomes Status, EL15_SERVICE_UUID becomes SERVICE_UUID, HEADER becomes STATUS_HEADER, Status::dcr_mohm becomes dcr_ohm (Ohms) - parse_status_packet returns Result<Status, ParseError> and rejects a wrong length, header or checksum; a corrupted packet used to be emitted as a measurement (crc_pass false but valid true) - firmware version is a FirmwareVersion struct (same Display text); it and the CAP current reply check their checksum - Status keeps measurements only: the display strings (mode_name, setpoint unit/label/decimals, raw_hex) go; warning is Option<Warning> - MODE_NAMES and Device::watch_central_events are removed; Error is non_exhaustive and keeps only the variants it returns
- without `ble` the crate keeps the frames, the checksum and the parsers, and depends only on thiserror - INTER_COMMAND_GAP moves to protocol: it is a fact about the device, not about btleplug - serde becomes opt-in; the apps do not serialize library types - CI lints and tests the library without default features Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tested on the device (HW:2.0 / SW:1.7, load off): - an unpaced 3-command burst (mode CAP, setpoint, CAP current) lost the mode switch 4/6 at 0 ms and 1/6 at 30 ms; ACKs went missing up to 60 ms - Device::send now waits out INTER_COMMAND_GAP since the previous write from any task and never overlaps writes, so send, send_sequence and init_handshake are all paced; the same burst then took effect 6/6 - the device exposes FFF1/FFF2/FFF3 under FFF0 only; connect prefers FFF1 and no longer falls back to a characteristic of another service Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A DCR test on a Li-ion cell (I1 25 mA, I2 1000 mA) reported 173.15 in bytes 23..27; the voltage drop between the two currents gives 173.6 mOhm. The docs and the previous commits claimed Ohms; that was wrong. - keep the field name Status::dcr_mohm, now documented as milliohms - the GUI card was right; the CLI debug output labelled it Ohm - unit test from the captured packet Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mbers Breaking: build_set_setpoint_cmd and build_set_cap_current_cmd return Result<Vec<u8>, InvalidValue>. - NaN, infinity and negative values are refused; f32::clamp keeps NaN, so typing "nan" as the CAP current used to put NaN on the wire - the CAP current above 12 A is refused instead of silently clamped; a setpoint above 7500 (CR's limit, SETPOINT_MAX) is refused - the GUI and CLI log or print the refusal and send nothing; SCPI skips both the frame and the stored setpoint
DCR status packets carry the I1/I2 test currents where other modes carry the temperature, so the card always read 0.00 °C. It now shows "---".
Found while checking why the info reply read `14 00 ...` instead of "EL15": an earlier 10-byte 0x06 probe had been stored as the name. Writing "EL15" with 0x06 restored the reply byte-for-byte to the official app's capture. No builder is added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The device reports the DCR result in milliohms and MEAS:DCR? passed that number through. SCPI replies use base units, as MEAS:RES? already does, so convert to Ohms. Documented in SCPI_PROTOCOL.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares the Bluetooth LE protocol library for crates.io as
alientek-el15and keeps theel15app in the same repository. While doing it, several bugs were found and fixed; each fix was measured on a real EL15 (HW 2.0 / SW 1.7).Restructure (same pattern as
skyrc-mc5000)el15-bt/moves toalientek-el15/. The library has its own version, starting at 0.1.0, and tagsalientek-el15-v<version>. The app keeps the workspace version andv*tags.examples/status.rs, andLICENSEas a real file (not a symlink).path+version.el15-app,el15-scpiandscpi-testhavepublish = false. The README documents how another project can use a local checkout (pathor[patch.crates-io]).blefeature. Without it the crate depends only onthiserror.serdeis opt-in.rt,syncandtime.release.ymlattaches the current library.crateto every app release.tests.yml:RUSTDOCFLAGS=-D warningscargo publish --dry-runruns on itBreaking API changes (0.1.0 vs
el15-bt0.1.4, all listed in the CHANGELOG)EL15Status→StatusEL15_SERVICE_UUID→SERVICE_UUIDHEADER→STATUS_HEADERparse_status_packetreturnsResult<Status, ParseError>. It rejects a wrong length, wrong header or bad checksum. Before this, a corrupted packet came back withcrc_pass: false, valid: trueand was emitted as a measurement.Statuskeeps measurements only:mode_name, setpoint unit/label/decimals,raw_hex.warningisOption<Warning>.FirmwareVersionstruct whoseDisplayis unchanged.build_set_setpoint_cmdandbuild_set_cap_current_cmdreturnResultand refuse NaN, infinity and negative values.f32::clampkeeps NaN, so typingnanas the CAP current used to put NaN on the wire.MODE_NAMESandDevice::watch_central_events.Erroris#[non_exhaustive].Fixes measured on the device
Write pacing. An unpaced three-command burst (mode CAP, setpoint, CAP current) lost the mode switch 4 times out of 6.
Device::sendnow waits 120 ms after the previous write from any task, which also pacesinit_handshake. With that, the same burst took effect 6/6 with 18/18 ACKs.Read-only queries were never lost. 300 polls came back as 300 single 28-byte notifications with valid checksums.
Characteristics. The device exposes FFF1/FFF2/FFF3 under FFF0 only.
connectnow prefers FFF1 and no longer falls back to characteristics of other services.DCR unit is milliohms, not Ohms. On a Li-ion cell, the voltages at the two test currents (4.1693 V at 24.8 mA, 3.9998 V at 1001.3 mA) give 173.6 mΩ. The device reported
173.15. The docs said Ohms. The field keeps the namedcr_mohm, the CLI label is fixed, and a unit test uses the captured packet.SCPI.
MEAS:DCR?now returns Ohms (the SCPI base unit, likeMEAS:RES?) instead of passing the device's mΩ value through.GUI. The DCR panel showed 0.00 °C, but DCR packets carry no temperature. It now shows
---.Opcode
0x06= set device name (docs only, no builder). An earlier probe had overwritten the name with14 00 …. Writing "EL15" restored the INFO reply byte-for-byte to the official app's capture. The advertised BLE name (_BLE) did not follow on reconnect.Checks (local, rustc / clippy 1.100.0)
cargo test --workspace: library 26 tests, app 49 tests, all passingcargo clippy --workspace --all-targets -- -D warnings: cleancargo clippy -p alientek-el15 --all-targets --no-default-features -- -D warnings: cleancargo test -p alientek-el15 --no-default-features: 22 tests passingcargo clippy -p alientek-el15 --all-targets --all-features -- -D warnings: cleanRUSTDOCFLAGS=-D warnings cargo doc -p alientek-el15 --no-deps: cleancargo publish -p alientek-el15 --dry-run: OKNot in this PR: the AI-assistant instruction files (
CLAUDE.md,AGENTS.md,.github/copilot-instructions.md) were updated locally but will be committed separately.Designed by Claude.
🤖 Generated with Claude Code