Skip to content

Commit

Permalink
Merge pull request #9 from cslrfid/release-2.0.13
Browse files Browse the repository at this point in the history
RFMicron Temperature Tag Functions
  • Loading branch information
ksclam authored Feb 27, 2019
2 parents 7f09ec9 + 2930d7d commit b26a121
Show file tree
Hide file tree
Showing 21 changed files with 1,507 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<AndroidTlsProvider>
</AndroidTlsProvider>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AndroidLinkSkip></AndroidLinkSkip>
<AndroidLinkSkip>
</AndroidLinkSkip>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
Expand All @@ -43,6 +44,9 @@
<Debugger>Xamarin</Debugger>
<AndroidTlsProvider>btls</AndroidTlsProvider>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<BundleAssemblies>false</BundleAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -57,6 +61,9 @@
<JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
<Debugger>Xamarin</Debugger>
<DebugSymbols>False</DebugSymbols>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<BundleAssemblies>false</BundleAssemblies>
</PropertyGroup>
<ItemGroup>
<Reference Include="FormsViewGroup, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="csl.cs108fulldemo.demo" android:installLocation="auto" android:versionCode="152" android:versionName="2.0.12">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="csl.cs108fulldemo.demo" android:installLocation="auto" android:versionCode="158" android:versionName="2.0.13">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="26" />
<application android:label="CS108 C# Demo" android:icon="@drawable/icon" android:theme="@style/MyTheme"></application>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Expand Down
4 changes: 2 additions & 2 deletions CS108 Demo/Source/BLE.Client/BLE.Client.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>CFBundleShortVersionString</key>
<string>2.0.12</string>
<string>2.0.13</string>
<key>NSCalendarsUsageDescription</key>
<string>Only for testing, we don&apos;t need the data to do anything</string>
<key>UIApplicationExitsOnSuspend</key>
Expand Down Expand Up @@ -54,6 +54,6 @@
<true/>
</dict>
<key>CFBundleVersion</key>
<string>152</string>
<string>158</string>
</dict>
</plist>
20 changes: 20 additions & 0 deletions CS108 Demo/Source/BLE.Client/BLE.Client/BLE.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
<Compile Include="Pages\PageFilter.xaml.cs">
<DependentUpon>PageFilter.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\PageRFMicroReadTemp.xaml.cs">
<DependentUpon>PageRFMicroReadTemp.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\PageRFMicronInventory.xaml.cs">
<DependentUpon>PageRFMicronInventory.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\PagePeriodicRead.xaml.cs">
<DependentUpon>PagePeriodicRead.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -113,11 +119,13 @@
</Compile>
<Compile Include="ViewModels\ViewModelFilter.cs" />
<Compile Include="ViewModels\ViewModelGeiger.cs" />
<Compile Include="ViewModels\ViewModelRFMicroInventory.cs" />
<Compile Include="ViewModels\ViewModelPeriodicRead.cs" />
<Compile Include="ViewModels\ViewModelPhaseChannelInventory.cs" />
<Compile Include="ViewModels\ViewModelMultiBankInventory.cs" />
<Compile Include="ViewModels\ViewModelInventorynScan.cs" />
<Compile Include="ViewModels\ViewModelMainMenu.cs" />
<Compile Include="ViewModels\ViewModelRFMicroReadTemp.cs" />
<Compile Include="ViewModels\ViewModelUCODEDNA.cs" />
<Compile Include="ViewModels\ViewModelReadWrite.cs" />
<Compile Include="ViewModels\ViewModelSecurity.cs" />
Expand Down Expand Up @@ -365,6 +373,18 @@
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\PageRFMicronInventory.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\PageRFMicroReadTemp.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="..\..\packages\Xamarin.Forms.2.3.1.114\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.1.114\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<Import Project="..\..\packages\Xamarin.Forms.2.3.4.247\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.3.4.247\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8" ?>
<pages:BasePage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:pages="clr-namespace:BLE.Client.Pages;assembly=BLE.Client"
x:Class="BLE.Client.Pages.PageRFMicroReadTemp"
Title="RFMicro Read Temp">

<ScrollView>
<StackLayout Padding="5, 3, 5, 0">

<StackLayout Orientation="Horizontal">
<Label Text="Selected EPC" WidthRequest="70" />
<Editor Text="{ Binding entrySelectedEPC, Mode=TwoWay }" HorizontalOptions="FillAndExpand" />
</StackLayout>

<StackLayout Orientation="Horizontal">
<Label Text="Access PWD" WidthRequest="70" />
<Entry Text="{ Binding entrySelectedPWD, Mode=TwoWay }" HorizontalOptions="FillAndExpand" />
</StackLayout>

<StackLayout Orientation="Horizontal">
<Label Text="Upper Limit of on Chip RSSI" WidthRequest="170" />
<Entry Text="{ Binding entryUpperRSSILimit, Mode=TwoWay }" HorizontalOptions="FillAndExpand" />
</StackLayout>

<StackLayout Orientation="Horizontal">
<Label Text="Lower Limit of on Chip RSSI" WidthRequest="170" />
<Entry Text="{ Binding entryLowerRSSILimit, Mode=TwoWay }" HorizontalOptions="FillAndExpand" />
</StackLayout>

<StackLayout Orientation="Horizontal">
<Switch IsToggled="{Binding switchRWTagIDIsToggled, Mode=TwoWay }" />
<Label Text="RW Tag ID" WidthRequest="80" VerticalOptions="Center" />
<Entry x:Name="entryRWTagID" Text="{ Binding entryRWTagID, Mode=TwoWay }" HorizontalOptions="FillAndExpand" />
<Label Text="{ Binding labelRWTagIDStatus }" WidthRequest="30" HorizontalOptions="End" VerticalOptions="Center" />
</StackLayout>

<StackLayout Orientation="Horizontal">
<Switch IsToggled="{Binding switchCalibrationIsToggled, Mode=TwoWay }" />
<Label Text="Calibration" WidthRequest="80" VerticalOptions="Center" />
<Entry x:Name="entryCalibration" Text="{ Binding entryCalibration, Mode=TwoWay }" HorizontalOptions="FillAndExpand" />
<Label Text="{ Binding labelCalibrationStatus }" WidthRequest="30" HorizontalOptions="End" VerticalOptions="Center" />
</StackLayout>

<StackLayout Orientation="Horizontal">
<Switch IsToggled="{Binding switchSensorCodeIsToggled, Mode=TwoWay }" />
<Label Text="Sensor Code" WidthRequest="80" VerticalOptions="Center" />
<Entry x:Name="entrySensorCode" Text="{ Binding entrySensorCode, Mode=TwoWay }" HorizontalOptions="FillAndExpand" />
<Label Text="{ Binding labelSensorCodeStatus }" WidthRequest="30" HorizontalOptions="End" VerticalOptions="Center" />
</StackLayout>

<StackLayout Orientation="Horizontal">
<Switch IsToggled="{Binding switchRssiCodeIsToggled, Mode=TwoWay }" />
<Label Text="Rssi Code" WidthRequest="80" VerticalOptions="Center" />
<Entry x:Name="entryRssiCode" Text="{ Binding entryRssiCode, Mode=TwoWay }" HorizontalOptions="FillAndExpand" />
<Label Text="{ Binding labelRssiCodeStatus }" WidthRequest="30" HorizontalOptions="End" VerticalOptions="Center" />
</StackLayout>

<StackLayout Orientation="Horizontal">
<Switch IsToggled="{Binding switchTemperatureCodeIsToggled, Mode=TwoWay }" />
<Label Text="Temperature Code" WidthRequest="80" VerticalOptions="Center" />
<Entry x:Name="entryTemperatureCode" Text="{ Binding entryTemperatureCode, Mode=TwoWay }" HorizontalOptions="FillAndExpand" />
<Label Text="{ Binding labelTemperatureCodeStatus }" WidthRequest="30" HorizontalOptions="End" VerticalOptions="Center" />
</StackLayout>

<StackLayout Orientation="Horizontal">
<Label Text="On Chip RSSI" WidthRequest="100" VerticalOptions="Center" />
<Label x:Name="labelOCRSSI" Text="{ Binding labelOCRSSIText }" TextColor="{ Binding labelOCRSSITColor }" WidthRequest="130" HorizontalOptions="End" VerticalOptions="Center" />
</StackLayout>

<StackLayout Orientation="Horizontal">
<Label Text="Temperature " WidthRequest="100" VerticalOptions="Center" />
<Label x:Name="labelTemperature" Text="{ Binding labelTemperatureText }" WidthRequest="130" HorizontalOptions="End" VerticalOptions="Center" />
</StackLayout>

<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand">
<Button Text="Read" Font="Large" BackgroundColor="#C3C3C3" Command="{Binding OnReadButtonCommand}" />
</StackLayout>

</StackLayout>

</StackLayout>
</ScrollView>
</pages:BasePage>

Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace BLE.Client.Pages
{
public partial class PageRFMicroReadTemp
{
public PageRFMicroReadTemp()
{
InitializeComponent();
}

protected override void OnAppearing()
{
base.OnAppearing();
}

protected override void OnDisappearing()
{
base.OnDisappearing();
}

void InputFocused(object sender, EventArgs args)
{
double curY = ((Entry)sender).Y;
double move;

if (curY != 0)
{
move = -(curY - 97.5);
}
else
{
move = -174;
}

Content.LayoutTo(new Rectangle(0, move, Content.Bounds.Width, Content.Bounds.Height));
}

void InputACCPWDFocused(object sender, EventArgs args)
{
Content.LayoutTo(new Rectangle(0, -110, Content.Bounds.Width, Content.Bounds.Height));
}

void InputUnfocused(object sender, EventArgs args)
{
Content.LayoutTo(new Rectangle(0, 0, Content.Bounds.Width, Content.Bounds.Height));
}

int HexVal (string value, int offset = 1)
{
offset--;
byte[] header = UnicodeEncoding.Unicode.GetBytes(value.Substring(offset, 1));

if (header[0] >= 48 && header[0] <= 57)
return (header[0] - 48);
else if (header[0] >= 65 && header[0] <= 70)
return (header[0] - 55);
else if (header[0] >= 97 && header[0] <= 102)
return (header[0] - 87);
else
return -1;
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8" ?>
<pages:BasePage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:pages="clr-namespace:BLE.Client.Pages;assembly=BLE.Client"
x:Class="BLE.Client.Pages.PageRFMicroInventory"
Title="RFMicro Inventory">

<StackLayout>

<ListView x:Name="liewViewTagData" ItemsSource="{Binding TagInfoList}" SelectedItem="{Binding objItemSelected, Mode=TwoWay}" >

<ListView.Header>
<StackLayout Padding="10,5,0,5" BackgroundColor="#cccccc">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.65*" />
<ColumnDefinition Width="0.225*" />
<ColumnDefinition Width="0.125*" />
</Grid.ColumnDefinitions>
<Label Text="EPC" VerticalTextAlignment="Center" FontSize="Small" />
<Label Grid.Column="1" Text="Cal Data" VerticalTextAlignment="Center" HorizontalTextAlignment="Start" FontSize="Small" />
<Label Grid.Column="2" Text="{Binding Col2Label}" VerticalTextAlignment="Center" HorizontalTextAlignment="Start" FontSize="Small" />
</Grid>
</StackLayout>
</ListView.Header>

<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Vertical">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.65*" />
<ColumnDefinition Width="0.225*" />
<ColumnDefinition Width="0.125*" />
</Grid.ColumnDefinitions>
<Label Text="{Binding EPC}" VerticalTextAlignment="Center" FontSize="Small" />
<Label Grid.Column="1" Text="{Binding Bank2Data}" VerticalTextAlignment="Center" HorizontalTextAlignment="Start" />
<Label Grid.Column="2" Text="{Binding Bank1Data}" VerticalTextAlignment="Center" HorizontalTextAlignment="Start" />
</Grid>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>

</ListView>

<StackLayout Orientation="Vertical" VerticalOptions="EndAndExpand" >

<StackLayout Orientation="Horizontal">
<Label Text="OC RSSI" WidthRequest="80" VerticalOptions="Center" />
<Switch IsToggled="{Binding switchRSSI_TempToggled, Mode=TwoWay }" />
<Label Text="Temp" WidthRequest="80" VerticalOptions="Center" />
</StackLayout>

<Button Text= "{Binding startInventoryButtonText}" Font="Large" Command="{Binding OnStartInventoryButtonCommand}" />
<Button Text="Clear" Font="Large" Command="{Binding OnClearButtonCommand}" />

<StackLayout Orientation="Horizontal">

<Label Text="{Binding InventoryTime}" Font="Small" HorizontalOptions="CenterAndExpand" VerticalOptions="End" />

</StackLayout>

<StackLayout Orientation="Horizontal">

<Label Text="{Binding numberOfTagsText}" Font="Small" HorizontalOptions="StartAndExpand" VerticalOptions="CenterAndExpand" />
<Label Text="{Binding labelVoltage}" Font="Small" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" />
<Label Text="{Binding tagPerSecondText}" Font="Small" HorizontalOptions="EndAndExpand" VerticalOptions="CenterAndExpand" />

</StackLayout>
</StackLayout>

</StackLayout>
</pages:BasePage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;

namespace BLE.Client.Pages
{
public partial class PageRFMicroInventory
{
public PageRFMicroInventory()
{
InitializeComponent();
}

public async void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var answer = await DisplayAlert("Select Tag", "Selected Tag for Read/Write, Geiger and RFMicro search", "OK", "Cancel");

if (answer)
{
//BLE.Client.ViewModels.ViewModelInventorynScan.TagInfo Items = (BLE.Client.ViewModels.ViewModelInventorynScan.TagInfo)e.SelectedItem;
BLE.Client.ViewModels.TagInfoViewModel Items = (BLE.Client.ViewModels.TagInfoViewModel)e.SelectedItem;

BleMvxApplication._SELECT_EPC = Items.EPC;
BleMvxApplication._SELECT_PC = Items.PC;
}
}
}
}
Loading

0 comments on commit b26a121

Please sign in to comment.