# CosmicSDK

**CosmicSDK** is a native C++ SDK and C API designed to interface with Binho host adapters, Supernova and Pulsar. This SDK allows developers to integrate and communicate with Binho devices in their codebases, providing a robust and efficient way to interact with USB-connected peripherals.

## Features

- **Native C++ Integration:** High-performance SDK for direct control of Binho host adapters.
- **C and C++ APIs:** Easily adaptable to any programming language you use.
- **Dynamic and Static Libraries:** Choose between dynamic (.dll/.so) and static (.lib/.a) linking options based on your project's needs.
- **Blocking API Functions:** All API functions are blocking, ensuring operations complete before proceeding to the next step.
- **Callback Mechanism:** Register callbacks to handle asynchronous notifications from the host adapters, enabling responsive and event-driven programming.
- **Cross-Platform Support:** Compatible with Windows, macOS, and Linux environments.

## Language Integrations

CosmicSDK is primarily a C++ library, but it is designed to be easily integrated into projects using other languages as well, such as C#, Python and Java.

Examples of how to integrate this SDK into other language are delivered as part of the installer. Check out them out in the following folders:

- C integration. See examples located in `examples/blocking_api/c`.
- C++ integration. See examples located in `examples/blocking_api/cpp` and `examples/async_api/cpp`.
- C# integration. See `examples/language_bindings/csharp`.
- Python integration. See `examples/language_bindings/python`.
- Java integration. See `examples/language_bindings/java`.

All examples include basic usage of the CosmicSDK, such as configuring I2C parameters, performing writes, and reading data.
- C#, Python and Java Examples: These examples include basic wrappers around the CosmicSDK, offering a more user-friendly API that adheres to the standard conventions and data types of their respective languages. You can use these wrappers as-is, extend them, or use them as a reference to create custom wrappers tailored to your specific use case.
- C and C++ Examples: These examples demonstrate direct SDK usage and include their respective CMakeLists.txt files to guide integration into your own projects. Use them as templates to incorporate CosmicSDK into your workflows efficiently.

> PATH Setup: Some of this examples require the CosmicSDK DLLs and HIDAPI DLLs are set in the system PATH, namely C, C++ and C#. Remember to set these paths in your system before proceeding.

## Documentation

The complete documentation of this SDK is publicly available at [https://binhollc.github.io/CosmicSDK/](https://binhollc.github.io/CosmicSDK/). 

It is also distributed with the installation package as static HTML documentation, accessible via the relative path `docs/html/index.html` from the installation directory. The most important topics covered are outlined in the following subsections.

### Prerequisites

First and foremost, check the list of prerequisites available in section [Prerequisites](https://binhollc.github.io/CosmicSDK/getting_started/prerequisites) required to just run the examples provided or integrate the CosmicSDK into your project.

### Examples

- See section [How to Build and Run the C and C++ Examples](https://binhollc.github.io/CosmicSDK/getting_started/examples.html#how-to-build-and-run-the-c-and-c-examples) to understand how to build C and C++ examples depending on the host platform, Windows, macOS or Linux.
- See section [Language Bindings](https://binhollc.github.io/CosmicSDK/language_bindings/bindings.html#language-bindings) to understand how to build C#, Python and Java examples.

### Adding the CosmicSDK to your projects

See section [Adding the CosmicSDK to your projects](https://binhollc.github.io/CosmicSDK/getting_started/integration.html#adding-the-cosmicsdk-to-your-projects) to integrate the CosmicSDK into your applications.

## Contact Us

If you encounter any issues or need assistance, please reach out to our customer support at [techsupport@binho.io](mailto:techsupport@binho.io).

Happy coding!
