private void DeviceInterface_Load(object sender, EventArgs e) { do { UInt32 uiModelNameMajor = 0; string strModule = string.Empty; rfid.Constants.Result result = rfid.Constants.Result.OK; //Get Model Name result = m_clsInterface.API_MacReadOemData((ushort)((int)enumOEM_ADDR.MODEL_NAME_MAIN), ref uiModelNameMajor); if (rfid.Constants.Result.OK != result) { btn_Update.Enabled = false; break; } strModule = String.Format("RU-{0}{1}{2}", (char)((uiModelNameMajor >> 16) & 0xFF), (char)((uiModelNameMajor >> 8) & 0xFF), (char)(uiModelNameMajor & 0xFF)); if (strModule == "RU-824") { rBtn_USB.Checked = true; btn_Update.Enabled = false; rBtn_UART.Enabled = false; break; } UInt32 oemData = 0; result = m_clsInterface.API_MacReadOemData((ushort)enumOEM_ADDR.HOST_IF_SEL, ref oemData); if (rfid.Constants.Result.OK != result) { btn_Update.Enabled = false; break; } if (oemData == (uint)enumPORT.ENUM_PORT_USB) { rBtn_USB.Checked = true; rBtn_UART.Checked = false; } else { rBtn_USB.Checked = false; rBtn_UART.Checked = true; } }while(false); }
private void DeviceInterface_Load(object sender, EventArgs e) { do { UInt32 uiModelNameMajor = 0; string strModule = string.Empty; rfid.Constants.Result result = rfid.Constants.Result.OK; //Mod by Wayne for supporting M.2/R2000 module, 2016-08-01 UInt32 oemData = 0; //initial btn_Update.Enabled = false; rBtn_USB.Enabled = false; rBtn_UART.Enabled = false; rBtn_USB.Checked = false; rBtn_UART.Checked = false; result = m_clsInterface.API_MacReadOemData((ushort)enumOEM_ADDR.HOST_IF_SEL, ref oemData); if (rfid.Constants.Result.OK != result) { break; } if (oemData == (uint)enumPORT.ENUM_PORT_USB) { rBtn_USB.Checked = true; } else if (oemData == (uint)enumPORT.ENUM_PORT_UART) { rBtn_UART.Checked = true; } //Get Model Name result = m_clsInterface.API_MacReadOemData((ushort)((int)enumOEM_ADDR.MODEL_NAME_MAIN), ref uiModelNameMajor); if (rfid.Constants.Result.OK != result) { break; } switch (uiModelNameMajor) { //USB only case 0x00383234: //824 case 0x4D303658: //M06 case 0x4D303758: //M07 //Add by Wayne for support M06 and M07 module, 2017-08-09. rBtn_USB.Checked = true; rBtn_USB.Enabled = true; break; //UART only case 0x4D303258: //M02 case 0x4D303358: //M03 rBtn_UART.Checked = true; rBtn_UART.Enabled = true; break; //USB and UART case 0x00383631: //861 btn_Update.Enabled = true; rBtn_USB.Enabled = true; rBtn_UART.Enabled = true; break; default: break; } /* * //Get Model Name * result = m_clsInterface.API_MacReadOemData((ushort)((int)enumOEM_ADDR.MODEL_NAME_MAIN), ref uiModelNameMajor); * if (rfid.Constants.Result.OK != result) * { * btn_Update.Enabled = false; * break; * } * * //Add by Wayne for improve FW upgrade feature for integrate M03X model, 2015-03-31 * if (uiModelNameMajor == 0x4D303358) * { * rBtn_USB.Checked = false; * rBtn_USB.Enabled = false; * rBtn_UART.Checked = true; * rBtn_UART.Enabled = true; * } * //End by Wayne for improve FW upgrade feature for integrate M03X model, 2015-03-31 * * strModule= String.Format( "RU-{0}{1}{2}", * (char)((uiModelNameMajor >> 16) & 0xFF), * (char)((uiModelNameMajor >> 8) & 0xFF), * (char)( uiModelNameMajor & 0xFF) ); * * * * if (strModule == "RU-824") * { * rBtn_USB.Checked = true; * * btn_Update.Enabled = false; * rBtn_UART.Enabled = false; * break; * } * * UInt32 oemData = 0; * result = m_clsInterface.API_MacReadOemData( (ushort) enumOEM_ADDR.HOST_IF_SEL, ref oemData); * if (rfid.Constants.Result.OK != result) * { * btn_Update.Enabled = false; * break; * } * * if (oemData == (uint)enumPORT.ENUM_PORT_USB) * { * rBtn_USB.Checked = true; * rBtn_UART.Checked = false; * } * else * { * rBtn_USB.Checked = false; * rBtn_UART.Checked = true; * } */ //End by Wayne for supporting M.2/R2000 module, 2016-08-01 }while(false); }