diff --git a/Source/MQTTnet/Client/Receiving/MqttApplicationMessageReceivedEventArgs.cs b/Source/MQTTnet/Client/Receiving/MqttApplicationMessageReceivedEventArgs.cs index c288ab26..4bf1c17c 100644 --- a/Source/MQTTnet/Client/Receiving/MqttApplicationMessageReceivedEventArgs.cs +++ b/Source/MQTTnet/Client/Receiving/MqttApplicationMessageReceivedEventArgs.cs @@ -25,6 +25,7 @@ namespace MQTTnet.Client ClientId = clientId; ApplicationMessage = applicationMessage ?? throw new ArgumentNullException(nameof(applicationMessage)); PublishPacket = publishPacket; + PacketIdentifier = publishPacket.PacketIdentifier; _acknowledgeHandler = acknowledgeHandler; } @@ -62,12 +63,17 @@ namespace MQTTnet.Client public bool IsHandled { get; set; } /// - /// Gets ir sets whether the library should send MQTT ACK packets automatically if required. + /// Gets or sets whether the library should send MQTT ACK packets automatically if required. /// public bool AutoAcknowledge { get; set; } = true; public object Tag { get; set; } - + + /// + /// Gets the indentifier of MQTT packet + /// + public ushort PacketIdentifier { get; } + public Task AcknowledgeAsync(CancellationToken cancellationToken) { if (_acknowledgeHandler == null)