You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
863 B
C#

9 months ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace Paho.MqttDotnet
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
struct MQTTAsync_message : IDisposable
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public char[] struct_id;
public int struct_version;
public int payloadlen;
public IntPtr payload;
public int qos;
public int retained;
public int dup;
public int msgid;
public static MQTTAsync_message Init()
{
return new MQTTAsync_message { struct_id = new[] { 'M', 'Q', 'T', 'M' } };
}
public void Dispose()
{
Marshal.FreeHGlobal(this.payload);
}
}
}