Repository navigation
refactor(core): share discovery options copy and correct stale comments - #815
Conversation
Discovery connect hand-copied DeviceConnectionOptions in two places, so a new property would be dropped there and kept on the direct TCP path. SD listing and log-extension docs still described a removed TestData extension and a firmware that emits no end-of-listing marker. Serial probe comments still cited EchoDisableSettleMs and an 8s hard timeout. Co-authored-by: Tyler Kron <tylerkron@gmail.com>
|
/agentic_review |
PR Summary by QodoShare discovery option copying and correct Core documentation
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1.
|
An empty directory still carries __END_OF_LIST__ on firmware #794+, so the byte-identical ambiguity is qualified to older firmware and to truncated replies, which is why the SYSTem:ERRor? terminator is still needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 7e8a0a1 |
What was wrong
Three small Core docs/duplication issues, checked against current
main. None of the open PRs in #770, #771, #781, #790, or #805–#814 own them. #805 deletes vacuous finder timeout facts; this does not touch tests or timeout values.SD listing and log-extension docs
ISdCardOperations.StartSdCardLoggingAsyncstill said an omitted file name islog_YYYYMMDD_HHMMSSwith.datfor TestData. There is no TestData format.SdCardListIncompleteExceptionand theGetSdCardFilesAsyncremarks still said the firmware emits no end-of-listing marker, and that the exception only means theSYSTem:ERRor?terminator never came back.Serial probe-timeout comments
SerialDeviceFinder's hard-timeout rationale still summedDeviceWakeUpDelayMs 200 + EchoDisableSettleMs 250 + ResponseTimeoutMs 1000(~1.5s).EchoDisableSettleMsis gone. ThePortProbeHardTimeoutMstest seam still said tests shrink the timeout "instead of waiting 8s per case". The default hard timeout is 3s. Timeout behavior is unchanged.Discovery connect cloned options twice
ConnectWiFiDeviceAsyncandConnectSerialDeviceAsynceach hand-copied the same settableDeviceConnectionOptionsproperties before applying the discovered name. A new property would be dropped on discovery connect and kept on the direct TCP path.What the sibling or implementation already does
StartSdCardLoggingSessionAsyncalready maps the extension:Json→.json,Csv→.csv, otherwise.bin. The public session overload already says "a format-appropriate extension" and does not mention TestData. The publicStartSdCardLoggingAsyncparam text now matches the session implementation:.binfor Protobuf,.jsonfor JSON,.csvfor CSV.GetSdCardFilesAsyncalready throwsSdCardListIncompleteExceptionon both paths. The missing-answer path is unchanged: theSYSTem:ERRor?terminator appended toSYSTem:STORage:SD:LISt?never comes back (closes api: a timed-out SD LIST is indistinguishable from an empty SD card #396). After a reply that terminator closed,SdCardFileListParser.GetListingStatusreads the device marker (__END_OF_LIST__, firmware test(device): fold EndToEndTests into DaqifiDeviceWithTransportTests #794).FAILEDandINCOMPLETEthrow, and any status word other thanOKis treated as incomplete and throws too. A missing marker on a terminated reply is the pre-test(device): fold EndToEndTests into DaqifiDeviceWithTransportTests #794 firmware and is not an error —SdCardListingStatus.Unterminatedalready says so. The public exception text onISdCardOperations.GetSdCardFilesAsync, the exception type remarks, and the implementation remarks now say both paths. The exception's runtime message is unchanged.DiscoverAsyncalready budgets a healthy port at ~1.2s fromDeviceWakeUpDelayMs+ResponseTimeoutMs. The hard-timeout comment now cites that pair, and the test seam citesDefaultPortProbeHardTimeoutMs(3s). The historical note that an 8s ceiling felt sluggish next to the 2–3s sweep stays, as the reason the ceiling is 3s.ConnectTcpAsyncandConnectSerialAsyncalready pass the caller'sDeviceConnectionOptionsinstance through. Discovery connect is the only path that must clone, because it may replace a defaultDeviceNamewithIDeviceInfo.Name. Both discovery methods now callCopyOptionsWithNameOverride, which copies the same properties and applies the same name rule as the two hand-copies did.No behavior change. Tests were not edited.
Verification
dotnet build src/Daqifi.Core/Daqifi.Core.csproj: 0 warnings, 0 errors (net9.0 and net10.0).SdCardOperationsTestson net10.0: 180 passed, 0 failed. Those tests cover the missing-terminator path,__END_OF_LIST__ OKas an empty card, and__END_OF_LIST__ INCOMPLETE/FAILEDthrowingSdCardListIncompleteException.