Skip to content

Add support for DOTNET Facade FFI#320

Open
TekuSP wants to merge 5 commits intoFrameworkComputer:mainfrom
TekuSP:dotnet_ffi
Open

Add support for DOTNET Facade FFI#320
TekuSP wants to merge 5 commits intoFrameworkComputer:mainfrom
TekuSP:dotnet_ffi

Conversation

@TekuSP
Copy link
Copy Markdown

@TekuSP TekuSP commented Apr 20, 2026

Hello,

I am .NET Developer and not RUST Developer, this is warning of things to come.
I needed to integrate Framework-System into .NET ecosystem, using export "c" of RUST.

I have no idea if I have done this right, but I tried my best.
I made .NET integration library of other side here: https://github.com/TekuSP/framework-dotnet
With GIT Submodule, sample output of my test console app is:

Product: Laptop 16 (AMD Ryzen AI 300 Series)
Platform: Framework16AmdAi300
Family: Framework16
Driver support:
  Portio: False
  CrosEc: False
  Windows: True
Active driver: Windows
Build info: tulip-3.0.5-178a77d 2026-03-12 05:51:52 lotus@ip-172-26-3-226
Flash: Ro, RO=tulip-3.0.5-178a77d, RW=tulip-3.0.5-178a77d
Battery: 99%
AC Present: True
Manufacturer: NVT
Fan count: 2
Temp0: 56C (Ok)

Therefore even if my solution is bad, it works. It would be silly and stupid of me to not push this idea upstream, maybe someone will do it better, maybe someone has better solution. But this is for me only way to access Framework-System from .NET.

I did in the past app for cooling fans of MSI, want to port that for my Framework, including separate fan curves and control.

TekuSP added 4 commits April 20, 2026 19:15
- Introduce a new crate that exposes C-compatible functions for interacting with the EC and SMBIOS.
- Integrate `csbindgen` to automatically generate C# bindings during the build process.
- Implement helper types and snapshot functions in `framework_lib` to facilitate structured data retrieval.
- Export functionality for platform identification, battery status, and thermal/fan control.
- Add build steps for the .NET interop crate to FreeBSD, Linux, and Windows CI jobs.
- Configure CI to upload compiled native libraries and generated C# bindings as build artifacts.
- Update README with build instructions and technical details for the optional .NET interop functionality.
@TekuSP
Copy link
Copy Markdown
Author

TekuSP commented Apr 20, 2026

(And yes I did use Copilot for some tasks, as I have absolutely almost zero knowledge of RUST, I have knowledge of firmwares, OS, and frameworks in .NET (Yes we had C# OS))

@TekuSP
Copy link
Copy Markdown
Author

TekuSP commented Apr 20, 2026

All tests pass and library works on my laptop, there is one slight formatting change (Cause meh Lint) and one extended helper in original source code for getting some internal values. No changes made to RUST functionality (I hope), just exported a lot of stuff for C (And C#)

Signed-off-by: TekuSP <richard.torhan@windowslive.com>
@TekuSP
Copy link
Copy Markdown
Author

TekuSP commented Apr 20, 2026

Signed commit.

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.

1 participant