BTool.ComPortTreeForm.SendGattDiscoverCmds C# (CSharp) Method

SendGattDiscoverCmds() private method

private SendGattDiscoverCmds ( TreeNode treeNode, TxDataOut cmdType ) : void
treeNode System.Windows.Forms.TreeNode
cmdType TxDataOut
return void
        private void SendGattDiscoverCmds(TreeNode treeNode, TxDataOut.CmdTypes cmdType)
        {
            DeviceForm deviceForm = GetActiveDeviceFormCallback();
            if (deviceForm == null || treeNode == null || !(treeNode.Name == "HostHandle") && !(treeNode.Name == "SlaveHandle"))
                return;
            string str = treeNode.Text.Replace("Handle: ", "");
            if (str != null)
            {
                try
                {
                    ushort handle = Convert.ToUInt16(str, 16);
                    deviceForm.sendCmds.SendGATT(new HCICmds.GATTCmds.GATT_DiscAllPrimaryServices() { connHandle = handle }, cmdType);
                    deviceForm.sendCmds.SendGATT(new HCICmds.GATTCmds.GATT_DiscAllCharDescs() { connHandle = handle }, cmdType);
                }
                catch { }
            }
        }