using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Comal.Classes; using InABox.Core; using InABox.Mobile; using Xamarin.Forms; using Xamarin.Forms.Xaml; using XF.Material.Forms.UI.Dialogs; namespace PRS.Mobile { [XamlCompilation(XamlCompilationOptions.Compile)] public partial class EquipmentEditNotesView { public EquipmentEditNotesView() { InitializeComponent(); } public override void Refresh() { } private async void DigitalKey_Tapped(object sender, EventArgs args) { String error = ""; using (await MaterialDialog.Instance.LoadingDialogAsync(message: "Please Wait...")) { String macaddress = "64:E8:33:71:74:11"; Guid service = Guid.Parse("4fafc201-1fb5-459e-8fcc-c5c9c331914b"); Guid characteristic = Guid.Parse("beb5483e-36e1-4688-b7f5-ea07361b26a8"); //String key = "9ffe2145-f6c7-4f84-8908-d7003f237fe5"; try { await App.Bluetooth.UnlockDigitalKey( macaddress, service, characteristic, "1" ); } catch (Exception e) { error = e.Message; } } if (!String.IsNullOrWhiteSpace(error)) await MaterialDialog.Instance.AlertAsync("Error Unlocking Device!", error, "OK"); } } }