Пример #1
0
        /// <summary>
        /// 这个函数 实现功能 没有写完,按照这个逻辑,完成功能后删掉这个注释.
        /// 根据数据类型,创建命令帮助类型.
        /// </summary>
        /// <param name="command1"></param>
        /// <returns></returns>
        public static messageDescribe CreateBLEDataHelper(BLEcommand command1)
        {
            //这个函数 实现功能 没有写完,按照这个逻辑,完成功能后删掉这个注释.

            messageDescribe h1;

            switch (command1)
            {
            //case BLEcommand.t10:
            //    h1 = new messageDescribe(@"登入", 2, 2);
            //    break;
            case BLEcommand.t11:
                h1 = new messageDescribe(@"发送文字消息[int32|string]", 4, -1);
                break;

            case BLEcommand.t12:
                h1 = new messageDescribe(@"发送文件[int32|int64|string|file]", 4, 8, -1, -1);
                break;

            default:
                h1 = new messageDescribe("无", 0);
                break;
            }
            return(h1);
        }
Пример #2
0
        public BLEData(BLEcommand comm)
        {
            this._command = comm;

            byte[][] msg1 = new byte[messageDescribe.messageLength.Length][];
            msg1.Initialize();
            this.messageData = msg1;
        }
Пример #3
0
        /// <summary>
        /// 创建实例
        /// </summary>
        /// <param name="comm"></param>
        /// <returns></returns>
        public static BLEData CreateBle(BLEcommand comm)
        {
            BLEData b = null;

            switch (comm)
            {
            case BLEcommand.t11:
                b = new bleClass.t11();
                break;

            case BLEcommand.t12:
                b = new bleClass.t12();
                break;

            default:
                b = new BLEData(comm);
                break;
            }
            return(b);
        }
Пример #4
0
 /// <summary>
 /// 检测数据和命令是否一致.
 /// 功能未实现,实现后,删掉这个注释
 /// </summary>
 /// <param name="comm"></param>
 /// <returns></returns>
 public bool checkBLE(BLEcommand comm)
 {
     return(true);
 }
Пример #5
0
 /// <summary>
 /// 获取指定命令的消息描述
 /// </summary>
 public static messageDescribe getBLEcommandMessageDescribe(BLEcommand comm)
 {
     return(messageDic[comm]);
 }