-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from cslrfid/release-2.0.13
RFMicron Temperature Tag Functions
- Loading branch information
Showing
21 changed files
with
1,507 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
CS108 Demo/Source/BLE.Client/BLE.Client.Droid/Properties/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
CS108 Demo/Source/BLE.Client/BLE.Client/Pages/PageRFMicroReadTemp.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
72 changes: 72 additions & 0 deletions
72
CS108 Demo/Source/BLE.Client/BLE.Client/Pages/PageRFMicroReadTemp.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
CS108 Demo/Source/BLE.Client/BLE.Client/Pages/PageRFMicronInventory.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
32 changes: 32 additions & 0 deletions
32
CS108 Demo/Source/BLE.Client/BLE.Client/Pages/PageRFMicronInventory.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.