This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ZWOptical.SDK — a .NET 10 NuGet package providing C# P/Invoke bindings to ZWO's native C SDKs for astronomical cameras (ASI), electronic focusers (EAF), and filter wheels (EFW). Part of the SharpAstro ecosystem.
dotnet build -c ReleaseNuGet package is generated on every build (GeneratePackageOnBuild). No test projects exist.
GitHub Actions (.github/workflows/dotnet.yml): builds on push/PR to main, auto-publishes .nupkg to NuGet.org on merge. Versioning uses 4.0.<run_number> scheme set via -p:Version=... in CI.
All source is in /include/. The project is a thin wrapper — each file maps 1:1 to a native SDK:
- ASICamera2.cs — Camera SDK bindings.
ASI_CAMERA_INFOimplementsICMOSNativeInterfacefrom TianWen.DAL. - EAFFocuser1_6.cs — Focuser SDK bindings.
EAF_INFOimplementsINativeDeviceInfo. - EFW1_7.cs — Filter wheel SDK bindings.
EFW_INFOimplementsINativeDeviceInfo. - ZWO_ID.cs — Shared
ZWO_IDstruct for serial numbers/device aliases. - DeviceIterator.cs — Generic
DeviceIterator<TDeviceInfo>extendingNativeDeviceIteratorBase<T>from TianWen.DAL; dispatches enumeration across all three device types.
The original C headers (.h files in /include/) serve as reference for the bindings.
TianWen.DAL provides base abstractions (INativeDeviceInfo, ICMOSNativeInterface, NativeDeviceIteratorBase<T>, CMOSControlType, CMOSErrorCode, etc.). All public types live under the ZWOptical.SDK namespace.
Platform-specific native binaries in /lib/ are packed into the NuGet package for 6 targets: win-x86, win-x64, linux-x86, linux-x64, linux-arm, linux-arm64. Each platform includes ASICamera2, EAFFocuser1.6, and EFW1.7 shared libraries.
- Namespace
ZWOptical.SDKdoes not match folder structure — this is intentional (suppressed viaGlobalSuppressions.cs). - P/Invoke method signatures should match the C headers exactly.
- Struct layouts use
[StructLayout(LayoutKind.Sequential)]to match native memory layout.