Inheritance: System.Windows.Forms.Form
Exemple #1
0
 public AttReadByGrpTypeRsp(DeviceForm deviceForm)
 {
     devForm = deviceForm;
     attrUuidUtils = new AttrUuidUtils();
     attrDataUtils = new AttrDataUtils(deviceForm);
     sendCmds = new SendCmds(deviceForm);
 }
Exemple #2
0
 public AttrDataItemForm(DeviceForm deviceForm)
 {
     InitializeComponent();
     devForm = deviceForm;
     sendCmds = new SendCmds(deviceForm);
     attrDataUtils = new AttrDataUtils(deviceForm);
 }
Exemple #3
0
 public AttFindInfoRsp(DeviceForm deviceForm)
 {
     m_deviceForm = deviceForm;
     m_sendCmds = new SendCmds(deviceForm);
     m_attrUuidUtils = new AttrUuidUtils();
     m_attrDataUtils = new AttrDataUtils(deviceForm);
 }
Exemple #4
0
 public ThreadMgr(DeviceForm deviceForm)
 {
     rspDataIn = new RspDataInThread(deviceForm);
     txDataOut = new TxDataOutThread();
     rxDataIn = new RxDataInThread(deviceForm);
     rxTxMgr = new RxTxMgrThread();
 }
Exemple #5
0
 public RxDataInThread(DeviceForm deviceForm)
 {
     rxDataInRspData = new RxDataInRspData(deviceForm);
     taskThread = new Thread(new ParameterizedThreadStart(TaskThread));
     taskThread.Name = "RxDataInThread";
     taskThread.Start(threadData);
     Thread.Sleep(0);
     while (!taskThread.IsAlive)
     { }
 }
Exemple #6
0
 public AttributesForm(DeviceForm deviceForm)
 {
     InitializeComponent();
     devForm = deviceForm;
     attrDataUtils = new AttrDataUtils(deviceForm);
     sendCmds = new SendCmds(deviceForm);
     ResetSort();
     devForm.threadMgr.rspDataIn.RspDataInChangedCallback = new RspDataInThread.RspDataInChangedDelegate(RspDataInChanged);
     lvAttributes_MouseUtils.MouseSingleClickCallback = new MouseUtils.MouseSingleClickDelegate(lvAttributes_MouseSingleClick);
     lvAttributes_MouseUtils.MouseDoubleClickCallback = new MouseUtils.MouseDoubleClickDelegate(lvAttributes_MouseDoubleClick);
     lvAttributes.MouseUp += new MouseEventHandler(lvAttributes_MouseUtils.MouseClick_MouseUp);
     chKey.Width = 0;
     ClearAll();
     tsmiRestoreDefaultColumnWidths_Click(null, EventArgs.Empty);
 }
Exemple #7
0
 public RspDataInThread(DeviceForm deviceForm)
 {
     ExtCmdStatus = new ExtCmdStatus();
     AttErrorRsp = new AttErrorRsp();
     m_attFindInfoRsp = new AttFindInfoRsp(deviceForm);
     m_attFindByTypeValueRsp = new AttFindByTypeValueRsp(deviceForm);
     m_attReadByTypeRsp = new AttReadByTypeRsp(deviceForm);
     AttReadRsp = new AttReadRsp(deviceForm);
     AttReadBlobRsp = new AttReadBlobRsp(deviceForm);
     m_attReadByGrpTypeRsp = new AttReadByGrpTypeRsp(deviceForm);
     AttWriteRsp = new AttWriteRsp();
     AttPrepareWriteRsp = new AttPrepareWriteRsp();
     AttExecuteWriteRsp = new AttExecuteWriteRsp();
     AttHandleValueNotification = new AttHandleValueNotification(deviceForm);
     AttHandleValueIndication = new AttHandleValueIndication(deviceForm);
     m_taskThread = new Thread(new ParameterizedThreadStart(TaskThread));
     m_taskThread.Name = moduleName;
     m_taskThread.Start(m_threadData);
     Thread.Sleep(0);
     while (!m_taskThread.IsAlive)
     { }
 }
 public AttHandleValueNotification(DeviceForm deviceForm)
 {
     attrUuidUtils = new AttrUuidUtils();
     attrDataUtils = new AttrDataUtils(deviceForm);
 }
Exemple #9
0
 public AttrDataUtils(DeviceForm deviceForm)
 {
     m_deviceForm = deviceForm;
 }
Exemple #10
0
 public RxDataInRspData(DeviceForm deviceForm)
 {
     m_deviceForm = deviceForm;
 }
Exemple #11
0
 public DeviceTabsForm(DeviceForm deviceForm)
 {
     InitializeComponent();
     devForm = deviceForm;
     listSelectForm = new ListSelectForm();
     btnSendShared.Visible = false;
     btnSendShared.Enabled = false;
     devForm.threadMgr.txDataOut.ShowProgressCallback = new DeviceTabsForm.ShowProgressDelegate(ShowProgress);
 }
Exemple #12
0
 public void Init(DeviceForm deviceForm)
 {
     txDataOut.InitThread(deviceForm);
     rxDataIn.InitThread(deviceForm);
 }
Exemple #13
0
        private void AddDeviceForm()
        {
            if (InvokeRequired)
            {
                try
                {
                    Invoke((Delegate)new AddDeviceFormDelegate(AddDeviceForm));
                }
                catch { }
            }
            else
            {
                m_mutex.WaitOne();
                DeviceForm deviceForm = new DeviceForm();
                if (deviceForm == null)
                    return;
                deviceForm.BDAddressNotify += new EventHandler(DeviceBDAddressNotify);
                deviceForm.ConnectionNotify += new EventHandler(DeviceConnectionNotify);
                deviceForm.DisconnectionNotify += new EventHandler(DeviceDisconnectionNotify);
                deviceForm.ChangeActiveRoot += new EventHandler(DeviceChangeActiveRoot);
                deviceForm.CloseActiveDevice += new EventHandler(DeviceCloseActiveDevice);

                if (deviceForm.DeviceFormInit())
                {
                    deviceForm.TopLevel = false;
                    deviceForm.Parent = plDevice;
                    deviceForm.Dock = DockStyle.Fill;
                    foreach (Control control in plDevice.Controls)
                    {
                        if (control.GetType().BaseType == typeof(Form))
                        {
                            Form form = (Form)control;
                            if (form.Visible)
                            {
                                form.Hide();
                                break;
                            }
                        }
                    }
                    deviceForm.Show();
                    AddToTreeDeviceInfo(deviceForm.devInfo, deviceForm);
                    comPortTreeForm.ClearSelectedNode();
                    deviceForm.SendGAPDeviceInit();
                }
                else
                    deviceForm.DeviceFormClose(false);

                m_mutex.ReleaseMutex();
            }
        }
Exemple #14
0
 public bool ChangeActiveRoot(DeviceForm devForm)
 {
     bool flag = false;
     if (devForm != null)
     {
         foreach (TreeNode treeNode in tvPorts.Nodes)
             treeNode.NodeFont = !(((DeviceInfo)treeNode.Tag).DevName == devForm.devInfo.DevName) ? regularFont : underlineFont;
     }
     else
         flag = false;
     return flag;
 }
Exemple #15
0
        public bool AddConnectionInfo(DeviceForm devForm)
        {
            bool flag = true;
            ConnectInfo connectInfo = devForm.GetConnectInfo();
            if (devForm != null)
            {
                foreach (TreeNode treeNode in tvPorts.Nodes)
                {
                    DeviceInfo deviceInfo = (DeviceInfo)treeNode.Tag;
                    if (deviceInfo.ComPortInfo.ComPort == devForm.devInfo.ComPortInfo.ComPort)
                    {
                        TreeNode node1 = new TreeNode();
                        node1.Name = ComPortTreeForm.NodeNames.ConnectionInfo.ToString();
                        node1.Text = string.Format("Connection Info:");
                        node1.NodeFont = underlineFont;
                        node1.Tag = treeNode.Tag;
                        node1.ToolTipText = string.Format("Device Connection Information (Over the Air Connection)");

                        TreeNode node2 = new TreeNode();
                        node2.Name = ComPortTreeForm.NodeNames.SlaveHandle.ToString();
                        node2.Text = string.Format("Handle: 0x{0:X4}", connectInfo.Handle);
                        deviceInfo.ConnectInfo.Handle = connectInfo.Handle;
                        node2.Tag = treeNode.Tag;
                        node2.ToolTipText = string.Format("Connection Handle\nSelect Handle Then Right Click To See Options.");

                        TreeNode node3 = new TreeNode();
                        node3.Name = ComPortTreeForm.NodeNames.SlaveAddrType.ToString();
                        node3.Text = string.Format("Addr Type: 0x{0:X2} ({1:S})", connectInfo.AddrType, devUtils.GetGapAddrTypeStr(connectInfo.AddrType));
                        node3.Tag = treeNode.Tag;
                        node3.ToolTipText = string.Format("Address Type");

                        TreeNode node4 = new TreeNode();
                        node4.Name = ComPortTreeForm.NodeNames.SlaveBda.ToString();
                        node4.Text = string.Format("Slave BDA: {0:S}", connectInfo.BDA);
                        node4.Tag = treeNode.Tag;
                        node4.ToolTipText = string.Format("Slave Bluetooth Device Address\nSelect Address Then Right Click To See Options.");

                        treeNode.Nodes.Add(node1);
                        node1.Nodes.Add(node2);
                        node1.Nodes.Add(node3);
                        node1.Nodes.Add(node4);
                        node1.Expand();
                    }
                }
            }
            else
                flag = false;
            return flag;
        }
Exemple #16
0
 public void StopTimer(DeviceForm.EventType eType)
 {
     switch (eType)
     {
         case DeviceForm.EventType.Init:
             initTimer.Stop();
             break;
         case DeviceForm.EventType.Scan:
             scanTimer.Stop();
             break;
         case DeviceForm.EventType.Establish:
             establishTimer.Stop();
             break;
         case DeviceForm.EventType.PairBond:
             pairBondTimer.Stop();
             break;
     }
 }
Exemple #17
0
 public MsgLogForm(DeviceForm deviceForm)
 {
     InitializeComponent();
     devForm = deviceForm;
 }
Exemple #18
0
 public void InitThread(DeviceForm deviceForm)
 {
     deviceForm.threadMgr.txDataOut.DeviceRxStopWaitCallback = new RxDataInThread.DeviceRxStopWaitDelegate(DeviceRxStopWait);
 }
Exemple #19
0
 public AttReadBlobRsp(DeviceForm deviceForm)
 {
     attrUuidUtils = new AttrUuidUtils();
     attrDataUtils = new AttrDataUtils(deviceForm);
 }
Exemple #20
0
 public void InitThread(DeviceForm deviceForm)
 {
     deviceForm.threadMgr.rxDataIn.DeviceTxStopWaitCallback = new TxDataOutThread.DeviceTxStopWaitDelegate(DeviceTxStopWait);
 }
Exemple #21
0
 public bool AddDeviceInfo(DeviceForm devForm)
 {
     bool flag = true;
     string str = devForm.BDAddressStr;
     if (devForm != null)
     {
         foreach (TreeNode treeNode in tvPorts.Nodes)
         {
             DeviceInfo deviceInfo = (DeviceInfo)treeNode.Tag;
             if (deviceInfo.ComPortInfo.ComPort == devForm.devInfo.ComPortInfo.ComPort)
             {
                 TreeNode node1 = new TreeNode();
                 node1.Name = ComPortTreeForm.NodeNames.DeviceInfo.ToString();
                 node1.Text = string.Format("Device Info:");
                 node1.NodeFont = underlineFont;
                 node1.Tag = treeNode.Tag;
                 node1.ToolTipText = string.Format("Information About The Direct Connect Device.");
                 TreeNode node2 = new TreeNode();
                 node2.Name = ComPortTreeForm.NodeNames.HostHandle.ToString();
                 node2.Text = string.Format("Handle: 0x{0:X4}", 65534);
                 deviceInfo.Handle = 65534;
                 node2.Tag = treeNode.Tag;
                 node2.ToolTipText = string.Format("Device Handle\nSelect Handle Then Right Click To See Options.");
                 TreeNode node3 = new TreeNode();
                 node3.Name = ComPortTreeForm.NodeNames.HostBda.ToString();
                 node3.Text = string.Format("BDAddr: {0:S}", str);
                 node3.Tag = treeNode.Tag;
                 node3.ToolTipText = string.Format("Bluetooth Device Address\nSelect Address Then Right Click To See Options.");
                 if (treeNode.FirstNode.NextNode == null)
                 {
                     treeNode.Nodes.Add(node1);
                     node1.Nodes.Add(node2);
                     node1.Nodes.Add(node3);
                     node1.Expand();
                 }
             }
         }
     }
     else
         flag = false;
     return flag;
 }
Exemple #22
0
 public AttFindByTypeValueRsp(DeviceForm deviceForm)
 {
     attrUuidUtils = new AttrUuidUtils();
     attrDataUtils = new AttrDataUtils(deviceForm);
 }
Exemple #23
0
 public bool DisconnectDevice(DeviceForm devForm)
 {
     bool flag = false;
     ConnectInfo connectInfo = devForm.disconnectInfo;
     if (devForm != null)
     {
         foreach (TreeNode treeNode in tvPorts.Nodes)
         {
             if (((DeviceInfo)treeNode.Tag).ComPortInfo.ComPort == devForm.devInfo.ComPortInfo.ComPort)
             {
                 string target = string.Format("Handle: 0x{0:X4}", connectInfo.Handle);
                 SharedObjects.Log.Write(Logging.MsgType.Debug, ComPortTreeForm.moduleName, "Disconnecting Device " + target);
                 if (flag = treeViewUtils.TreeNodeTextSearchAndDestroy(treeNode, target))
                     break;
             }
             if (flag)
                 break;
         }
     }
     else
         flag = false;
     return flag;
 }
Exemple #24
0
 public SendCmds(DeviceForm deviceForm)
 {
     m_deviceForm = deviceForm;
 }