wxr
2021-03-16 b4d92451b2071c9762b519275601424e276db90d
HDL_ON/UI/UI0-Stan/Logic/HdlBluetoothIOSLogic.cs
@@ -151,6 +151,8 @@
        /// <param name="FinishEvent">搜索结束的事件</param>
        public void ScanBluetooth(int waitTime, Action<List<BluetoothInfo>> FinishEvent)
        {
            HdlThreadLogic.Current.RunMain(() =>
            {
            //再次检测是否能够搜索蓝牙
            this.CheckCanScanBluetooth((result) =>
            {
@@ -162,6 +164,7 @@
                        this.DoScanBluetooth(waitTime, FinishEvent);
                    });
                }
                });
            });
        }
@@ -218,6 +221,8 @@
        /// <param name="connectEvent">因为需要对方反馈,所以使用回调(链接结果 false:连接失败 true:连接成功)</param>
        public void ContectBluetooth(BluetoothInfo bluetooth, Action<bool> connectEvent)
        {
            HdlThreadLogic.Current.RunMain(() =>
            {
            try
            {
                //添加事件
@@ -257,6 +262,7 @@
                connectEvent?.Invoke(false);
                connectEvent = null;
            }
            });
        }
        #endregion
@@ -307,18 +313,6 @@
            try
            {
                this.sendStatuValue = -1;
                if (waiTime == 0)
                {
                    //发送数据
                    var data = new Foundation.NSData();
                    data = i_data;
                    blufiClient.PostCustomData(data);
                    //直接返回成功
                    return true;
                }
                else
                {
                    //或许他用的是线程来调用
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        //发送数据
@@ -327,7 +321,9 @@
                        blufiClient.PostCustomData(data);
                    }, ShowErrorMode.NO);
                }
                if (waiTime == 0) { return true; }
                waiTime *= 5;
                while (this.sendStatuValue == -1 && waiTime > 0)
                {