Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Universal Windows Platform and Async / SSL features #49

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 38 additions & 27 deletions M2Mqtt.sln
Original file line number Diff line number Diff line change
@@ -1,48 +1,59 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2009
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2Mqtt.Net", "M2Mqtt\M2Mqtt.Net.csproj", "{A11AEF5A-B246-4FE8-8330-06DB73CC8074}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2Mqtt.NetCf39", "M2Mqtt\M2Mqtt.NetCf39.csproj", "{BB9B7FF4-6502-41AF-8851-5060B67645E8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2Mqtt.NetMf42", "M2Mqtt\M2Mqtt.NetMf42.csproj", "{F733523A-F14E-4F5A-9E7C-085CA80F52B1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2Mqtt.NetMf43", "M2Mqtt\M2Mqtt.NetMf43.csproj", "{6A6D540B-8554-4FFD-8884-8BEFCCD9AD41}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2Mqtt.WinRT", "M2Mqtt\M2Mqtt.WinRT.csproj", "{0238F0E3-A02B-428D-8A3F-410D8F15BB50}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "M2Mqtt.Universal", "M2Mqtt\M2Mqtt.Universal.csproj", "{7E4BD745-3633-44FE-B4DD-40F3350D66D2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|ARM.ActiveCfg = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|ARM.Build.0 = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|x64.ActiveCfg = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|x64.Build.0 = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|x86.ActiveCfg = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Debug|x86.Build.0 = Debug|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|Any CPU.Build.0 = Release|Any CPU
{BB9B7FF4-6502-41AF-8851-5060B67645E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB9B7FF4-6502-41AF-8851-5060B67645E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB9B7FF4-6502-41AF-8851-5060B67645E8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{BB9B7FF4-6502-41AF-8851-5060B67645E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB9B7FF4-6502-41AF-8851-5060B67645E8}.Release|Any CPU.Build.0 = Release|Any CPU
{BB9B7FF4-6502-41AF-8851-5060B67645E8}.Release|Any CPU.Deploy.0 = Release|Any CPU
{F733523A-F14E-4F5A-9E7C-085CA80F52B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F733523A-F14E-4F5A-9E7C-085CA80F52B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F733523A-F14E-4F5A-9E7C-085CA80F52B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F733523A-F14E-4F5A-9E7C-085CA80F52B1}.Release|Any CPU.Build.0 = Release|Any CPU
{6A6D540B-8554-4FFD-8884-8BEFCCD9AD41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6A6D540B-8554-4FFD-8884-8BEFCCD9AD41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6A6D540B-8554-4FFD-8884-8BEFCCD9AD41}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6A6D540B-8554-4FFD-8884-8BEFCCD9AD41}.Release|Any CPU.Build.0 = Release|Any CPU
{0238F0E3-A02B-428D-8A3F-410D8F15BB50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0238F0E3-A02B-428D-8A3F-410D8F15BB50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0238F0E3-A02B-428D-8A3F-410D8F15BB50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0238F0E3-A02B-428D-8A3F-410D8F15BB50}.Release|Any CPU.Build.0 = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|ARM.ActiveCfg = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|ARM.Build.0 = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|x64.ActiveCfg = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|x64.Build.0 = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|x86.ActiveCfg = Release|Any CPU
{A11AEF5A-B246-4FE8-8330-06DB73CC8074}.Release|x86.Build.0 = Release|Any CPU
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Debug|Any CPU.ActiveCfg = Debug|x86
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Debug|ARM.ActiveCfg = Debug|ARM
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Debug|ARM.Build.0 = Debug|ARM
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Debug|x64.ActiveCfg = Debug|x64
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Debug|x64.Build.0 = Debug|x64
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Debug|x86.ActiveCfg = Debug|x86
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Debug|x86.Build.0 = Debug|x86
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Release|Any CPU.ActiveCfg = Release|x86
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Release|ARM.ActiveCfg = Release|ARM
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Release|ARM.Build.0 = Release|ARM
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Release|x64.ActiveCfg = Release|x64
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Release|x64.Build.0 = Release|x64
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Release|x86.ActiveCfg = Release|x86
{7E4BD745-3633-44FE-B4DD-40F3350D66D2}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B0CADC1E-0867-4C86-A1E6-1D3FABF29ACA}
EndGlobalSection
EndGlobal
12 changes: 10 additions & 2 deletions M2Mqtt/IMqttNetworkChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public interface IMqttNetworkChannel
/// <returns>Number of byte sent</returns>
int Send(byte[] buffer);

#if WINDOWS_UWP
System.Threading.Tasks.Task<int> SendAsync(byte[] buffer);
#endif

/// <summary>
/// Close the network channel
/// </summary>
Expand All @@ -60,10 +64,14 @@ public interface IMqttNetworkChannel
/// Connect to remote server
/// </summary>
void Connect();

/// <summary>
/// Accept client connection
/// </summary>
void Accept();

#if WINDOWS_UWP
System.Threading.Tasks.Task ConnectAsync();
#endif
}
}
}
154 changes: 154 additions & 0 deletions M2Mqtt/M2Mqtt.Universal.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{7E4BD745-3633-44FE-B4DD-40F3350D66D2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>uPLibrary.Networking.M2Mqtt</RootNamespace>
<AssemblyName>M2Mqtt.Universal</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.15063.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\bin\x86\Debug\M2Mqtt.Universal\</OutputPath>
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;WINDOWS_APP;SSL</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>..\bin\x86\Release\M2Mqtt.Universal\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;WINDOWS_APP;SSL</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\bin\ARM\Debug\M2Mqtt.Universal\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP;WINDOWS_APP;SSL</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<OutputPath>..\bin\ARM\Release\M2Mqtt.Universal\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;WINDOWS_APP;SSL</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\bin\x64\Debug\M2Mqtt.Universal\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP;WINDOWS_APP;SSL</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>..\bin\x64\Release\M2Mqtt.Universal\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;WINDOWS_APP;SSL</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\M2Mqtt.Universal.rd.xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Exceptions\MqttClientException.cs" />
<Compile Include="Exceptions\MqttCommunicationException.cs" />
<Compile Include="Exceptions\MqttConnectionException.cs" />
<Compile Include="Exceptions\MqttTimeoutException.cs" />
<Compile Include="IMqttNetworkChannel.cs" />
<Compile Include="Internal\InternalEvent.cs" />
<Compile Include="Internal\MsgInternalEvent.cs" />
<Compile Include="Internal\MsgPublishedInternalEvent.cs" />
<Compile Include="Messages\MqttMsgBase.cs" />
<Compile Include="Messages\MqttMsgConnack.cs" />
<Compile Include="Messages\MqttMsgConnect.cs" />
<Compile Include="Messages\MqttMsgConnectEventArgs.cs" />
<Compile Include="Messages\MqttMsgContext.cs" />
<Compile Include="Messages\MqttMsgDisconnect.cs" />
<Compile Include="Messages\MqttMsgPingReq.cs" />
<Compile Include="Messages\MqttMsgPingResp.cs" />
<Compile Include="Messages\MqttMsgPuback.cs" />
<Compile Include="Messages\MqttMsgPubcomp.cs" />
<Compile Include="Messages\MqttMsgPublish.cs" />
<Compile Include="Messages\MqttMsgPublishedEventArgs.cs" />
<Compile Include="Messages\MqttMsgPublishEventArgs.cs" />
<Compile Include="Messages\MqttMsgPubrec.cs" />
<Compile Include="Messages\MqttMsgPubrel.cs" />
<Compile Include="Messages\MqttMsgSuback.cs" />
<Compile Include="Messages\MqttMsgSubscribe.cs" />
<Compile Include="Messages\MqttMsgSubscribedEventArgs.cs" />
<Compile Include="Messages\MqttMsgSubscribeEventArgs.cs" />
<Compile Include="Messages\MqttMsgUnsuback.cs" />
<Compile Include="Messages\MqttMsgUnsubscribe.cs" />
<Compile Include="Messages\MqttMsgUnsubscribedEventArgs.cs" />
<Compile Include="Messages\MqttMsgUnsubscribeEventArgs.cs" />
<Compile Include="MqttClient.cs" />
<Compile Include="MqttSecurity.cs" />
<Compile Include="MqttSettings.cs" />
<Compile Include="Session\MqttBrokerSession.cs" />
<Compile Include="Session\MqttClientSession.cs" />
<Compile Include="Session\MqttSession.cs" />
<Compile Include="Utility\QueueExtension.cs" />
<Compile Include="Utility\Trace.cs" />
<Compile Include="WinRT\Fx.cs" />
<Compile Include="WinRT\MqttNetworkChannel.cs" />
<Compile Include="WinRT\Hashtable.cs" />
<Compile Include="WinRT\Queue.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>5.4.0</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading