await _mqttClient.Subscribe( subscription, OnReceived );
private async Task OnReceived(
IMqttClient sender,
MqttDelivery mqttDelivery )
{
var subTopic = mqttDelivery.Topic.Split( '/' );
var addResult = TreeRoot.Add( subTopic );
if(!addResult)
{
// do smth
}
}
public bool Add( string[] subTopic )
=> Add( subTopic, Level + 1);
await _mqttClient.Subscribe( subscription, OnReceived );
private async Task OnReceived(
IMqttClient sender,
MqttDelivery mqttDelivery )
{
var subTopic = mqttDelivery.Topic.Split( '/' );
var addResult = TreeRoot.Add( subTopic );
if(!addResult)
{
// do smth
}
}
public bool Add( string[] subTopic )
=> Add( subTopic, Level + 1);