LINK.Core
2.0.1
dotnet add package LINK.Core --version 2.0.1
NuGet\Install-Package LINK.Core -Version 2.0.1
<PackageReference Include="LINK.Core" Version="2.0.1" />
<PackageVersion Include="LINK.Core" Version="2.0.1" />
<PackageReference Include="LINK.Core" />
paket add LINK.Core --version 2.0.1
#r "nuget: LINK.Core, 2.0.1"
#:package LINK.Core@2.0.1
#addin nuget:?package=LINK.Core&version=2.0.1
#tool nuget:?package=LINK.Core&version=2.0.1
LINK-Client SDK
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.
À propos du protocole LINK
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èdeAUTH).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émentationSerialPort.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
- Guide SDK complet (fonctions, modèles, découverte, sécurité, snippets) :
- Vue d'architecture globale LINK :
Licence
Projet sous licence Apache-2.0. Voir LICENSE.
| Product | Versions 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. |
-
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.