private void DIO_Load(object sender, EventArgs e) { UInt16 LastErrCode; byte[] byLibVersion = new byte[DIO_API.IMC_LIB_VERSION_SIZE]; LastErrCode = DIO_API.DIO_GetLibVersion(byLibVersion); if (LastErrCode != IMC_ERR_NO_ERROR) { MessageBox.Show("Fails to get library version"); return; } int nRealSize; StaticLibVersionValue.Text = ConvertByte2String(byLibVersion, byLibVersion.Length, out nRealSize); LastErrCode = DIO_API.DIO_Initialize(); if (LastErrCode != IMC_ERR_NO_ERROR) { MessageBox.Show("Fails to start up the IO library"); return; } UInt32 voice_source; LastErrCode = DIO_API.DIO_GetVoiceSourceControlPin(out voice_source); if (LastErrCode != IMC_ERR_NO_ERROR) { MessageBox.Show("Fails to DIO_GetVoiceSourceControlPin " + LastErrCode.ToString("X4")); } if (voice_source == 1) { radioButtonVoiceSourceMicIN.Checked = true; } else { radioButtonVoiceSourceBluetooth.Checked = true; } UInt32 voice_module; LastErrCode = DIO_API.DIO_GetVoiceModuleSelectPin(out voice_module); if (LastErrCode != IMC_ERR_NO_ERROR) { MessageBox.Show("Fails to DIO_GetVoiceModuleSelectPin " + LastErrCode.ToString("X4")); } if (voice_module == 0) { radioButtonMC809X.Checked = true; } else { radioButtonMC73X4.Checked = true; } WriteDOPin(); }
private void DIO_Load(object sender, EventArgs e) { UInt16 LastErrCode; byte[] byLibVersion = new byte[DIO_API.IMC_LIB_VERSION_SIZE]; LastErrCode = DIO_API.DIO_GetLibVersion(byLibVersion); if (LastErrCode != IMC_ERR_NO_ERROR) { MessageBox.Show("Fails to get library version"); return; } int nRealSize; StaticLibVersionValue.Text = ConvertByte2String(byLibVersion, byLibVersion.Length, out nRealSize); LastErrCode = DIO_API.DIO_Initialize(); if (LastErrCode != IMC_ERR_NO_ERROR) { MessageBox.Show("Fails to start up the IO library"); return; } WriteDOPin(); }