Пример #1
0
        /// <summary>
        /// 添加发送队列
        /// </summary>
        /// <param name="m1"></param>
        public void addSendBle(BLE.stringMsg m1)
        {
            BLEData ble1;

            if (m1.name == msgEnum.fileUpload)
            {
                string sendFileFullPath = m1.value["sendFileFullPath"];
                string saveFileFullPath = m1.value["saveFileFullPath"];

                BLE.bleClass.t12 t12 = new BLE.bleClass.t12();

                //  t12.sendFileFullPath = sendFileFullPath;

                //  string fileName = System.IO.Path.GetFileName(sendFileFullPath);

                //  ConfigInfo config = user.GetSave();
                //  string reviced = System.IO.Path.Combine(CurrUser.config.Path + "\\" + CurrUser.currUser.ID, fileName);//d:\\
                //stringMsg sm = new stringMsg();
                //sm.name = msgEnum.fileUpload;
                //sm.value.Add("sendFileFullPath", sendFileFullPath);
                //sm.value.Add("saveFileFullPath", saveFileFullPath);

                //   sm.value.Add("fileDirFullPath", CurrUser.config.Path + "\\" + CurrUser.currUser.ID);//文件存储路径


                t12.ReceiveFullMsg = m1.modelToJson();



                ble1 = t12;
            }
            else
            {
                BLE.bleClass.t11 t11 = new BLE.bleClass.t11();

                t11.msg = m1.modelToJson();

                ble1 = t11;
            }

            addSendBle(ble1);
        }
Пример #2
0
        /// <summary>
        /// 发送数据
        /// </summary>
        /// <param name="data"></param>
        public void sendData(BLE.stringMsg m1)
        {
            lock (this)
            {
                try
                {
                    BLE.bleClass.t11 t11 = new BLE.bleClass.t11();

                    t11.msg = m1.modelToJson();

                    sendData(t11);
                }
                catch (ObjectDisposedException ex2)
                {
                    connectionDisconnection();
                }
                catch (IOException ex3)
                {
                    connectionDisconnection();
                }
            }
        }