Skip to content

1.3.0.0: GET/POST /settings and machine readable setting errors - #5

Merged
dansleboby merged 4 commits into
mainfrom
claude/hopeful-babbage-yebol9
Sep 30, 2026
Merged

dansleboby merged 4 commits into
mainfrom
claude/hopeful-babbage-yebol9

Conversation

@dansleboby

Copy link
Copy Markdown
Owner

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)

  • 400 invalid-value: the label cannot be read.
  • 400 value-not-accepted: the value is not in the list the camera accepts now (Bulb included).
  • 409 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...).
  • Problem details extensions: reason, property, acceptedValues, aeMode, aeModeCode, errors (one entry per refused setting).

EDSDK 13.20.21 API reference: EdsGetPropertyDesc does not say whether a setting is locked by the mode (form and access are 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? }:
    • Every value is checked before anything is written. If one is refused, nothing is written and one problem details lists every refused setting.
    • Values are then written in a fixed order, on the SDK thread, with the "busy" retry, under the shutter lock (never during a capture or an autofocus).
    • If a write fails partway, the problem details carry applied and failed.
    • On success, the response is the settings read back from the camera.
  • The existing routes POST /iso, /aperture, /shutterspeed, /exposure, /whitebalance keep their URL and body and use the same validation.

Other

  • ISO, aperture, shutter speed and exposure compensation read "Not valid" instead of "0xFFFFFFFF" (documented value "Not valid/no settings changes").
  • Version 1.3.0.0, CHANGELOG dated 2026-09-30, README upgrade note, docs/autoupdate.xml untouched.

Tests

  • dotnet build CanonSDK.sln: 0 errors.
  • dotnet test Canon.Core.Tests: 102 passed, including CameraSettingRulesTests (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).
  • Not tested with a physical camera.
  • docs/openapi.json was 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

- 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
@dansleboby
dansleboby merged commit 1bfada2 into main Sep 30, 2026
1 check passed
@dansleboby
dansleboby deleted the claude/hopeful-babbage-yebol9 branch October 4, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants