//-------------------------------------------------------------------------- // Inventory //-------------------------------------------------------------------------- void doStartStopInventory(object sender, EventArgs e) { ToggleButton tb = FindViewById <ToggleButton> (Resource.Id.inventoryToggleButton); if (tb.Checked) { UgiRfidConfiguration config = UgiRfidConfiguration.ConfigWithInventoryType(inventoryType); Ugi.Singleton().StartInventory(this, config); this.selectedTag = null; FindViewById <Button> (Resource.Id.batteryButton).Enabled = false; FindViewById <Button> (Resource.Id.configureButton).Enabled = false; FindViewById <Button> (Resource.Id.audioReconfigureButton).Enabled = false; FindViewById <View>(Resource.Id.line4).Visibility = ViewStates.Visible; FindViewById <Button> (Resource.Id.commissionButton).Enabled = false; FindViewById <Button> (Resource.Id.readTagButton).Enabled = false; FindViewById <Button> (Resource.Id.writeTagButton).Enabled = false; UpdateTable(); } else { Ugi.Singleton().ActiveInventory.StopInventory(() => { FindViewById <View>(Resource.Id.line4).Visibility = ViewStates.Invisible; FindViewById <Button> (Resource.Id.batteryButton).Enabled = true; FindViewById <View>(Resource.Id.configureButton).Enabled = true; FindViewById <View>(Resource.Id.audioReconfigureButton).Enabled = true; }); } }
//-------------------------------------------------------------------------- // Inventory //-------------------------------------------------------------------------- partial void inventorySwitch_ValueChanged(UISwitch sender) { if (inventorySwitch.On) { selectedTag = null; UgiRfidConfiguration config = UgiRfidConfiguration.ConfigWithInventoryType(inventoryType); Ugi.Singleton().StartInventory(this, config); batteryButton.Enabled = false; configureButton.Enabled = false; commissionButton.Hidden = false; readButton.Hidden = false; writeButton.Hidden = false; commissionButton.Enabled = false; readButton.Enabled = false; writeButton.Enabled = false; tableView.ReloadData(); } else { Ugi.Singleton().ActiveInventory.StopInventory(() => { batteryButton.Enabled = true; configureButton.Enabled = true; commissionButton.Hidden = true; readButton.Hidden = true; writeButton.Hidden = true; }); } }
partial void ReadTagsStartButton_TouchUpInside(UIButton sender) { ConnectionStateLabel.Text = "Starting Read..."; UgiRfidConfiguration config = UgiRfidConfiguration.ConfigWithInventoryType(UgiRfidConfiguration.InventoryTypes.LocateVeryShortRange); config.SoundType = UgiRfidConfiguration.SoundTypes.None; config.PowerLevelWrite = 48f; _runningInventory = CurrentUgi.StartInventory(this, config); ConnectionStateLabel.Text = "Readings tags..."; }
public void doLocateTag(View v) { // // This is a demonstration of how to optimize locating a single tag // in a tagdense environment by passing the EPC as the select mask. // UgiEpc epc = this.selectedTag.Epc; Ugi.Singleton().ActiveInventory.StopInventory(() => { UgiRfidConfiguration config = UgiRfidConfiguration.ConfigWithInventoryType(inventoryType); config.SelectMask = epc.Bytes; config.SelectMaskBitLength = epc.Bytes.Length * 8; config.SelectOffset = 32; config.SelectBank = UgiRfidConfiguration.MemoryBank.Epc; Ugi.Singleton().StartInventory(this, config, epc); }); }