# DLAPI Software Development Kit -- Windows x64
Copyright (c) Diffraction Limited, 2019-2026

Thank you for downloading the x64 Windows version of the Diffraction Limited DLAPI SDK. This package includes DLAPI version 4.3.2.1, and a sample C++17 application for using the SDK. It was built using MSVC 2022

# Prerequisites

You will need to install both the FTDI D2XX and D3XX API on your system in a location DLAPI will be able  to access them (i.e. C:\Windows\System32 for x64, or your application directory). They are provided for you in the dependencies folder.

# Installing the DLAPI

We advise using the latest installer for DLAPI from [https://diffractionlimited.com/down/SetupDLAPI.exe] to install the latest version
of DLAPI. We have included the latest version of the DLL in this package, but we advise against redistributing it to ensure your
clients are always using the latest version of the driver with your application.

# Compiling The Sample Application

The sample application found in ./sample comes with both CMake support. If you have Microsoft Visual Studio 2022 (or later), 
you can open ./sample/alumatest.sln and compile it directly. The application requires you install dlapi.dll in 
C:\Windows\System32 (either manually from the ./lib directory, or via the DLAPI installer). 

If you don't have MSVC 2022, you can use CMake to generate a makefile for a toolchain of your choosing:

```
cd ./sample
mkdir build.custom
cd build.custom
cmake -G "[your-generator-here]" ..
```

or simply compile the contents of ./sample/src manually. We advise compiling with full C++17 support if possible, and using
MSVC 2022 on Windows, or clang 10.

The sample application is a command line tool that connects to the first found USB camera, reports its serial number,
and takes a 0.1 second, 1x1 binned dark frame, reporting its average pixel intensity in ADU.

# API Documentation

A full API reference, along with a "Getting Started" guide are available at [https://diffractionlimited.com/dlapi].

# Support

If you have any questions or concerns, you can reach out to us on our forums at [https://forum.diffractionlimited.com].

# Changelog
## Version 4.3.2.1
- Fixed issues uploading new firmware to a variety of cameras
- Minor image throughput improvements for the AC455 and AC461 series of cameras

## Version 4.2.7.0
- Added support for the AC461
- Added support for extended metadata retrieval via new API class `dl::V2::IImage`
- Added support for new serial number format 
- Added support for automated sensor shut-down on disconnect for AC455 and AC461 cameras w/ FPGA rev 30 and above
- Refined software subframes for the AC455 and 461 to speed up image transfer speeds.
- Added a new dl::V2::IFirmwareManager interface that lets the user execute and monitor asynchronous uploading of a firmware file directly using DLAPI across all supported platforms.
- Improved image dimensions for the AC455 to better match Sony spec for the IMX 455.
- Software binning in DLAPI now requests the highest binning available to the target binning to take advantage of harware binning whenever possible
- Fixed a bug where the AO-X goto coordinates were not transformed correctly, resulting in bad tip/tilt movement
- Fixed an issue that prevented binding to two network-capable cameras simultaneously
- Fixed an issue that prevented discovery of cameras on different network interfaces with same subnet
- Fixed an issue with STC model cameras and subframing
- Fixed a crash with STC model cameras when software binning at 3x3 and 4x4
- Fixed an issue with image packet retrieval for network cameras that was resulting in dropped packets
- Minor code cleanup

## Version 4.1.2.5
- Improved network handling code with retries on corrupt messages
- Added support for static IP assignment for AC455 cameras via the net.yml configuration file
- Fixed a bug where DLAPI would not bind to the correct network interface after discovery, resulting in conflicts when connecting multiple AC455 cameras
- Fixed a bug where cameras could be deleted prematurely if camera discovery is done while connected to a camera
- Fixed bugs with Software Bin Modes (sum-and-clip and averaging) for the STC and StarChaser lines of cameras
- Fixed bugs with Software binning (3x3 and 4x4) for the STC and StarChaser lines of cameras
- Fixed a crash when software binning 4x4 with an STC model camera
- Fixed an issue with the AC455 full frame size
- Various ISO-C++ compliance fixes

## Version 4.0.2.0
- Fixed a bug where GetSensorInfo was choking on an invalid message. The Comm now re-requests messages when we get garbage data back.

## Version 4.0.1.1
- Added support for SoftwareBinningMode Sensor Setting.
- Fixed a bug with the AC455 that resulted in blank columns in downloaded images

## Version 3.0.5.0
- Added support for the AC455 and streamlined UDP support.

## Version 2.7.1.0
- Optimized image transfer for the AC2020BSI
- Added 2x2 software binning for the AC4040BSI
- Fixed software binning issue with the AC2020BSI and AC4040FSI where StackPro images would produce dark areas/black images
- Fixed a mismatch between default filter wheel position after initialization and actual position
- A variety of stability/performance improvements
- Added greater compatibility with old firmware releases for ease of upgrade
- Added features for OEM use

## Version 2.4.0.0
- Added support for AC4040BSI cameras
- Improved debug logging around USB3 camera discovery to help troubleshoot failed connection attempts
- Fixed a bug where the camera's setpoint would be overridden with garbage when disabling the TEC. Prevented ASCOM conformance. Driver now reports setpoint 0 when the TEC is off.

## Version 2.1.2.0
- Migrated to C++17 to remove some third-party dependencies from the binary
- Migrated to a synchronous USB I/O communication model, increasing throughput by an order of magnitude
- Added support for StarChaser E branded cameras
- Fixed a bug resulting in inaccurate representation of Exposure Midpoint (at the sub-second level)

## Version 2.0.3.0
- Changed compiler version from MSVC v140 (2015) x86 -> MSVC v142 (2019) x86
- Improved support for AC2020 cameras
- Improved logging to include message header information in verbose mode
- Added support for 8-bit readout mode of STC cameras
- Added support for StarChaser P3 cameras
- Various internal bugfixes

## Version 2.0.2.0
- Added support for AC2020 model cameras
- Added support for AFW-16 - AFW-2 filter wheels
- Added support for dual-wheel operation of AFW wheels
- Added support for controlling settable ADC gains (e.g. Analog ADC gains in GSENSE4040)
- Added native support for software binning in Aluma CCD and StarChaser cameras
- Added FW command logging to DLAPI logs
- Added logging support for USB 3.0 based cameras
- Changed DLAPI log timestamps to UTC
- Fixed a bug that put log files in "%APPDATA%/Diffraction Limited/dlapi" rather than correct "%APPDATA%/Diffraction Limited/dlapi/logs" subfolder.
- Fixed a bug where numbers written to log were expressed as non-alphanumeric ASCII characters
- Fixed a bug that prevented cameras from being discoverable in multiple processes running simultaneously
- Fixed a bug where some commands would not report an API status when the associated promise resolved
- Fixed a bug in the logger that could result in a hang on shutdown
- Fixed a rare crash on shutdown related to network support
- General ISO-C++ compliance tweaks

## Version 1.9.4.0
- Updated default camera capabilities to more closely reflect hardware realities
- AC4040 and USB 3.0 optimizations speed optimizations
- Improved debug logging around exceptions
- Fixed a bug where post-processing STC model cameras crashed the calling application when subframing
- Removed AC4040 readout modes for "HDR StackPro" and "Low StackPro" to reflect firmware restrictions
- Added "Internal" Filter Wheel to IFW Model list, and slot count to FW implementation 
- Updated descrambling and subframing algorithm to use 16 overscan pixels for all readout modes & fixed a bug with AC4040  where we were duplicating the high gain image when subframing in HDR mode.

## Version 1.8.4.0
- Added support for STC-7 model cameras
- Fixed a number of stability issues

## Version 1.7.1.0
- Improved support for STC model cameras

## Version 1.6.0.0
- Added support for STC model cameras
- Improved firmware upload speed via USB for D2XX based cameras

## Version 1.4.2.0

  Added support for StarChaser cameras
  Extended error reporting API
  Fixed issue with AO8/AOX misidentification
  Fixed issue recognizing ICX814 sensors
  Various bugfixes


## Version 1.3.5.0

- Added compliance with revision 19 of the DLAPI communication protocol (& Aluma FPGA revision 19)
- Added "CameraCapabilities" feature which reports the API features available to the calling application on a camera-by-camera basis
- Added key-value ISensor::Setting retrieval, and deprecated the bulk ISensor::setSettings() function & ISensor::Settings structure.
- Added ISensor::Setting entries for controlling camera's status LED (either enabled, or always-off)
- Fixed bugs with filter-wheel submodel identification
- Optimizations to USB And WiFi I/O
- Finalized C-Struct alignment for compatibility against a variety of platforms
- Work towards x64 compliance, binaries coming soon
- Fixed a bug with Network configuration not being reported correctly
- Fixed a bug where IPromise would never report IPromise::Executing

## Version 1.2.4.0

- Addressed an issue where structure padding was resulting in erroneous behavior during calls to ISensor::startExposure()
- Addressed an issue where TNetworkSettings::ssidLength and TNetworkSettings::passphraseLength were both unset after a call to ICamera::queryNetworkSettings()

## Version 1.2.3.0

- Addressed an issue where Filter Wheel slots were reported incorrectly (an off-by-one error)
- Improvements to network communication engine, enabling the detection and operation of multiple cameras
- Fixed an issue with Aluma 8300 filter wheel model detection