Repository navigation
1.3.0.0: GET/POST /settings and machine readable setting errors - #5
Merged
Merged
Conversation
- CameraSettingRules: pure validation (label, settable in the AE mode, accepted value). EdsGetPropertyDesc does not say whether a setting is locked by the mode (form/access are reserved, always 0), so a mode -> settable settings table based on the creative zone modes decides. - Setters return 409 not-settable-in-mode, 400 invalid-value / value-not-accepted, with reason, property, acceptedValues, aeMode, aeModeCode and errors in the problem details. - GET /settings: mode + iso/aperture/shutterSpeed/whiteBalance in one call. - POST /settings: validates everything before writing, writes in a fixed order under the shutter lock with the busy retry, reports applied/failed on a write failure, returns the settings read back. - docs/openapi.json updated by hand (generation needs Windows). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRZmo7wsZGgxrgkKqib1At
- An empty EdsGetPropertyDesc list means the setting cannot be changed
now (the Canon samples disable it; the 13.20 reference asks to set
only values from that list): 409 not-settable-in-mode, settable false.
- 0xFFFFFFFF ("Not valid/no settings changes") reads "Not valid" for
ISO, aperture, shutter speed and exposure compensation.
- Docs: form/access still reserved in 13.20, exposure compensation not
available in M confirmed (5.2.28).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FRZmo7wsZGgxrgkKqib1At
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRZmo7wsZGgxrgkKqib1At
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.
Summary
For the photo booth: apply a mall's "Day" / "Night" preset in one call, and tell a camera in the wrong shooting mode apart from a real failure.
Setting errors (existing setters and
/settings)invalid-value: the label cannot be read.value-not-accepted: the value is not in the list the camera accepts now (Bulb included).not-settable-in-mode: the shooting mode locks the setting (shutter speed in Av, aperture in Tv, anything in a scene mode, exposure compensation in M), or the camera lists no settable value (empty list: movie mode, no lens...).reason,property,acceptedValues,aeMode,aeModeCode,errors(one entry per refused setting).EDSDK 13.20.21 API reference:
EdsGetPropertyDescdoes not say whether a setting is locked by the mode (formandaccessare reserved, always 0). A mode → settable settings table (CameraSettingRules, based on the creative zone modes) decides. An empty list is treated as "not settable now", as the Canon samples do.New routes
GET /settings: the shooting mode, plus{ value, supportedValues, settable }for iso, aperture, shutterSpeed and whiteBalance, in one call.POST /settings{ iso?, aperture?, shutterSpeed?, whiteBalance? }:appliedandfailed.POST /iso,/aperture,/shutterspeed,/exposure,/whitebalancekeep their URL and body and use the same validation.Other
"Not valid"instead of"0xFFFFFFFF"(documented value "Not valid/no settings changes").docs/autoupdate.xmluntouched.Tests
dotnet build CanonSDK.sln: 0 errors.dotnet test Canon.Core.Tests: 102 passed, includingCameraSettingRulesTests(pure validation: invalid label, value not accepted, shutter speed in Av, aperture in Tv, scene modes, everything settable in M, exposure compensation in M, empty list, primary error, write order).docs/openapi.jsonwas updated by hand: generating it fails on Linux. Regenerate on Windows to confirm:dotnet build Canon.API -p:OpenApiGenerateDocumentsOnBuild=true.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRZmo7wsZGgxrgkKqib1At
Generated by Claude Code