Beispiel #1
0
 void protocol_T2_userEv_LogMessage(object sender, TDnRFcontroller_LIB.OutputReceivedEventArgs e)
 {
     richTextBox1_AppendText(e.Message);
 }
Beispiel #2
0
        void bleCtrl_appEv_DeviceInfoUpdate(object sender, TDnRFcontroller_LIB.MinDeviceInfoEventArgs e)
        {
            richTextBox1_AppendText("bleCtrl_appEv_DeviceInfoUpdate" + "\r\n");
            richTextBox1_AppendText(String.Format("    DeviceName = {0}", e.DeviceName) + "\r\n");
            richTextBox1_AppendText(String.Format("    DeviceAddr = {0}", e.DeviceAddr) + "\r\n");
            richTextBox1_AppendText(String.Format("    RSSI       = {0}", e.Rssi) + "\r\n");

            BtDeviceInfo device = new BtDeviceInfo();
            device.sCompleteLocalName = e.DeviceName;
            device.sDeviceAddr = e.DeviceAddr;
            device.sRssi = e.Rssi;

            bool devInfoInList = false;
            int i;
            for (i = 0; i < m_deviceInfoList.Count; i++)
            {
                BtDeviceInfo d = m_deviceInfoList[i];
                if (d.sDeviceAddr.Equals(device.sDeviceAddr))
                {
                    m_deviceInfoList[i] = device; // Update (Rssi)
                    devInfoInList = true;
                    break;
                }
            }

            if (!devInfoInList)
            {
                m_deviceInfoList.Add(device);
                //Console.WriteLine("meEv_OnDeviceDiscovered - NEW");
            }

            if ((!devInfoInList) || (true))//(false))
            {
                Update_formScan();
            }
            Update_formScan();
        }
Beispiel #3
0
        void OnEvent_udPacket(object sender, TDnRFcontroller_LIB.udPacketEventArgs e)
        {
            richTextBox1_AppendText(String.Format("\r\nudPacket Received: Packet Length = {0}, {1}\r\n", e.Packet.Length, e.Length));

            protocol_T2.RUINF_process_recv_packet(e.Packet, (UInt16)e.Packet.Length);
            button_Enable(btnBLE_TestSend, true);
            //button_Enable(btnBLE_Disconnect, true);
        }