Skip to content

Commit

Permalink
updated dependencies. Expose Win32 BluetoothRadio properties
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfoot committed Apr 22, 2021
1 parent 44795bd commit fe8c762
Show file tree
Hide file tree
Showing 35 changed files with 988 additions and 467 deletions.
233 changes: 114 additions & 119 deletions 32feet.sln

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions InTheHand.BluetoothLE/InTheHand.BluetoothLE.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras/2.1.2">
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;monoandroid81;xamarin.ios10;xamarin.tvos10;xamarin.watchos10;xamarin.mac20;uap10.0;netcoreapp3.1;net461</TargetFrameworks>
Expand Down Expand Up @@ -38,7 +38,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="MSBuild.Sdk.Extras" Version="2.1.2" PrivateAssets="All" />
<PackageReference Include="MSBuild.Sdk.Extras" Version="3.0.23" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -74,7 +74,7 @@
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'monoandroid81' ">
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,14 @@ private async Task PlatformStartNotifications()
else
return;

var result = await _characteristic.WriteClientCharacteristicConfigurationDescriptorAsync(value);

try
{
var result = await _characteristic.WriteClientCharacteristicConfigurationDescriptorAsync(value);
}
catch(UnauthorizedAccessException ex)
{
// not supported
}
return;
}

Expand Down
6 changes: 3 additions & 3 deletions InTheHand.Net.Bluetooth/InTheHand.Net.Bluetooth.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras/2.1.2">
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net461;monoandroid90;Xamarin.iOS10;uap10.0</TargetFrameworks>
Expand Down Expand Up @@ -36,7 +36,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="MSBuild.Sdk.Extras" Version="2.1.2" PrivateAssets="All" />
<PackageReference Include="MSBuild.Sdk.Extras" Version="3.0.23" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Platforms\**\*.*" />
Expand Down Expand Up @@ -75,7 +75,7 @@
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'monoandroid90' ">
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
Expand Down
26 changes: 24 additions & 2 deletions InTheHand.Net.Bluetooth/Platforms/Win32/BluetoothRadio.win32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// InTheHand.Net.Bluetooth.BluetoothRadio (Win32)
//
// Copyright (c) 2003-2020 In The Hand Ltd, All rights reserved.
// Copyright (c) 2003-2021 In The Hand Ltd, All rights reserved.
// This source code is licensed under the MIT License

using InTheHand.Net.Bluetooth.Win32;
Expand Down Expand Up @@ -105,6 +105,28 @@ private void SetMode(RadioMode value)
}
}

/// <summary>
/// Manufacturer's revision number of the LMP implementation.
/// </summary>
public int LmpSubversion
{
get
{
return _radio.lmpSubversion;
}
}

/// <summary>
/// Returns the manufacturer of the BluetoothRadio device.
/// </summary>
public ushort Manufacturer
{
get
{
return _radio.manufacturer;
}
}

#region IDisposable Support
private bool disposedValue = false; // To detect redundant calls

Expand All @@ -128,4 +150,4 @@ void Dispose(bool disposing)

#endregion
}
}
}
1 change: 0 additions & 1 deletion InTheHand.Net.IrDA/IrDAClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ public void Connect(IrDAEndPoint remoteEP)
/// <exception cref="T:System.Net.Sockets.SocketException">
/// A connection could not be formed. See the exception message or
/// <see cref="P:System.Net.Sockets.SocketException.SocketErrorCode"/>
/// (or <see cref="P:System.Net.Sockets.SocketException.ErrorCode"/> on NETCF)
/// for what error occurred.
/// </exception>
public void Connect(string service)
Expand Down
2 changes: 1 addition & 1 deletion InTheHand.Net.Obex/InTheHand.Net.Obex.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="InTheHand.Net.Bluetooth" Version="4.0.12" />
<PackageReference Include="InTheHand.Net.Bluetooth" Version="4.0.15" />
<PackageReference Include="InTheHand.Net.IrDA" Version="4.0.1" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions InTheHand.Nfc/InTheHand.Nfc.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras/2.1.2">
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;uap10.0;monoandroid90;Xamarin.iOS10</TargetFrameworks>
Expand All @@ -12,7 +12,7 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageProjectUrl>https://github.com/inthehand/32feet</PackageProjectUrl>
<Copyright>Copyright (c) 2020 In The Hand Ltd</Copyright>
<Copyright>Copyright (c) 2020-21 In The Hand Ltd</Copyright>
<Description>32feet.NET is an open-source project to make personal area networking technologies such as Bluetooth easily accessible from .NET code.</Description>
<FileVersion>1.0.1.908</FileVersion>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
Expand All @@ -30,11 +30,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="MSBuild.Sdk.Extras" Version="2.1.2" PrivateAssets="All" />
<PackageReference Include="MSBuild.Sdk.Extras" Version="3.0.23" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'monoandroid90'">
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
17 changes: 16 additions & 1 deletion Samples/BluetoothClassicConsole/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -17,14 +18,28 @@ static void Main(string[] args)
BluetoothDeviceInfo device = null;
foreach(var dev in client.DiscoverDevices())
{
if(dev.DeviceName.Contains("RequiredName"))
if(dev.DeviceName.Contains("PREFIX"))
{
device = dev;
break;
}
}

if (!device.Authenticated)
{
BluetoothSecurity.PairRequest(device.DeviceAddress, "1234");
}

device.Refresh();
System.Diagnostics.Debug.WriteLine(device.Authenticated);

client.Connect(device.DeviceAddress, BluetoothService.SerialPort);

var stream = client.GetStream();
StreamWriter sw = new StreamWriter(stream, System.Text.Encoding.ASCII);
sw.WriteLine("Hello world!\r\n\r\n");
sw.Close();

client.Close();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.6.0.1141" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down
12 changes: 9 additions & 3 deletions Samples/NfcReaderApp/NfcReaderApp.UWP/NfcReaderApp.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,22 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.6.0.1141" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.9"/>
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.9" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NfcReaderApp\NfcReaderApp.csproj">
<Project>{A9CCD2EB-AA98-4BF8-9004-E7C541331BDA}</Project>
<Name>NfcReaderApp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="InTheHand.Nfc, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\InTheHand.Nfc\bin\Debug\uap10.0\InTheHand.Nfc.dll</HintPath>
</Reference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions Samples/NfcReaderApp/NfcReaderApp.UWP/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@

<Capabilities>
<Capability Name="internetClient" />
<DeviceCapability Name="proximity"/>
</Capabilities>
</Package>
4 changes: 2 additions & 2 deletions Samples/NfcReaderApp/NfcReaderApp.iOS/NfcReaderApp.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.6.0.1141" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/NfcReaderApp/NfcReaderApp/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private async void Button_Clicked(object sender, EventArgs e)
options.Signal = cts.Token;
await reader.ScanAsync(options);

cts.CancelAfter(30000);
//cts.CancelAfter(30000);
}
}
}
4 changes: 2 additions & 2 deletions Samples/NfcReaderApp/NfcReaderApp/NfcReaderApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.6.0.1141" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RfcommXamarinForms.Android")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyCopyright("Copyright © In The Hand Ltd 2014-21")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
Expand Down
Loading

0 comments on commit fe8c762

Please sign in to comment.