Remove test folder

This commit is contained in:
Reimar 2025-04-08 14:14:40 +02:00
parent 72a809f7ae
commit 2e5334001f
Signed by: Reimar
GPG Key ID: 93549FA07F0AE268
2 changed files with 0 additions and 50 deletions

View File

@ -1,36 +0,0 @@
using MQTTnet;
var mqttFactory = new MqttClientFactory();
IMqttClient mqttClient;
using (mqttClient = mqttFactory.CreateMqttClient())
{
var mqttClientOptions = new MqttClientOptionsBuilder()
.WithTcpServer($"10.135.51.116", 1883)
.WithCredentials($"h5", $"Merc1234")
.WithCleanSession()
.Build();
// Setup message handling before connecting so that queued messages
// are also handled properly. When there is no event handler attached all
// received messages get lost.
mqttClient.ApplicationMessageReceivedAsync += e =>
{
Console.WriteLine("Received application message.");
return Task.CompletedTask;
};
await mqttClient.ConnectAsync(mqttClientOptions, CancellationToken.None);
Console.WriteLine("mqttClient");
//var mqttSubscribeOptions = mqttFactory.CreateSubscribeOptionsBuilder().WithTopicTemplate(topic).Build();
await mqttClient.SubscribeAsync("temperature");
Console.WriteLine("MQTT client subscribed to topic.");
Console.WriteLine("Press enter to exit.");
Console.ReadLine();
}

View File

@ -1,14 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MQTTnet" Version="5.0.1.1416" />
</ItemGroup>
</Project>