using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace RCUHost.Protocols
{
	/// <summary>
	/// 升级主机 Packet RCU -> 服务器
	/// </summary>
	[StructLayoutAttribute(LayoutKind.Sequential, Pack = 1)]
	public struct UpdateHostPacketReply
	{
		#region Status Const

        /// <summary>
        /// 升级就绪
        /// </summary>
        public const byte Ready = 0x00;

        /// <summary>
        /// 升级完成
        /// </summary>
        public const byte Completed = 0x01;

        /// <summary>
        /// 升级出错
        /// </summary>
        public const byte Error = 0x02;

        /// <summary>
        /// 文件块数错误
        /// </summary>
        public const byte BlockNumError = 0x03;

        /// <summary>
        /// 文件类型错误
        /// </summary>
        public const byte FileTypeError = 0x04;

        /// <summary>
        /// 文件MD5错误
        /// </summary>
        public const byte FileMD5Error = 0x05;

		#endregion

		/// <summary>
		/// 状态
		/// </summary>
		public byte Status;

		/// <summary>
		/// 版本号
		/// </summary>
		[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 20)]
        public string Version;

        /// <summary>
        /// 文件类型
        /// </summary>
        public byte FileType;

		/// <summary>
		/// CRC16
		/// </summary>
		public ushort CRC;
	}
}
