Skip to content
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.

chore: Updating dependencies and platform support #1

Open
wants to merge 1 commit 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
3 changes: 2 additions & 1 deletion ButtplugXamarinExamples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleConnect.Android", "Si
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleConnect.iOS", "SimpleConnect\SimpleConnect.iOS\SimpleConnect.iOS.csproj", "{C85CE98E-A086-4811-AF28-87D4ADD28E8F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleConnect", "SimpleConnect\SimpleConnect\SimpleConnect.csproj", "{390184FC-AFF0-418B-815C-6E0C6311CF0A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleConnect", "SimpleConnect\SimpleConnect\SimpleConnect.csproj", "{390184FC-AFF0-418B-815C-6E0C6311CF0A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SimpleConnect Project", "SimpleConnect Project", "{B410630E-182A-4479-8AC3-5F11876B37B7}"
EndProject
Expand Down Expand Up @@ -93,6 +93,7 @@ Global
{C85CE98E-A086-4811-AF28-87D4ADD28E8F}.Debug|ARM.ActiveCfg = Debug|iPhone
{C85CE98E-A086-4811-AF28-87D4ADD28E8F}.Debug|iPhone.ActiveCfg = Debug|iPhone
{C85CE98E-A086-4811-AF28-87D4ADD28E8F}.Debug|iPhone.Build.0 = Debug|iPhone
{C85CE98E-A086-4811-AF28-87D4ADD28E8F}.Debug|iPhone.Deploy.0 = Debug|iPhone
{C85CE98E-A086-4811-AF28-87D4ADD28E8F}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{C85CE98E-A086-4811-AF28-87D4ADD28E8F}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{C85CE98E-A086-4811-AF28-87D4ADD28E8F}.Debug|x64.ActiveCfg = Debug|iPhone
Expand Down
14,529 changes: 8,584 additions & 5,945 deletions SimpleConnect/SimpleConnect.Android/Resources/Resource.designer.cs

Large diffs are not rendered by default.

26 changes: 17 additions & 9 deletions SimpleConnect/SimpleConnect.Android/SimpleConnect.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<BundleAssemblies>false</BundleAssemblies>
<MandroidI18n />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -52,15 +57,18 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.0.0.540366" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
<PackageReference Include="Microsoft.CSharp">
<Version>4.7.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down
2 changes: 2 additions & 0 deletions SimpleConnect/SimpleConnect.UWP/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@

<Capabilities>
<Capability Name="internetClient" />
<DeviceCapability Name="bluetooth"/>
<DeviceCapability Name="location"/>
</Capabilities>
</Package>
14 changes: 10 additions & 4 deletions SimpleConnect/SimpleConnect.UWP/SimpleConnect.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AssemblyName>SimpleConnect.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
Expand Down Expand Up @@ -143,9 +143,15 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.0.0.540366" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.8" />
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Connectivity">
<Version>6.1.0</Version>
</PackageReference>
<PackageReference Include="Plugin.BLE">
<Version>2.2.0-pre2</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.10" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SimpleConnect\SimpleConnect.csproj">
Expand Down
4 changes: 4 additions & 0 deletions SimpleConnect/SimpleConnect.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@
<string>SimpleConnect</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Bluetooth access required for hardware control</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Bluetooth access required for hardware control</string>
</dict>
</plist>
13 changes: 11 additions & 2 deletions SimpleConnect/SimpleConnect.iOS/SimpleConnect.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchFloat32>true</MtouchFloat32>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
Expand All @@ -63,6 +64,9 @@
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
<AppExtensionDebugBundleId />
</PropertyGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
Expand Down Expand Up @@ -124,8 +128,8 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.0.0.540366" />
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
Expand All @@ -134,4 +138,9 @@
<Name>SimpleConnect</Name>
</ProjectReference>
</ItemGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties XamarinHotReloadWrongLinkerErrorInfoBarSimpleConnectiOSHideInfoBar="True" />
</VisualStudio>
</ProjectExtensions>
</Project>
38 changes: 34 additions & 4 deletions SimpleConnect/SimpleConnect/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Xamarin.Essentials;
using Xamarin.Forms;

namespace SimpleConnect
Expand Down Expand Up @@ -37,7 +38,7 @@ public MainPage()
async void HandleDeviceAdded(object aObj, DeviceAddedEventArgs aArgs)
{
_device = aArgs.Device;
Debug.WriteLine($"Found device ${_device.Name}");
Debug.WriteLine($"Found device {_device.Name}");
await _client.StopScanningAsync();
Device.BeginInvokeOnMainThread(() =>
{
Expand All @@ -53,7 +54,7 @@ void HandleDeviceRemoved(object aObj, DeviceRemovedEventArgs aArgs)
btnVibrate.IsEnabled = false;
});

Console.WriteLine($"Device connected: {aArgs.Device.Name}");
Debug.WriteLine($"Device connected: {aArgs.Device.Name}");
}

private void Button_Clicked(object sender, EventArgs e)
Expand All @@ -63,8 +64,37 @@ private void Button_Clicked(object sender, EventArgs e)

async Task ScanForDevices()
{
Console.WriteLine("Scanning for devices until key is pressed. Found devices will be printed to console.");
await _client.StartScanningAsync();
try
{
// Android likes to prompt on use
// UWP does seem to care
// iOS prompts on app start
if (Device.RuntimePlatform == "Android")
{
var status = await Device.InvokeOnMainThreadAsync(async () =>
await Permissions.CheckStatusAsync<Permissions.LocationWhenInUse>());
if (status != PermissionStatus.Granted)
{
status = await Device.InvokeOnMainThreadAsync(async () =>
await Permissions.RequestAsync<Permissions.LocationWhenInUse>());
}
if (status != PermissionStatus.Granted)
{
Debug.WriteLine("Cannot scan for devices without Location permissions.");
return;
}
}

Debug.WriteLine(
"Scanning for devices until key is pressed. Found devices will be printed to console.");
await _client.StartScanningAsync();
}
catch (PermissionException pe)
{
// If we set up the manifest wrong, UWP throws
Debug.WriteLine(pe.Message);
}

}

private async void Vibrate_Clicked(object sender, EventArgs e)
Expand Down
10 changes: 6 additions & 4 deletions SimpleConnect/SimpleConnect/SimpleConnect.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Buttplug" Version="0.4.7" />
<PackageReference Include="Buttplug.Server.Managers.XamarinBluetoothManager" Version="0.4.7" />
<PackageReference Include="Xamarin.Forms" Version="4.0.0.540366" />
<PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
<PackageReference Include="Buttplug" Version="0.5.9" />
<PackageReference Include="Buttplug.Server.Managers.XamarinBluetoothManager" Version="0.5.9" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
</ItemGroup>
</Project>