Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
[![NuGet](https://img.shields.io/nuget/v/UsbSerialForMacOS.svg?label=NuGet&logo=nuget)](https://www.nuget.org/packages/UsbSerialForMacOS/)

**UsbSerialForMacOS** is a .NET binding for a native Swift library that enables serial port communication on macOS and Mac Catalyst.
It allows .NET MAUI and .NET 8+ apps to enumerate, open, read from, and write to serial devices (such as USB-to-serial adapters and 3D printers) using a simple C# API.
It allows .NET MAUI and .NET 10+ apps to enumerate, open, read from, and write to serial devices (such as USB-to-serial adapters and 3D printers) using a simple C# API.

## Usage

1. Add the NuGet package to your .NET 8+ Mac or Mac Catalyst project.
1. Add the NuGet package to your .NET 10+ Mac or Mac Catalyst project.
2. Add following to Entitlements.plist

```xml
Expand All @@ -36,7 +36,7 @@ if (ports.Length > 0)

| Platform | Target Framework | Architectures | Minimum macOS Version |
|-------------- |----------------------|-----------------------|-----------------------|
| macOS | net8.0-macos | x64, arm64 | 15.0+ |
| Mac Catalyst | net8.0-maccatalyst | x64, arm64 | 18.0+ |
| macOS | net10.0-macos | x64, arm64 | 15.0+ |
| Mac Catalyst | net10.0-maccatalyst | x64, arm64 | 18.0+ |

> **.NET 8.0 or higher is required. Native libraries are included for both macOS and Mac Catalyst.**
> **.NET 10.0 or higher is required. Native libraries are included for both macOS and Mac Catalyst.**
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-maccatalyst</TargetFramework>
<TargetFramework>net10.0-maccatalyst</TargetFramework>
<RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<!-- <TargetFrameworks>$(TargetFrameworks);net10.0-tizen</TargetFrameworks> -->

<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
Expand Down Expand Up @@ -59,7 +59,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions UsbSerialForMacOS/UsbSerialForMacOS.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-macos;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks>net10.0-macos;net10.0-maccatalyst</TargetFrameworks>
<RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down Expand Up @@ -46,8 +46,8 @@
</ItemGroup>

<ItemGroup>
<NativeReference Include="Native/build/dylib/macos/x86_64/libUsbSerialForMacOS.dylib" Kind="Dynamic" Condition="'$(TargetFramework)' == 'net8.0-macos'" />
<NativeReference Include="Native/build/dylib/maccatalyst/x86_64/libUsbSerialForMacOS.dylib" Kind="Dynamic" Condition="'$(TargetFramework)' == 'net8.0-maccatalyst'" />
<NativeReference Include="Native/build/dylib/macos/x86_64/libUsbSerialForMacOS.dylib" Kind="Dynamic" Condition="'$(TargetFramework)' == 'net10.0-macos'" />
<NativeReference Include="Native/build/dylib/maccatalyst/x86_64/libUsbSerialForMacOS.dylib" Kind="Dynamic" Condition="'$(TargetFramework)' == 'net10.0-maccatalyst'" />
</ItemGroup>

</Project>