Exemple #1
0
        private void btnWrite_Click(object sender, RoutedEventArgs e)
        {
            int deviceId = DeviceId;

            CH341NativeFunctions.CH341OpenDevice(deviceId);
            String outStr = String.Format("{0}\0", tbInput.Text);

            PrintRight("Write status: {0}: {1}\n", CH341NativeFunctions.CH341WriteEEPROM(deviceId, EEPROM_TYPE.ID_24C128, 0, outStr.Length, outStr.GetBytes()) ? "Success!" : "Fail", outStr);
            CH341NativeFunctions.CH341CloseDevice(deviceId);
        }