//==========================Other========================================= /*private DEV_MODE AskMode() * { * Result result = Result.FAILURE; * * do * { * //Check BL Mode * result = GetVersion(DEV_MODE.BL); * * if ( Result.OK == result ) * { * m_Mode = DEV_MODE.BL; * break; * } * else if( Result.FWUPD_CMD_IGN == result ) * { * m_Mode = DEV_MODE.BL_ENTER_UPDATE; * break; * } * * //Check AP mode * if ( Result.OK == GetVersion(DEV_MODE.AP) ) * { * m_Mode = DEV_MODE.AP; * break; * } * * m_Mode = DEV_MODE.NO; * * }while(false); * * return m_Mode; * }*/ private void GetOEMVersion() { OEMCfgVersion Oversion = new OEMCfgVersion(); OEMCfgUpdateNumber OversionUpdateNumber = new OEMCfgUpdateNumber(); //取得OEM版號 Result result = Result.FAILURE; result = m_clsInterface.API_MacGetOEMCfgVersion(ref Oversion); result = m_clsInterface.API_MacGetOEMCfgUpdateNumber(ref OversionUpdateNumber); /*ControlItem(ENUM_ITEM_TYPE.TEXT_VER, String.Format("[OEM] {0}.{1}.{2}", * (char)Oversion.major, * (char)Oversion.minor, * (char)Oversion.release));*/ /*textBoxOEMVersion.Text=String.Format("[OEM] {0}.{1}{2}-up{3}{4}", * (char)Oversion.major, * (char)Oversion.minor, * (char)Oversion.release, * (char)OversionUpdateNumber.major, * (char)OversionUpdateNumber.minor);*/ ReaderOEMNumber = String.Format("{0}.{1}{2}", (char)Oversion.major, (char)Oversion.minor, (char)Oversion.release); ControlItem(ENUM_ITEM_TYPE.TEXT_OEMVER, String.Format("[OEM]{0}.{1}{2}up{3}{4}", (char)Oversion.major, (char)Oversion.minor, (char)Oversion.release, (char)OversionUpdateNumber.major, (char)OversionUpdateNumber.minor)); //Show device type ControlItem(ENUM_ITEM_TYPE.TEXT_DEVICE, rfid.clsPacket.TRANS_API_AskDevType().ToString()); //GetModelName do { UInt32 uiModelNameMajor = 0; UInt32 uiModelNameSub = 0; string strModule = string.Empty; string strModuleSub = string.Empty; rfid.Constants.Result resultM = rfid.Constants.Result.OK; //Get Model Name resultM = m_clsInterface.API_MacReadOemData((ushort)((int)enumOEM_ADDR.MODEL_NAME_MAIN), ref uiModelNameMajor); resultM = m_clsInterface.API_MacReadOemData((ushort)((int)enumOEM_ADDR.MODEL_NAME_SUB), ref uiModelNameSub); /* * textBoxModelName.Text = String.Format("RU-{0}{1}{2}-{3}{4}{5}{6}", * (char)((uiModelNameMajor >> 16) & 0xFF), * (char)((uiModelNameMajor >> 8) & 0xFF), * (char)(uiModelNameMajor & 0xFF), * (char)((uiModelNameSub >> 16) & 0xFF), * (char)((uiModelNameSub >> 8) & 0xFF), * (char)(uiModelNameSub & 0xFF), * (char)((uiModelNameSub >> 24) & 0xFF));*/ if (uiModelNameMajor == 0x4D303258) //0x4D303258==M02X { textBoxModelName.Text = String.Format("RU00-{0}{1}{2}-{3}{4}{5}{6}", (char)((uiModelNameMajor >> 24) & 0xFF), (char)((uiModelNameMajor >> 16) & 0xFF), (char)((uiModelNameMajor >> 8) & 0xFF), (char)(uiModelNameMajor & 0xFF), (char)((uiModelNameSub >> 16) & 0xFF), (char)((uiModelNameSub >> 8) & 0xFF), (char)(uiModelNameSub & 0xFF)); } else { textBoxModelName.Text = String.Format("RU-{0}{1}{2}-{3}{4}{5}{6}", (char)((uiModelNameMajor >> 16) & 0xFF), (char)((uiModelNameMajor >> 8) & 0xFF), (char)(uiModelNameMajor & 0xFF), (char)((uiModelNameSub >> 16) & 0xFF), (char)((uiModelNameSub >> 8) & 0xFF), (char)(uiModelNameSub & 0xFF), (char)((uiModelNameSub >> 24) & 0xFF)); } } while (false); }
//==========================Other========================================= /*private DEV_MODE AskMode() * { * Result result = Result.FAILURE; * * do * { * //Check BL Mode * result = GetVersion(DEV_MODE.BL); * * if ( Result.OK == result ) * { * m_Mode = DEV_MODE.BL; * break; * } * else if( Result.FWUPD_CMD_IGN == result ) * { * m_Mode = DEV_MODE.BL_ENTER_UPDATE; * break; * } * * //Check AP mode * if ( Result.OK == GetVersion(DEV_MODE.AP) ) * { * m_Mode = DEV_MODE.AP; * break; * } * * m_Mode = DEV_MODE.NO; * * }while(false); * * return m_Mode; * }*/ private void GetOEMVersion() { OEMCfgVersion Oversion = new OEMCfgVersion(); OEMCfgUpdateNumber OversionUpdateNumber = new OEMCfgUpdateNumber(); //取得OEM版號 Result result = Result.FAILURE; result = m_clsInterface.API_MacGetOEMCfgVersion(ref Oversion); result = m_clsInterface.API_MacGetOEMCfgUpdateNumber(ref OversionUpdateNumber); /*ControlItem(ENUM_ITEM_TYPE.TEXT_VER, String.Format("[OEM] {0}.{1}.{2}", * (char)Oversion.major, * (char)Oversion.minor, * (char)Oversion.release));*/ /*textBoxOEMVersion.Text=String.Format("[OEM] {0}.{1}{2}-up{3}{4}", * (char)Oversion.major, * (char)Oversion.minor, * (char)Oversion.release, * (char)OversionUpdateNumber.major, * (char)OversionUpdateNumber.minor);*/ ReaderOEMNumber = String.Format("{0}.{1}{2}", (char)Oversion.major, (char)Oversion.minor, (char)Oversion.release); ControlItem(ENUM_ITEM_TYPE.TEXT_OEMVER, String.Format("[OEM]{0}.{1}{2}up{3}{4}", (char)Oversion.major, (char)Oversion.minor, (char)Oversion.release, (char)OversionUpdateNumber.major, (char)OversionUpdateNumber.minor)); //Show device type ControlItem(ENUM_ITEM_TYPE.TEXT_DEVICE, rfid.clsPacket.TRANS_API_AskDevType().ToString()); //GetModelName do { //Mod by Wayne for improve FW upgrade feature for integrate M03X model, 2015-03-31 //UInt32 uiModelNameMajor = 0; //UInt32 uiModelNameSub = 0; //string strModule = string.Empty; //string strModuleSub = string.Empty; //rfid.Constants.Result resultM = rfid.Constants.Result.OK; //Mod by FJ for model name judgement, 2015-01-22 //Get Model Name //LakeChabotReader reader = null; reader = new LakeChabotReader(); //End by Wayne for improve FW upgrade feature for integrate M03X model, 2015-03-31 /* * textBoxModelName.Text = String.Format("RU-{0}{1}{2}-{3}{4}{5}{6}", * (char)((uiModelNameMajor >> 16) & 0xFF), * (char)((uiModelNameMajor >> 8) & 0xFF), * (char)(uiModelNameMajor & 0xFF), * (char)((uiModelNameSub >> 16) & 0xFF), * (char)((uiModelNameSub >> 8) & 0xFF), * (char)(uiModelNameSub & 0xFF), * (char)((uiModelNameSub >> 24) & 0xFF));*/ //Mod by Wayne for model name display error at M03X, 2014-09-26 if (rfid.Constants.Result.OK == reader.result_major && rfid.Constants.Result.OK == reader.result_sub) { //Mod by FJ for model category, 2016/05/31 if ((reader.uiModelNameMAJOR & 0xFF) == 88) // ASCII 88 = 'X' { if (((reader.uiModelNameMAJOR >> 24) & 0xFF) == 77) // ASCII 77 = 'M' { textBoxModelName.Text = String.Format("RU00-{0}{1}{2}-{3}{4}{5}{6}", (char)((reader.uiModelNameMAJOR >> 24) & 0xFF), (char)((reader.uiModelNameMAJOR >> 16) & 0xFF), (char)((reader.uiModelNameMAJOR >> 8) & 0xFF), (char)(reader.uiModelNameMAJOR & 0xFF), (char)((reader.uiModelNameSUB >> 16) & 0xFF), (char)((reader.uiModelNameSUB >> 8) & 0xFF), (char)(reader.uiModelNameSUB & 0xFF)); } else { textBoxModelName.Text = String.Format("RU-{0}{1}{2}-{3}{4}{5}{6}", (char)((reader.uiModelNameMAJOR >> 24) & 0xFF), (char)((reader.uiModelNameMAJOR >> 16) & 0xFF), (char)((reader.uiModelNameMAJOR >> 8) & 0xFF), (char)(reader.uiModelNameMAJOR & 0xFF), (char)((reader.uiModelNameSUB >> 16) & 0xFF), (char)((reader.uiModelNameSUB >> 8) & 0xFF), (char)(reader.uiModelNameSUB & 0xFF)); } } else { textBoxModelName.Text = String.Format("RU-{0}{1}{2}-{3}{4}{5}{6}", (char)((reader.uiModelNameMAJOR >> 16) & 0xFF), (char)((reader.uiModelNameMAJOR >> 8) & 0xFF), (char)(reader.uiModelNameMAJOR & 0xFF), (char)((reader.uiModelNameSUB >> 16) & 0xFF), (char)((reader.uiModelNameSUB >> 8) & 0xFF), (char)(reader.uiModelNameSUB & 0xFF), (char)((reader.uiModelNameSUB >> 24) & 0xFF)); } /* * if (reader.uiModelNameMAJOR == 0x4D303258 || reader.uiModelNameMAJOR == 0x4D303358)//0x4D303258==M02X, 0x4D303358==M03X * //if (uiModelNameMajor == 0x4D303258)//0x4D303258==M02X * //End by Wayne for model name display error at M03X, 2014-09-26 * { * textBoxModelName.Text = String.Format("RU00-{0}{1}{2}-{3}{4}{5}{6}", * (char)((reader.uiModelNameMAJOR >> 24) & 0xFF), * (char)((reader.uiModelNameMAJOR >> 16) & 0xFF), * (char)((reader.uiModelNameMAJOR >> 8) & 0xFF), * (char)(reader.uiModelNameMAJOR & 0xFF), * (char)((reader.uiModelNameSUB >> 16) & 0xFF), * (char)((reader.uiModelNameSUB >> 8) & 0xFF), * (char)(reader.uiModelNameSUB & 0xFF)); * } * else * { * textBoxModelName.Text = String.Format("RU-{0}{1}{2}-{3}{4}{5}{6}", * (char)((reader.uiModelNameMAJOR >> 16) & 0xFF), * (char)((reader.uiModelNameMAJOR >> 8) & 0xFF), * (char)(reader.uiModelNameMAJOR & 0xFF), * (char)((reader.uiModelNameSUB >> 16) & 0xFF), * (char)((reader.uiModelNameSUB >> 8) & 0xFF), * (char)(reader.uiModelNameSUB & 0xFF), * (char)((reader.uiModelNameSUB >> 24) & 0xFF)); * } */ //End by FJ for model category, 2016/05/31 } /* * //Get Model Name * resultM = m_clsInterface.API_MacReadOemData((ushort)((int)enumOEM_ADDR.MODEL_NAME_MAIN), ref uiModelNameMajor); * resultM = m_clsInterface.API_MacReadOemData((ushort)((int)enumOEM_ADDR.MODEL_NAME_SUB), ref uiModelNameSub); * /* * textBoxModelName.Text = String.Format("RU-{0}{1}{2}-{3}{4}{5}{6}", * (char)((uiModelNameMajor >> 16) & 0xFF), * (char)((uiModelNameMajor >> 8) & 0xFF), * (char)(uiModelNameMajor & 0xFF), * (char)((uiModelNameSub >> 16) & 0xFF), * (char)((uiModelNameSub >> 8) & 0xFF), * (char)(uiModelNameSub & 0xFF), * (char)((uiModelNameSub >> 24) & 0xFF));*/ //Mod by Wayne for model name display error at M03X, 2014-09-26 /*if (uiModelNameMajor == 0x4D303258 || uiModelNameMajor == 0x4D303358)//0x4D303258==M02X, 0x4D303358==M03X * //if (uiModelNameMajor == 0x4D303258)//0x4D303258==M02X * //End by Wayne for model name display error at M03X, 2014-09-26 * { * textBoxModelName.Text = String.Format("RU00-{0}{1}{2}-{3}{4}{5}{6}", * (char)((uiModelNameMajor >> 24) & 0xFF), * (char)((uiModelNameMajor >> 16) & 0xFF), * (char)((uiModelNameMajor >> 8) & 0xFF), * (char)(uiModelNameMajor & 0xFF), * (char)((uiModelNameSub >> 16) & 0xFF), * (char)((uiModelNameSub >> 8) & 0xFF), * (char)(uiModelNameSub & 0xFF)); * } * else * { * textBoxModelName.Text = String.Format("RU-{0}{1}{2}-{3}{4}{5}{6}", * (char)((uiModelNameMajor >> 16) & 0xFF), * (char)((uiModelNameMajor >> 8) & 0xFF), * (char)(uiModelNameMajor & 0xFF), * (char)((uiModelNameSub >> 16) & 0xFF), * (char)((uiModelNameSub >> 8) & 0xFF), * (char)(uiModelNameSub & 0xFF), * (char)((uiModelNameSub >> 24) & 0xFF)); * } */ //End by FJ for model name judgement, 2015-01-22 } while (false); }