[DllImport("RGUSBdrv.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern byte SendConfiguration(char[] FileName, out short Status);
0 if successfully sent.
If the function returns 0, check Status.
private void btnSendConfiguration_Click(object sender, EventArgs e)
{
if (dlgOpenRxc.ShowDialog() == DialogResult.OK)
{
byte Res;
short Status;
if (Connected) //Check if the logger is connected
{
Res = SendConfiguration((dlgOpenRxc.FileName + '\0').ToCharArray(), out Status);
if (Res == 0)
{
if (Status != 0)
MessageBox.Show("Bad Config");
MessageBox.Show("Logger Configured Successfully");
}
else
MessageBox.Show("Communication Error");
}
}
}