/// <summary>
        /// Execute HVC functions<br>
        /// [Description]<br>
        /// Execute each HVC function. Store results in HVC_BLE.Result<br> </summary>
        /// <param name="inExec"> execution flag<br> </param>
        /// <param name="outStatus"> HVC execution result status<br> </param>
        /// <returns> int execution result error code <br> </returns>
        public async override Task <int> Execute(int inExec, HVC_RES res)
        {
            if (BtDevice == null)
            {
                Debug.WriteLine(TAG, "execute() : HVC_ERROR_NODEVICES");
                return(HVC_ERROR_NODEVICES);
            }
            if (Service == null || Service.GetmConnectionState() != BleDeviceService.STATE_CONNECTED)
            {
                Debug.WriteLine(TAG, "execute() : HVC_ERROR_DISCONNECTED");
                return(HVC_ERROR_DISCONNECTED);
            }
            if (Status > STATE_CONNECTED)
            {
                Debug.WriteLine(TAG, "execute() : HVC_ERROR_BUSY");
                return(HVC_ERROR_BUSY);
            }

            Status = STATE_BUSY;

            await Task.Run(() =>
            {
                int nRet         = HVC_NORMAL;
                byte[] outStatus = new byte[1];
                nRet             = Execute(30000, inExec, outStatus, res);
                if (Callback != null)
                {
                    Callback.OnPostExecute(nRet, outStatus[0]);
                }

                if (Status == STATE_BUSY)
                {
                    Status = STATE_CONNECTED;
                }
            });

            //Thread t = new Thread(new ThreadStart(() => {
            //    int nRet = HVC_NORMAL;
            //    byte[] outStatus = new byte[1];
            //    nRet = Execute(10000, inExec, outStatus, res);
            //    if (mCallback != null)
            //    {
            //        mCallback.onPostExecute(nRet, outStatus[0]);
            //    }

            //    if (mStatus == STATE_BUSY)
            //    {
            //        mStatus = STATE_CONNECTED;
            //    }
            //}));

            //t.Start();
            Debug.WriteLine(TAG, "execute() : HVC_NORMAL");
            return(HVC_NORMAL);
        }