Beispiel #1
0
        protected async Task <Peripheral> ConnectAsync(string id)
        {
            // Ble connect
            Debug.Log($"GrayBlue try connect. id={id}");
            var ble     = new BLEDevice(id);
            var success = await grayBlueCentral.ConnectAsync(id, ble);

            if (!success)
            {
                Debug.Log($"GrayBlue connect failed. id={id}");
                return(null);
            }
            Debug.Log($"GrayBlue connect done. id={id}");
            return(new Peripheral(ble));
        }