LINK.Core 2.0.1

dotnet add package LINK.Core --version 2.0.1
                    
NuGet\Install-Package LINK.Core -Version 2.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LINK.Core" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LINK.Core" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="LINK.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LINK.Core --version 2.0.1
                    
#r "nuget: LINK.Core, 2.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LINK.Core@2.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LINK.Core&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=LINK.Core&version=2.0.1
                    
Install as a Cake Tool

SDK .NET pour communiquer avec des appareils compatibles LINK (USB/Serial), envoyer des commandes, récupérer les informations de l'appareil et gérer l'authentification/chiffrement au niveau client.

Le protocole suit un format de trame texte terminé par \0 :

  • Trame standard : LINK\x1f[APP-ID]\x1f[COMMAND]\x1f[ARGS_0]\x1f...\x1f[ARGS_n]\0
  • Trame de découverte d'application : LINK\x1fGETAPP\0

Commandes standard côté protocole :

  • GETAPP : récupère l'identifiant applicatif (APP-ID).
  • GETV : récupère la version/informations du device.
  • RETURN : réponse d'un appareil à une commande.
  • AUTH : authentification par hash avec échange de nonces (challenge-response).
  • AUTH_INIT : échange de nonces aléatoires entre client et device (précède AUTH).
  • CHPWD : changement de mot de passe (CHPWD\x1f<OLD_HASH>\x1f<NEW_HASH>\x1f<CRC32>) — réponses : OK, ERR\x1fBAD_OLD_PWD, ERR\x1fBAD_CRC.

Contenu du repository

  • src/LINK.Core : structures de trames, parsing, contrats de transport.
  • src/LINK.Transport.Serial : implémentation SerialPort.
  • src/LINK.Transport.Tcp : implémentation TCP client (simulateur, tests locaux).
  • src/LINK.Client : API haut niveau (send/receive, extensions, découverte).
  • examples/ : exemples console, WPF, WinUI.
  • tests/ : tests unitaires.

Installation via NuGet

Installez les packages depuis NuGet.org :

# Package principal (inclut Core + Transport Serial)
dotnet add package LINK.Client

# Ou installez les composants individuellement
dotnet add package LINK.Core
dotnet add package LINK.Transport.Serial
dotnet add package LINK.Transport.Tcp

Ou via le Package Manager :

Install-Package LINK.Client

Démarrage rapide

1a) Transport série (appareil réel ou COM virtuel)

using Link.Transport.Serial;

var transport = new LinkSerialTransport(new LinkSerialOptions
{
    PortName = "COM3",
    BaudRate = 115200
});

1b) Transport TCP (simulateur Python ou appareil réseau)

Le transport TCP est utile pour tester sans appareil physique et sans pont COM virtuel — notamment avec le simulateur Python inclus dans le repository.

using Link.Transport.Tcp;

var transport = new LinkTcpTransport(new LinkTcpOptions
{
    Host = "127.0.0.1",
    Port = 5000
});

2) Créer et connecter le client

using Link.Client;

var client = new LinkClient(new LinkClientOptions
{
    Transport = transport,
    CommandTimeout = TimeSpan.FromSeconds(2)
});

await client.ConnectAsync();

3) Travailler avec un APP-ID

using Link.Client.Extensions;

var dragon = client.WithAppId("DRAGON");
var info = await dragon.GetDeviceInfoAsync();
var frame = await dragon.SendAsync("GETTEMP");

Simulateur Python TCP

Pour tester localement sans appareil matériel ni port COM virtuel, lancez le simulateur inclus dans examples/LINK.Device.Simulator/ :

python examples/LINK.Device.Simulator/link_tcp_simulator.py
# démarre sur 127.0.0.1:5000 par défaut

# options :
python examples/LINK.Device.Simulator/link_tcp_simulator.py \
    --host 0.0.0.0 --port 5000 \
    --app-id DRAGON --password password --temp 24.6

Puis lancez l'exemple TCP dédié :

dotnet run --project examples/LINK.Example.Console.Tcp

Ou l'exemple de base en mode TCP :

dotnet run --project examples/LINK.Example.Console.Basic -- --tcp
dotnet run --project examples/LINK.Example.Console.Basic -- --tcp 192.168.1.10 9000

Pourquoi TCP ? Les ports COM virtuels Windows (com0com, etc.) sont souvent fragiles et dépendants du matériel. Le transport TCP fonctionne partout (Windows, Linux, macOS) et ne nécessite aucun driver supplémentaire.

Générer les projets d'exemple

Build avec :

dotnet build <path to the .csproj exemple file>

Lancer avec :

dotnet run --project <path to the .csproj exemple file>

Documentation

Licence

Projet sous licence Apache-2.0. Voir LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on LINK.Core:

Package Downloads
LINK.Transport.Serial

Transport série (SerialPort) pour le SDK LINK. Permet la communication avec des appareils LINK via port COM / USB.

LINK.Transport.Tcp

Transport TCP pour le SDK LINK. Permet la communication avec des appareils LINK via réseau TCP, idéal pour les simulateurs et tests.

LINK.Client

Le package LINK est un ensemble qui permet de communiquer facilement et incorpore la découverte automatique et performante des devices LINK compatibles. Le code source et des exemples sont disponible à : https://github.com/LOGDrakon/LINK-Client

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 153 3/25/2026
2.0.0 149 3/25/2026
1.1.1 146 3/25/2026
1.1.0 142 3/25/2026
1.0.0 153 3/18/2026