Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -3353,7 +3353,7 @@ public void OnNext(string value)
Trace.WriteLine("Works" + value);
if (value.Contains("Transfer rate")) {
serv.ExecuteMemoryLookupTableCommand();
DeviceMessage = value;
DeviceMessage = value.Replace(PreviousGuid.ToString(), ""); ;
}
}
VerisenseBLEScannedDevice DeviceToBePaired;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="Mono.Android.Export" />
<Reference Include="Plugin.BLE">
<HintPath>Libs\Plugin.BLE.dll</HintPath>
</Reference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<PackageCertificateThumbprint>613677BE1C79F9B84AD8752AABBBEE7CB94C7446</PackageCertificateThumbprint>
<PackageCertificateKeyFile />
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -167,7 +176,9 @@
<Name>MultiVerisenseExample</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="BLE.Client.UWP_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Reference Include="Plugin.BLE, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

<Identity
Name="5469730f-e7a9-4bcf-8846-446c0445b7cd"
Publisher="CN=8e67e7d8-6895-43a9-a2b2-d8a078442a02"
Version="1.0.0.0" />
Publisher="CN=ShimmerEngTesting"
Version="1.0.2.0" />

<mp:PhoneIdentity PhoneProductId="ec0cc741-fd3e-485c-81be-68815c480690" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName>MultiShimmerExample.UWP</DisplayName>
<DisplayName>MultiVerisenseExample.UWP</DisplayName>
<PublisherDisplayName>8e67e7d8-6895-43a9-a2b2-d8a078442a02</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
Expand All @@ -30,12 +30,12 @@
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="MultiShimmerExample.UWP.App">
EntryPoint="MultiVerisenseExample.UWP.App">
<uap:VisualElements
DisplayName="MultiShimmerExample.UWP"
DisplayName="MultiVerisenseExample.UWP"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="MultiShimmerExample.UWP"
Description="MultiVerisenseExample.UWP"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
<uap:ShowNameOnTiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<AssemblyName>MultiShimmerExample.iOS</AssemblyName>
<MtouchEnableSGenConc>true</MtouchEnableSGenConc>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<ProvisioningType>manual</ProvisioningType>
<ProvisioningType>automatic</ProvisioningType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -49,13 +49,12 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchArch>ARM64</MtouchArch>
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignKey></CodesignKey>
<MtouchDebug>true</MtouchDebug>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>None</MtouchLink>
<MtouchInterpreter>-all</MtouchInterpreter>
<CodesignProvision>
</CodesignProvision>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
<CheckBox IsChecked="{Binding IsSelected}"></CheckBox>
<Label Text="{Binding Uuid, StringFormat='{0}'}" FontSize="Micro" />
<Label Text="{Binding IsPaired}" Margin="50, 0, 0, 0" FontSize="Micro" />
</StackLayout>
</StackLayout>
<StackLayout Orientation="Horizontal">
<Label Text="{Binding Status}" TextColor="Blue" FontSize="Micro"/>
<Label Text="{Binding TransferSpeed}" TextColor="Blue" FontSize="Micro"/>
<Label Text="{Binding PayloadIndex}" TextColor="Blue" FontSize="Micro"/>
</StackLayout>
<Label Text="{Binding BinFilePath}" TextColor="Blue" FontSize="Micro"/>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
Expand All @@ -51,7 +51,9 @@
<Button Clicked="stopStreamingButton_Clicked" x:Name="stopStreamingButton" WidthRequest="150" HeightRequest="60" Text="Stop Streaming"></Button>
<Button Clicked="disconnectDevicesButton_Clicked" x:Name="disconnectDevicesButton" WidthRequest="150" HeightRequest="60" Text="Disconnect Devices"></Button>
<Button Clicked="syncDevicesButton_Clicked" x:Name="syncDevicesButton" WidthRequest="100" HeightRequest="60" Text="Sync Devices"></Button>
</StackLayout>
<Button Clicked="startSpeedTestButton_Clicked" x:Name="startSpeedTestButton" WidthRequest="150" HeightRequest="60" Text="Start Speed Test"></Button>
<Button Clicked="stopSpeedTestButton_Clicked" x:Name="stopSpeedTestButton" WidthRequest="150" HeightRequest="60" Text="Stop Speed Test"></Button>
</StackLayout>
</ScrollView>
</Grid>
<ScrollView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace MultiShimmerExample
{
public partial class MainPage : ContentPage
public partial class MainPage : ContentPage, IObserver<String>
{
public class DeviceInfo : INotifyPropertyChanged
{
Expand Down Expand Up @@ -50,11 +50,13 @@ private void NotifyPropertyChanged(string name)
private string _isPaired { get; set; }
public string IsPaired { get { return _isPaired; } set { _isPaired = value; NotifyPropertyChanged("IsPaired"); } }
public List<string[]> Signals { get; set; }
public SpeedTestService speedTestService { get; set; }

public DeviceInfo(string uuid)
{
Uuid = uuid;
Signals = new List<string[]>();
speedTestService = new SpeedTestService(uuid);
}
}

Expand Down Expand Up @@ -391,5 +393,87 @@ private void syncDevicesButton_Clicked(object sender, EventArgs e)
{
StartDataSync();
}

private void startSpeedTestButton_Clicked(object sender, EventArgs e)
{
StartSpeedTest();
}
private void stopSpeedTestButton_Clicked(object sender, EventArgs e)
{
StopSpeedTest();
}
public async void StartSpeedTest()
{
foreach (VerisenseBLEDevice device in ConnectedDevices.Values)
{
if (GetDeviceInfoFromUUID(device.Asm_uuid.ToString()).IsSelected)
{

GetDeviceInfoFromUUID(device.Asm_uuid.ToString()).speedTestService.Subscribe(this);
await GetDeviceInfoFromUUID(device.Asm_uuid.ToString()).speedTestService.GetKnownDevice();
if (GetDeviceInfoFromUUID(device.Asm_uuid.ToString()).speedTestService.ConnectedASM != null)
{
System.Console.WriteLine("Memory Lookup Execution");
await GetDeviceInfoFromUUID(device.Asm_uuid.ToString()).speedTestService.ExecuteMemoryLookupTableCommand();
}
else
{
System.Console.WriteLine("Connect Fail");
}
}
}
}
public async void StopSpeedTest()
{
foreach (VerisenseBLEDevice device in ConnectedDevices.Values)
{
if (GetDeviceInfoFromUUID(device.Asm_uuid.ToString()).IsSelected)
{

if (GetDeviceInfoFromUUID(device.Asm_uuid.ToString()).speedTestService != null)
{
DeviceInfo deviceInfo = GetDeviceInfoFromUUID(device.Asm_uuid.ToString());
if (deviceInfo != null)
{
deviceInfo.TransferSpeed = "";
}
GetDeviceInfoFromUUID(device.Asm_uuid.ToString()).speedTestService.Disconnect();

}
}
}
}

public void OnCompleted()
{
throw new NotImplementedException();
}

public void OnError(Exception error)
{
throw new NotImplementedException();
}

public void OnNext(string value)
{

Trace.WriteLine("Works" + value);
if (value.Contains("Transfer rate"))
{
foreach (VerisenseBLEDevice device in ConnectedDevices.Values)
{
if (value.Contains(device.Asm_uuid.ToString()))
{
DeviceInfo deviceInfo = GetDeviceInfoFromUUID(device.Asm_uuid.ToString());
if (deviceInfo != null)
{
deviceInfo.TransferSpeed = value.Replace(device.Asm_uuid.ToString(), "");
}
GetDeviceInfoFromUUID(device.Asm_uuid.ToString()).speedTestService.ExecuteMemoryLookupTableCommand();
}
}

}
}
}
}
2 changes: 1 addition & 1 deletion ShimmerBLE/ShimmerBLEAPI/Services/SpeedTestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void HandleMemoryLookupDataPayload(byte[] payload)
Trace.Message("Transfer rate in KB/s: " + DataBuffer.Transfer);
Console.WriteLine("Transfer rate = {0} KB/s", DataBuffer.Transfer);
foreach (var observer in observers)
observer.OnNext("Transfer rate in KB/s: " + DataBuffer.Transfer);
observer.OnNext("Transfer rate in KB/s: " + DataBuffer.Transfer + " " + Asm_uuid);
HandleMemoryContent(DataBuffer.Packets);
SpeedinKBS = DataBuffer.Transfer;

Expand Down