コード例 #1
0
ファイル: ZeroManageCommand.cs プロジェクト: ym1100/MicroZero
        /// <summary>
        ///     执行管理命令(快捷命令,命令在说明符号的第二个字节中)
        /// </summary>
        /// <param name="commmand"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        protected bool ByteCommand(ZeroByteCommand commmand, params string[] args)
        {
            byte[] description = new byte[4 + args.Length];
            description[0] = (byte)(args.Length);
            description[1] = (byte)commmand;
            int idx = 2;

            for (var index = 0; index < args.Length; index++)
            {
                description[idx++] = ZeroFrameType.Argument;
            }
            description[idx] = ZeroFrameType.End;
            return(CallCommand(description, args).InteractiveSuccess);
        }
コード例 #2
0
 /// <summary>
 ///     连接到
 /// </summary>
 private bool HeartCommand(ZeroByteCommand commmand, params string[] args)
 {
     Task.Factory.StartNew(() => ByteCommand(commmand, args)).Wait();
     return(true);
 }