|
@@ -110,10 +110,10 @@ namespace InABox.Mobile
|
|
private async Task<bool> UnlockDevice(IDevice idevice, String key)
|
|
private async Task<bool> UnlockDevice(IDevice idevice, String key)
|
|
{
|
|
{
|
|
bool result = false;
|
|
bool result = false;
|
|
- Console.WriteLine(String.Format("** Found Device: {0} {1}", idevice.Name, idevice.Rssi));
|
|
|
|
|
|
+ //Console.WriteLine(String.Format("** Found Device: {0} {1}", idevice.Name, idevice.Rssi));
|
|
if (idevice.Rssi < -65)
|
|
if (idevice.Rssi < -65)
|
|
{
|
|
{
|
|
- Console.WriteLine(String.Format("** Device RSSI is too low: {0}", idevice.Rssi));
|
|
|
|
|
|
+ //Console.WriteLine(String.Format("** Device RSSI is too low: {0}", idevice.Rssi));
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
try
|
|
try
|
|
@@ -123,18 +123,18 @@ namespace InABox.Mobile
|
|
IService service = await idevice.GetServiceAsync(Guid.Parse("3317F54C-1C7E-EBE7-026E-3C819FD35476"));
|
|
IService service = await idevice.GetServiceAsync(Guid.Parse("3317F54C-1C7E-EBE7-026E-3C819FD35476"));
|
|
if (service != null)
|
|
if (service != null)
|
|
{
|
|
{
|
|
- Console.WriteLine("** Found Service 3317F54C-1C7E-EBE7-026E-3C819FD35476");
|
|
|
|
|
|
+ //Console.WriteLine("** Found Service 3317F54C-1C7E-EBE7-026E-3C819FD35476");
|
|
ICharacteristic chr = await service.GetCharacteristicAsync(Guid.Parse("20852B39-4455-EE15-089B-D1629FE76927"));
|
|
ICharacteristic chr = await service.GetCharacteristicAsync(Guid.Parse("20852B39-4455-EE15-089B-D1629FE76927"));
|
|
if (chr != null)
|
|
if (chr != null)
|
|
{
|
|
{
|
|
- Console.WriteLine("** Found Characteristic 20852B39-4455-EE15-089B-D1629FE76927");
|
|
|
|
|
|
+ //Console.WriteLine("** Found Characteristic 20852B39-4455-EE15-089B-D1629FE76927");
|
|
//var data = await chr.ReadAsync();
|
|
//var data = await chr.ReadAsync();
|
|
//Console.WriteLine("- Found Data: " + String.Join("-", data.Select(x => String.Format("{0:X2}", x))));
|
|
//Console.WriteLine("- Found Data: " + String.Join("-", data.Select(x => String.Format("{0:X2}", x))));
|
|
var newdata = Encoding.ASCII.GetBytes(key);
|
|
var newdata = Encoding.ASCII.GetBytes(key);
|
|
bool bWrite = await chr.WriteAsync(newdata);
|
|
bool bWrite = await chr.WriteAsync(newdata);
|
|
if (bWrite)
|
|
if (bWrite)
|
|
{
|
|
{
|
|
- Console.WriteLine("** Wrote Data " + String.Join("-", newdata.Select(x => String.Format("{0:X2}", x))));
|
|
|
|
|
|
+ //Console.WriteLine("** Wrote Data " + String.Join("-", newdata.Select(x => String.Format("{0:X2}", x))));
|
|
//var confdata = await chr.ReadAsync();
|
|
//var confdata = await chr.ReadAsync();
|
|
//Console.WriteLine("- Read Data: " + String.Join("-", confdata.Select(x => String.Format("{0:X2}", x))));
|
|
//Console.WriteLine("- Read Data: " + String.Join("-", confdata.Select(x => String.Format("{0:X2}", x))));
|
|
result = true;
|
|
result = true;
|