public static SaharaPacket GetResetPacket()
        {
            SaharaPacket packet = new SaharaPacket();

            packet.CommandID = CommandName.Reset;
            return(packet);
        }
        public static SaharaPacket GetDonePacket()
        {
            SaharaPacket packet = new SaharaPacket();

            packet.CommandID = CommandName.Done;
            return(packet);
        }
        public static SaharaPacket GetCommandSwitchModePacket(DeviceModeName deviceMode)
        {
            SaharaPacket packet = new SaharaPacket();

            packet.CommandID      = CommandName.CommandSwitchMode;
            packet.OptionalField1 = (uint)deviceMode;
            return(packet);
        }
        public static SaharaPacket GetCommandExecuteData(CmdName cmdName)
        {
            SaharaPacket packet = new SaharaPacket();

            packet.CommandID      = CommandName.CommandExecuteData;
            packet.OptionalField1 = (uint)cmdName;
            return(packet);
        }
        public static SaharaPacket GetMemoryReadPacket(uint address, uint length)
        {
            SaharaPacket packet = new SaharaPacket();

            packet.CommandID      = CommandName.MemoryRead;
            packet.OptionalField1 = address;
            packet.OptionalField2 = length;
            return(packet);
        }
        public static SaharaPacket GetHelloResponsePacket(uint version, uint compatibleVersion, DeviceModeName deviceMode)
        {
            SaharaPacket packet = new SaharaPacket();

            packet.CommandID      = CommandName.HelloResponse;
            packet.OptionalField1 = version;
            packet.OptionalField2 = compatibleVersion;
            packet.RawData        = new byte[32];
            LittleEndianWriter.WriteUInt32(packet.RawData, 4, (uint)deviceMode);
            return(packet);
        }