Пример #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            BlueTooth = new BT(lstResults);

            //Define general event handlers only once in the demo app
            BtStack.BtDevFound         += new BtStack.BtDevFoundHandler(BlueTooth.OnDevFound);
            BtStack.BtConnStatus       += new BtStack.BtConnStatusHandler(BlueTooth.OnConnStatus);
            BtStack.BtSendFileComplete += new BtStack.BtSendFileCompleteHandler(BlueTooth.OnSendFileComplete);
            //BtStack.BtSendFileProgress += new BtStack.BtSendFileProgressHandler(BlueTooth.OnSendFileProgress);
            BtStack.BtRecvFileComplete += new BtStack.BtRecvFileCompleteHandler(BlueTooth.OnRecvFile);
            BtStack.BtBcComplete       += new BtStack.BtBcCompleteHandler(BlueTooth.OnBcComplete);
            BtStack.BtSearchComplete   += new BtStack.BtSearchCompleteHandler(BlueTooth.OnSearchComplete);

            // write the fileData buffer
            FileData = new byte[FileSize];
            for (int i = 0; i < FileSize; i++)
            {
                FileData[i] = (byte)(i % 256);
            }
        }
Пример #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            BlueTooth = new BT(lstResults);

            //Define general event handlers only once in the demo app
            BtStack.BtDevFound += new BtStack.BtDevFoundHandler(BlueTooth.OnDevFound);
            BtStack.BtConnStatus += new BtStack.BtConnStatusHandler(BlueTooth.OnConnStatus);
            BtStack.BtSendFileComplete += new BtStack.BtSendFileCompleteHandler(BlueTooth.OnSendFileComplete);
            //BtStack.BtSendFileProgress += new BtStack.BtSendFileProgressHandler(BlueTooth.OnSendFileProgress);
            BtStack.BtRecvFileComplete += new BtStack.BtRecvFileCompleteHandler(BlueTooth.OnRecvFile);
            BtStack.BtBcComplete += new BtStack.BtBcCompleteHandler(BlueTooth.OnBcComplete);
            BtStack.BtSearchComplete += new BtStack.BtSearchCompleteHandler(BlueTooth.OnSearchComplete);

            // write the fileData buffer
            FileData = new byte[FileSize];
            for (int i = 0; i < FileSize; i++)
            {
                FileData[i] = (byte)(i % 256);
            }
        }