commit 0fb23abb1870daafbb41e49c8e8aa71b0f149c9d Author: Razvalyaev Date: Wed Sep 10 16:54:28 2025 +0300 терминалка для теста бутлоадера diff --git a/botterm/.vs/botterm/v16/.suo b/botterm/.vs/botterm/v16/.suo new file mode 100644 index 0000000..f5ecd22 Binary files /dev/null and b/botterm/.vs/botterm/v16/.suo differ diff --git a/botterm/botterm.sln b/botterm/botterm.sln new file mode 100644 index 0000000..f0daf7d --- /dev/null +++ b/botterm/botterm.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.33529.622 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "botterm", "botterm\botterm.csproj", "{248BA4E9-444C-4D5E-B605-C371546F8AD5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {248BA4E9-444C-4D5E-B605-C371546F8AD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {248BA4E9-444C-4D5E-B605-C371546F8AD5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {248BA4E9-444C-4D5E-B605-C371546F8AD5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {248BA4E9-444C-4D5E-B605-C371546F8AD5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1A1E4955-8F78-4ABA-B16F-E5D8666613E1} + EndGlobalSection +EndGlobal diff --git a/botterm/botterm/App.config b/botterm/botterm/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/botterm/botterm/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/botterm/botterm/BootloaderCommands.cs b/botterm/botterm/BootloaderCommands.cs new file mode 100644 index 0000000..c32c9d1 --- /dev/null +++ b/botterm/botterm/BootloaderCommands.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BootloaderGUI +{ + public static class BootloaderCommands + { + // Bootloader settings + public const byte ERASE = 0x01; + public const byte RECEIVE = 0x02; + public const byte WRITE = 0x03; + public const byte VERIFY = 0x04; + public const byte JUMP = 0x05; + public const byte RESET = 0x06; + public const byte GO_TO_BOOT = 0x07; + + public const int PAGE_SIZE = 2048; + public const int CAN_ID_BOOTLOADER = 0x123; + // Если нужно, можно добавить дополнительные команды + // public const byte CUSTOM = 0x08; + } +} diff --git a/botterm/botterm/CanInterface.cs b/botterm/botterm/CanInterface.cs new file mode 100644 index 0000000..3e66893 --- /dev/null +++ b/botterm/botterm/CanInterface.cs @@ -0,0 +1,238 @@ +using System; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace BootloaderGUI +{ + public class CanInterface + { + private const string DLL_NAME = "slcan.dll"; + public IntPtr hDevice { get; private set; } = IntPtr.Zero; + private bool slcanLoaded = false; + + + public const ushort SLCAN_BR_CIA_1000K = 0x8000; + public const ushort SLCAN_BR_CIA_800K = 0x8001; + public const ushort SLCAN_BR_CIA_500K = 0x8002; + public const ushort SLCAN_BR_CIA_250K = 0x8003; + public const ushort SLCAN_BR_CIA_125K = 0x8004; + + public const uint SLCAN_MODE_CONFIG = 0x00; + public const uint SLCAN_MODE_NORMAL = 0x01; + public const uint SLCAN_MODE_LISTENONLY = 0x02; + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + private struct SLCAN_MESSAGE + { + public byte Info; + public uint ID; + public byte DataCount; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public byte[] Data; + } + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + private static extern bool SlCan_Load(IntPtr deviceCallback, IntPtr listCallback); + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + private static extern bool SlCan_Free([MarshalAs(UnmanagedType.Bool)] bool bDoCallBack); + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + private static extern uint SlCan_GetDeviceCount(); + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + private static extern IntPtr SlCan_GetDevice(uint dwIndex); + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + private static extern bool SlCan_DeviceOpen(IntPtr hDevice); + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + private static extern bool SlCan_DeviceClose(IntPtr hDevice); + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + private static extern bool SlCan_DeviceWriteMessages(IntPtr hDevice, [In] SLCAN_MESSAGE[] pMsg, uint dwCount, out byte pbStatus); + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + public static extern bool SlCan_DeviceSetMode(IntPtr hDevice, uint mode); + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + private static extern bool SlCan_DeviceEnaRec(IntPtr hDevice, byte bValue); + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + private struct SLCAN_STATE + { + public byte BusMode; + public byte Dummy1; + public byte ErrCountRX; + public byte ErrCountTX; + } + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + private static extern bool SlCan_DeviceGetState(IntPtr hDevice, out SLCAN_STATE state); + + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct SLCAN_BITRATE + { + public ushort BRP; + public byte TSEG1; + public byte TSEG2; + public byte SJW; + public byte SAM; + } + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + public static extern bool SlCan_DeviceSetBitRate(IntPtr hDevice, ref SLCAN_BITRATE bitrate); + + [DllImport(DLL_NAME, CallingConvention = CallingConvention.StdCall)] + public static extern bool SlCan_DeviceGetBitRate(IntPtr hDevice, ref SLCAN_BITRATE bitrate); + + + public bool Load() + { + if (slcanLoaded) return true; + slcanLoaded = SlCan_Load(IntPtr.Zero, IntPtr.Zero); + return slcanLoaded; + } + + public void Free() + { + if (slcanLoaded) + { + SlCan_Free(false); + slcanLoaded = false; + } + } + + public bool ConnectFirstDevice(out string statusText) + { + statusText = ""; + + if (!slcanLoaded && !Load()) + { + statusText = "slcan.dll not loaded"; + return false; + } + + uint count = SlCan_GetDeviceCount(); + if (count == 0) + { + MessageBox.Show("No SLCAN devices found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + statusText = "No devices"; + return false; + } + + IntPtr dev = SlCan_GetDevice(0); + if (dev == IntPtr.Zero) + { + MessageBox.Show("Failed to get device 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + statusText = "GetDevice failed"; + return false; + } + + if (!SlCan_DeviceOpen(dev)) + { + MessageBox.Show("Failed to open device", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + statusText = "Device open failed"; + return false; + } + + hDevice = dev; + + // Включаем приём сообщений + SlCan_DeviceEnaRec(hDevice, 1); + + // Получаем состояние шины (если у тебя есть функция SlCan_DeviceGetState) + SLCAN_STATE state; + if (!SlCan_DeviceGetState(hDevice, out state)) + { + statusText = "Failed to read bus state"; + } + + // Перевести устройство в конфиг-режим + if (!SlCan_DeviceSetMode(hDevice, SLCAN_MODE_CONFIG)) + { + MessageBox.Show("Failed to set CAN mode", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + statusText = "Device open failed"; + return false; + } + + SLCAN_BITRATE br = new SLCAN_BITRATE + { + BRP = SLCAN_BR_CIA_250K, + TSEG1 = 0, + TSEG2 = 0, + SJW = 0, + SAM = 0 + }; + + // Установить скорость CAN + if (!SlCan_DeviceSetBitRate(hDevice, ref br)) + { + MessageBox.Show("Failed to set CAN speed", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + statusText = "Device open failed"; + return false; + } + + // Перевести устройство в нормальный режим + if (!SlCan_DeviceSetMode(hDevice, SLCAN_MODE_NORMAL)) + { + MessageBox.Show("Failed to set CAN mode", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + statusText = "Device open failed"; + return false; + } + + statusText = $"Connected to device 0 (devices: {count})"; + return true; + } + + + public bool SendCmd(byte cmd) + { + if (hDevice == IntPtr.Zero) return false; + SLCAN_MESSAGE msg = new SLCAN_MESSAGE + { + Info = 0, + ID = BootloaderCommands.CAN_ID_BOOTLOADER, + DataCount = 8, + Data = new byte[8] + }; + msg.Data[0] = cmd; + + return SlCan_DeviceWriteMessages(hDevice, new SLCAN_MESSAGE[] { msg }, 1, out _); + } + + public bool SendData(byte[] data) + { + if (hDevice == IntPtr.Zero) return false; + int totalBytes = data.Length; + int step = 8; + + for (int offset = 0; offset < totalBytes; offset += step) + { + int chunkLen = Math.Min(step, totalBytes - offset); + SLCAN_MESSAGE msg = new SLCAN_MESSAGE + { + Info = 0, + ID = BootloaderCommands.CAN_ID_BOOTLOADER, + DataCount = 8, + Data = new byte[8] + }; + Array.Copy(data, offset, msg.Data, 0, chunkLen); + + if (!SlCan_DeviceWriteMessages(hDevice, new SLCAN_MESSAGE[] { msg }, 1, out _)) + return false; + } + return true; + } + + public void Disconnect() + { + if (hDevice != IntPtr.Zero) + { + SlCan_DeviceClose(hDevice); + hDevice = IntPtr.Zero; + } + } + } +} diff --git a/botterm/botterm/LowLevelBoot.cs b/botterm/botterm/LowLevelBoot.cs new file mode 100644 index 0000000..3c0892b --- /dev/null +++ b/botterm/botterm/LowLevelBoot.cs @@ -0,0 +1,121 @@ +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace BootloaderGUI +{ + public class LowLevelBootloaderTab + { + public TabPage Tab { get; private set; } + + private Label lblStatus; + private Button btnSelect, btnErase, btnReceive, btnWrite, btnVerify, btnJump, btnConnect; + private Button btnReset, btnGoBoot; + private NumericUpDown numPage; + private ProgressBar progressBar; + private Action connectAction; + + private byte[] fwData = null; + + // Сюда нужно передавать делегаты или интерфейс для CAN + private Func readFirmware; + private Func sendCmdSync; + private Action sendReceivePage; + + public LowLevelBootloaderTab( + Func readFirmwareDelegate, + Func sendCmdSyncDelegate, + Action sendReceivePageDelegate, + Label statusLabel, + Action connectCANDelegate) + { + readFirmware = readFirmwareDelegate; + sendCmdSync = sendCmdSyncDelegate; + sendReceivePage = sendReceivePageDelegate; + lblStatus = statusLabel; + connectAction = connectCANDelegate; + InitializeUI(); + } + + private void InitializeUI() + { + Tab = new TabPage("Low-Level Bootloader"); + + int left = 10; + int top = 10; + int wBtn = 200; + int hBtn = 30; + int gap = 10; + + lblStatus = new Label() { Top = top, Left = left, Width = 520, Text = "Select firmware file" }; + Tab.Controls.Add(lblStatus); + + top += 30; + btnSelect = new Button() { Top = top, Left = left, Width = wBtn, Text = "Select Firmware" }; + btnConnect = new Button() { Top = top, Left = left + wBtn + gap, Width = wBtn, Text = "Connect CAN" }; + Tab.Controls.AddRange(new Control[] { btnSelect, btnConnect }); + + top += hBtn + gap; + numPage = new NumericUpDown() { Top = top, Left = left, Width = 120, Minimum = 0, Maximum = 0 }; + Tab.Controls.Add(numPage); + + top += numPage.Height + gap; + btnErase = new Button() { Top = top, Left = left, Width = wBtn, Text = "ERASE" }; + btnReceive = new Button() { Top = top, Left = left + wBtn + gap, Width = wBtn, Text = "RECEIVE Page" }; + Tab.Controls.AddRange(new Control[] { btnErase, btnReceive }); + + top += hBtn + gap; + btnWrite = new Button() { Top = top, Left = left, Width = wBtn, Text = "WRITE" }; + btnVerify = new Button() { Top = top, Left = left + wBtn + gap, Width = wBtn, Text = "VERIFY" }; + Tab.Controls.AddRange(new Control[] { btnWrite, btnVerify }); + + top += hBtn + gap; + btnJump = new Button() { Top = top, Left = left, Width = wBtn, Text = "JUMP" }; + btnReset = new Button() { Top = top, Left = left + wBtn + gap, Width = wBtn, Text = "RESET" }; + btnGoBoot = new Button() { Top = top + hBtn + gap, Left = left, Width = wBtn, Text = "GO TO BOOT" }; + Tab.Controls.AddRange(new Control[] { btnJump, btnReset, btnGoBoot }); + + top += 2 * hBtn + 2 * gap; + progressBar = new ProgressBar() { Top = top, Left = left, Width = 520, Height = 22 }; + Tab.Controls.Add(progressBar); + + // события + btnSelect.Click += (s, e) => + { + int pageMax = readFirmware(); + numPage.Maximum = pageMax; + }; + btnConnect.Click += (s, e) => connectAction?.Invoke(); + btnErase.Click += (s, e) => sendCmdSync(BootloaderCommands.ERASE); + btnReceive.Click += (s, e) => sendReceivePage((int)numPage.Value); + btnWrite.Click += (s, e) => sendCmdSync(BootloaderCommands.WRITE); + btnVerify.Click += (s, e) => sendCmdSync(BootloaderCommands.VERIFY); + btnJump.Click += (s, e) => sendCmdSync(BootloaderCommands.JUMP); + btnReset.Click += (s, e) => sendCmdSync(BootloaderCommands.RESET); + btnGoBoot.Click += (s, e) => sendCmdSync(BootloaderCommands.GO_TO_BOOT); + + } + + + // Методы обновления UI из MainForm + public void UpdateStatus(string text) + { + if (Tab.InvokeRequired) + Tab.Invoke(new Action(() => lblStatus.Text = text)); + else + lblStatus.Text = text; + } + + public void UpdateProgress(int percent) + { + if (percent < 0) percent = 0; + if (percent > 100) percent = 100; + if (Tab.InvokeRequired) + Tab.Invoke(new Action(() => progressBar.Value = percent)); + else + progressBar.Value = percent; + } + } +} diff --git a/botterm/botterm/Program.cs b/botterm/botterm/Program.cs new file mode 100644 index 0000000..1323527 --- /dev/null +++ b/botterm/botterm/Program.cs @@ -0,0 +1,245 @@ +using System; +using System.IO; +using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace BootloaderGUI +{ + static class Program + { + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } + + public class MainForm : Form + { + // UI + private LowLevelBootloaderTab llTab; + private Label lblStatus; + private ProgressBar progressBar; + + + // CAN SETTINGS + private CanInterface can; + + + private byte[] fwData = null; + private int totalPages = 0; + + + private TabControl tabControl; + + public MainForm() + { + InitializeUI(); + can = new CanInterface(); + + llTab = new LowLevelBootloaderTab( + readFirmwareDelegate: ReadFirmware, + sendCmdSyncDelegate: SendCmdSync, + sendReceivePageDelegate: SendReceivePage, + statusLabel: lblStatus, + connectCANDelegate: ConnectCan + ); + tabControl.TabPages.Add(llTab.Tab); + } + + + private void InitializeUI() + { + this.Text = "Bootloader Tool"; + this.Width = 520; + this.Height = 420; + this.FormBorderStyle = FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + + // Label статуса сверху + lblStatus = new Label() + { + Top = 10, + Left = 10, + Width = 480, + Height = 20, + Text = "Ready" + }; + this.Controls.Add(lblStatus); + + // создаём TabControl + tabControl = new TabControl() + { + Top = 40, + Left = 10, + Width = 480, + Height = 300 // уменьшаем, чтобы помещался ProgressBar снизу + }; + this.Controls.Add(tabControl); + + // создаём ProgressBar под вкладками + progressBar = new ProgressBar() + { + Top = tabControl.Bottom + 10, // сразу под TabControl + Left = 10, + Width = 480, + Height = 22, + Value = 0 + }; + this.Controls.Add(progressBar); + } + + + + private void MainForm_FormClosing(object sender, FormClosingEventArgs e) + { + try + { + can?.Disconnect(); + can?.Free(); + } + catch { } + } + + + private void ConnectCan() + { + if (can.ConnectFirstDevice(out string status)) + { + lblStatus.Text = status; + } + else + { + MessageBox.Show(status, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + lblStatus.Text = status; + } + } + + private int ReadFirmware() + { + int page_max = 0; + + using (OpenFileDialog dlg = new OpenFileDialog()) + { + dlg.Filter = "Binary Files (*.bin)|*.bin"; + if (dlg.ShowDialog() == DialogResult.OK) + { + fwData = File.ReadAllBytes(dlg.FileName); + int totalPages = (fwData.Length + BootloaderCommands.PAGE_SIZE - 1) / BootloaderCommands.PAGE_SIZE; + page_max = Math.Max(0, totalPages - 1); + progressBar.Value = 0; + lblStatus.Text = $"File loaded. Total pages: {totalPages}"; + } + } + + return page_max; + } + + + private void SendReceivePage(int pageNum) + { + try + { + if (fwData == null) return; + + int start = pageNum * BootloaderCommands.PAGE_SIZE; + byte[] page = new byte[BootloaderCommands.PAGE_SIZE]; + int copyLen = Math.Min(BootloaderCommands.PAGE_SIZE, fwData.Length - start); + if (copyLen > 0) + Array.Copy(fwData, start, page, 0, copyLen); + if (copyLen < BootloaderCommands.PAGE_SIZE) + { + for (int i = copyLen; i < BootloaderCommands.PAGE_SIZE; ++i) + page[i] = 0xFF; + } + + // CRC32 (можно оставить заглушкой, как у тебя) + uint crc = 123; + byte[] crcBE = new byte[4]; + crcBE[0] = (byte)((crc >> 24) & 0xFF); + crcBE[1] = (byte)((crc >> 16) & 0xFF); + crcBE[2] = (byte)((crc >> 8) & 0xFF); + crcBE[3] = (byte)(crc & 0xFF); + + byte[] full = new byte[BootloaderCommands.PAGE_SIZE + 4]; + Array.Copy(page, 0, full, 0, BootloaderCommands.PAGE_SIZE); + Array.Copy(crcBE, 0, full, BootloaderCommands.PAGE_SIZE, 4); + + // Send RECEIVE command + if (!SendCmdSync(BootloaderCommands.RECEIVE)) + { + UpdateStatusOnUI("Failed to send RECEIVE command"); + return; + } + + // Отправляем данные через CanInterface + int totalBytes = full.Length; + int step = 8; + int sentBytes = 0; + + for (int offset = 0; offset < totalBytes; offset += step) + { + int chunkLen = Math.Min(step, totalBytes - offset); + byte[] chunk = new byte[8]; + Array.Copy(full, offset, chunk, 0, chunkLen); + + if (!can.SendData(chunk)) + { + UpdateStatusOnUI($"Failed to send data chunk at offset {offset}"); + return; + } + + sentBytes += chunkLen; + int percent = (int)((sentBytes * 100L) / totalBytes); + UpdateProgressOnUI(percent); + + Thread.Sleep(1); // throttle + } + + UpdateProgressOnUI(100); + UpdateStatusOnUI($"Page {pageNum} sent (RECEIVE)"); + } + catch (Exception ex) + { + UpdateStatusOnUI("Error during RECEIVE: " + ex.Message); + } + } + + private bool SendCmdSync(byte cmd) + { + if (can == null || !can.SendCmd(cmd)) + { + MessageBox.Show("CAN device not connected or send failed", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return false; + } + + UpdateStatusOnUI($"Command 0x{cmd:X2} sent"); + return true; + } + + + private void UpdateStatusOnUI(string text) + { + if (this.InvokeRequired) + this.Invoke(new Action(() => lblStatus.Text = text)); + else + lblStatus.Text = text; + } + + + private void UpdateProgressOnUI(int percent) + { + if (percent < 0) percent = 0; + if (percent > 100) percent = 100; + if (this.InvokeRequired) + this.Invoke(new Action(() => progressBar.Value = percent)); + else + progressBar.Value = percent; + } + + } +} diff --git a/botterm/botterm/Properties/AssemblyInfo.cs b/botterm/botterm/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b813935 --- /dev/null +++ b/botterm/botterm/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("botterm")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("botterm")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("248ba4e9-444c-4d5e-b605-c371546f8ad5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/botterm/botterm/Properties/Resources.Designer.cs b/botterm/botterm/Properties/Resources.Designer.cs new file mode 100644 index 0000000..6bb0dd9 --- /dev/null +++ b/botterm/botterm/Properties/Resources.Designer.cs @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +namespace botterm.Properties +{ + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("botterm.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/botterm/botterm/Properties/Resources.resx b/botterm/botterm/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/botterm/botterm/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/botterm/botterm/Properties/Settings.Designer.cs b/botterm/botterm/Properties/Settings.Designer.cs new file mode 100644 index 0000000..0f06631 --- /dev/null +++ b/botterm/botterm/Properties/Settings.Designer.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +namespace botterm.Properties +{ + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/botterm/botterm/Properties/Settings.settings b/botterm/botterm/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/botterm/botterm/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/botterm/botterm/bin/Debug/botterm.exe b/botterm/botterm/bin/Debug/botterm.exe new file mode 100644 index 0000000..cbcbe8d Binary files /dev/null and b/botterm/botterm/bin/Debug/botterm.exe differ diff --git a/botterm/botterm/bin/Debug/botterm.exe.config b/botterm/botterm/bin/Debug/botterm.exe.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/botterm/botterm/bin/Debug/botterm.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/botterm/botterm/bin/Debug/botterm.pdb b/botterm/botterm/bin/Debug/botterm.pdb new file mode 100644 index 0000000..941cf8a Binary files /dev/null and b/botterm/botterm/bin/Debug/botterm.pdb differ diff --git a/botterm/botterm/bin/Debug/slcan.dll b/botterm/botterm/bin/Debug/slcan.dll new file mode 100644 index 0000000..2b63623 Binary files /dev/null and b/botterm/botterm/bin/Debug/slcan.dll differ diff --git a/botterm/botterm/bin/Debug/slcan.h b/botterm/botterm/bin/Debug/slcan.h new file mode 100644 index 0000000..c9dc89e --- /dev/null +++ b/botterm/botterm/bin/Debug/slcan.h @@ -0,0 +1,510 @@ +#ifndef __SLCAN_H__ +#define __SLCAN_H__ + +#include + +#define STDCALL __stdcall +#ifdef SLCAN_EXPORT +#define SLCANAPI __declspec(dllexport) +#else +#define SLCANAPI __declspec(dllimport) +#endif + +#define SLCAN_PROPERTY_INDEX_LINKNAME 0 +#define SLCAN_PROPERTY_INDEX_INSTANCEID 1 + +#define SLCAN_PROPERTY_INDEX_DEVICEDESC 2 +#define SLCAN_PROPERTY_INDEX_FRIENDLYNAME 3 +#define SLCAN_PROPERTY_INDEX_PHOBJECTNAME 4 +#define SLCAN_PROPERTY_INDEX_MFG 5 +#define SLCAN_PROPERTY_INDEX_LOCATIONINFO 6 +#define SLCAN_PROPERTY_INDEX_ENUMERATOR 7 +#define SLCAN_PROPERTY_INDEX_CLASS 8 +#define SLCAN_PROPERTY_INDEX_CLASSGUID 9 +#define SLCAN_PROPERTY_INDEX_SERVICE 10 +#define SLCAN_PROPERTY_INDEX_DRIVER 11 +#define SLCAN_PROPERTY_INDEX_PORTNAME 12 +#define SLCAN_PROPERTY_INDEX_PRODUCT 13L +#define SLCAN_PROPERTY_INDEX_MANUFACTURER 14L +#define SLCAN_PROPERTY_INDEX_CONFIGURATION 15L +#define SLCAN_PROPERTY_INDEX_INTERFACE 16L +#define SLCAN_PROPERTY_INDEX_SERIAL 17L +#define SLCAN_PROPERTY_INDEX_ALIAS 18L +#define SLCAN_PROPERTY_INDEX_CHANNELLINK 19L +#define SLCAN_PROPERTY_INDEX_SERIALID 20L + + +#define SLCAN_MODE_CONFIG 0x00 +#define SLCAN_MODE_NORMAL 0x01 +#define SLCAN_MODE_LISTENONLY 0x02 +#define SLCAN_MODE_LOOPBACK 0x03 +#define SLCAN_MODE_SLEEP 0x04 + +#define SLCAN_BR_CIA_1000K 0x8000 +#define SLCAN_BR_CIA_800K 0x8001 +#define SLCAN_BR_CIA_500K 0x8002 +#define SLCAN_BR_CIA_250K 0x8003 +#define SLCAN_BR_CIA_125K 0x8004 +#define SLCAN_BR_CIA_50K 0x8005 +#define SLCAN_BR_CIA_20K 0x8006 +#define SLCAN_BR_CIA_10K 0x8007 +#define SLCAN_BR_400K 0x8008 +#define SLCAN_BR_200K 0x8009 +#define SLCAN_BR_100K 0x800A +#define SLCAN_BR_83333 0x800B +#define SLCAN_BR_33333 0x800C +#define SLCAN_BR_25K 0x800D +#define SLCAN_BR_5K 0x800E +#define SLCAN_BR_30K 0x800F +#define SLCAN_BR_300K 0x8010 +#define SLCAN_BR_LASTINDEX SLCAN_BR_300K + + + + + +#define SLCAN_CAP_MODE_NORMAL 0x01 +#define SLCAN_CAP_MODE_LISTEN_ONLY 0x02 +#define SLCAN_CAP_MODE_LOOP_BACK 0x04 +#define SLCAN_CAP_MODE_SLEEP 0x08 + +#define SLCAN_CAP_TXMODE_ONE_SHOT 0x01 +#define SLCAN_CAP_TXMODE_TIMESTAMP 0x02 + + +#define SLCAN_CAP_CONTR_EXTERNAL 0x00 +#define SLCAN_CAP_CONTR_MCP2515 0x01 +#define SLCAN_CAP_CONTR_SJA1000 0x02 + +#define SLCAN_CAP_CONTR_INTERNAL 0x80 +#define SLCAN_CAP_CONTR_LPC 0x81 +#define SLCAN_CAP_CONTR_STM32 0x82 +#define SLCAN_CAP_CONTR_STM8 0x83 +#define SLCAN_CAP_CONTR_PIC 0x84 +#define SLCAN_CAP_CONTR_PIC_ECAN 0x85 + +#define SLCAN_CAP_PHYS_HS 0x01 +#define SLCAN_CAP_PHYS_LS 0x02 +#define SLCAN_CAP_PHYS_SW 0x04 +#define SLCAN_CAP_PHYS_J1708 0x08 +#define SLCAN_CAP_PHYS_LIN 0x10 +#define SLCAN_CAP_PHYS_KLINE 0x20 + +#define SLCAN_CAP_PHYS_LOAD 0x01 + +#define SLCAN_CAP_BITRATE_INDEX 0x01 +#define SLCAN_CAP_BITRATE_CUSTOM 0x02 +#define SLCAN_CAP_BITRATE_AUTOMATIC 0x04 + + +#define SLCAN_EVT_LEVEL_RX_MSG 0 +#define SLCAN_EVT_LEVEL_TIME_STAMP 1 +#define SLCAN_EVT_LEVEL_TX_MSG 2 +#define SLCAN_EVT_LEVEL_BUS_STATE 3 +#define SLCAN_EVT_LEVEL_COUNTS 4 +#define SLCAN_EVT_LEVEL_ERRORS 5 + +#define SLCAN_EVT_TYPE_RX 0x0 +#define SLCAN_EVT_TYPE_START_TX 0x1 +#define SLCAN_EVT_TYPE_END_TX 0x2 +#define SLCAN_EVT_TYPE_ABORT_TX 0x3 +#define SLCAN_EVT_TYPE_BUS_STATE 0x4 +#define SLCAN_EVT_TYPE_ERROR_COUNTS 0x5 +#define SLCAN_EVT_TYPE_BUS_ERROR 0x6 +#define SLCAN_EVT_TYPE_ARBITRATION_ERROR 0x7 +#define SLCAN_EVT_STAMP_INC 0xF + +#define SLCAN_BUS_STATE_ERROR_ACTIVE 0x00 +#define SLCAN_BUS_STATE_ERROR_ACTIVE_WARN 0x01 +#define SLCAN_BUS_STATE_ERROR_PASSIVE 0x02 +#define SLCAN_BUS_STATE_BUSOFF 0x03 + +#define SLCAN_MES_INFO_EXT 0x01 +#define SLCAN_MES_INFO_RTR 0x02 +#define SLCAN_MES_INFO_ONESHOT 0x04 + + + +#define SLCAN_DEVOP_CREATE 0x00000000 +#define SLCAN_DEVOP_CREATEHANDLE 0x00000001 +#define SLCAN_DEVOP_OPEN 0x00000002 +#define SLCAN_DEVOP_CLOSE 0x00000003 +#define SLCAN_DEVOP_DESTROYHANDLE 0x00000004 +#define SLCAN_DEVOP_DESTROY 0x00000005 + + +#define SLCAN_INVALID_HANDLE_ERROR 0xE0001001 +#define SLCAN_DEVICE_INVALID_HANDLE_ERROR 0xE0001120 +#define SLCAN_HANDLE_INIT_ERROR 0xE0001017 +#define SLCAN_DEVICE_NOTOPEN_ERROR 0xE0001121 + +#define SLCAN_EVT_ERR_TYPE_BIT 0x00 +#define SLCAN_EVT_ERR_TYPE_FORM 0x01 +#define SLCAN_EVT_ERR_TYPE_STUFF 0x02 +#define SLCAN_EVT_ERR_TYPE_OTHER 0x03 + +#define SLCAN_EVT_ERR_DIR_TX 0x00 +#define SLCAN_EVT_ERR_DIR_RX 0x01 + +#define SLCAN_EVT_ERR_FRAME_SOF 0x03 +#define SLCAN_EVT_ERR_FRAME_ID28_ID21 0x02 +#define SLCAN_EVT_ERR_FRAME_ID20_ID18 0x06 +#define SLCAN_EVT_ERR_FRAME_SRTR 0x04 +#define SLCAN_EVT_ERR_FRAME_IDE 0x05 +#define SLCAN_EVT_ERR_FRAME_ID17_ID13 0x07 +#define SLCAN_EVT_ERR_FRAME_ID12_ID5 0x0F +#define SLCAN_EVT_ERR_FRAME_ID4_ID0 0x0E +#define SLCAN_EVT_ERR_FRAME_RTR 0x0C +#define SLCAN_EVT_ERR_FRAME_RSRV0 0x0D +#define SLCAN_EVT_ERR_FRAME_RSRV1 0x09 +#define SLCAN_EVT_ERR_FRAME_DLC 0x0B +#define SLCAN_EVT_ERR_FRAME_DATA 0x0A +#define SLCAN_EVT_ERR_FRAME_CRC_SEQ 0x08 +#define SLCAN_EVT_ERR_FRAME_CRC_DEL 0x18 +#define SLCAN_EVT_ERR_FRAME_ACK_SLOT 0x19 +#define SLCAN_EVT_ERR_FRAME_ACK_DEL 0x1B +#define SLCAN_EVT_ERR_FRAME_EOF 0x1A +#define SLCAN_EVT_ERR_FRAME_INTER 0x12 +#define SLCAN_EVT_ERR_FRAME_AER_FLAG 0x11 +#define SLCAN_EVT_ERR_FRAME_PER_FLAG 0x16 +#define SLCAN_EVT_ERR_FRAME_TDB 0x13 +#define SLCAN_EVT_ERR_FRAME_ERR_DEL 0x17 +#define SLCAN_EVT_ERR_FRAME_OVER_FLAG 0x1C + +#define SLCAN_TX_STATUS_OK 0x00 +#define SLCAN_TX_STATUS_TIMEOUT 0x01 +#define SLCAN_TX_STATUS_BUSOFF 0x02 +#define SLCAN_TX_STATUS_ABORT 0x03 +#define SLCAN_TX_STATUS_NOT_ENA 0x04 +#define SLCAN_TX_STATUS_ERROR_ONE_SHOT 0x05 +#define SLCAN_TX_STATUS_INVALID_MODE 0x06 +#define SLCAN_TX_STATUS_UNKNOWN 0x0F + +#define SLCAN_PURGE_TX_ABORT 0x01 +#define SLCAN_PURGE_RX_ABORT 0x02 +#define SLCAN_PURGE_TX_CLEAR 0x04 +#define SLCAN_PURGE_RX_CLEAR 0x08 + +#pragma pack(push,1) + +#ifdef __cplusplus +extern "C"{ +#endif + +typedef PVOID HSLCAN; + +typedef struct _SLCAN_CAPABILITIES{ + + BYTE bModes; + BYTE bTXModes; + BYTE bMaxEventLevel; + BYTE bController; + BYTE bPhysical; + BYTE bPhysicalLoad; + BYTE bBitrates; + BYTE bAdvancedModes; + DWORD dwCanBaseClk; + DWORD dwTimeStampClk; + WORD wMaxBRP; +}SLCAN_CAPABILITIES,*PSLCAN_CAPABILITIES; + +typedef struct _SLCAN_BITRATE { + WORD BRP; + BYTE TSEG1; + BYTE TSEG2; + BYTE SJW; + BYTE SAM; +}SLCAN_BITRATE,*PSLCAN_BITRATE; + + +typedef void (STDCALL* SLCAN_DEVICE_CALLBACK)( + HSLCAN hDevice, + DWORD dwIndex, + DWORD dwOperation, + PVOID pContext, + DWORD dwContextSize +); + +typedef VOID (STDCALL* SLCAN_DEVICELIST_CALLBACK)( + HSLCAN hDevice, + DWORD dwIndex, + PVOID pContext, + DWORD dwContextSize +); + +typedef struct _SLCAN_MESSAGE{ + BYTE Info; + DWORD ID; + BYTE DataCount; + BYTE Data[8]; +}SLCAN_MESSAGE,*PSLCAN_MESSAGE; + +typedef struct _SLCAN_TXMESSAGE{ + LONG dwDelay; + SLCAN_MESSAGE Msg; +}SLCAN_TXMESSAGE,*PSLCAN_TXMESSAGE; + +typedef struct _SLCAN_EVENT{ + BYTE EventType; + DWORD TimeStampLo; + union { + SLCAN_MESSAGE Msg; + DWORD TimeStamp[2]; + DWORD64 TimeStamp64; + struct { + BYTE BusMode; + BYTE Dummy1; + BYTE ErrCountRx; + BYTE ErrCountTx; + BYTE ErrType; + BYTE ErrDir; + BYTE ErrFrame; + BYTE LostArbitration; + }; + }; +}SLCAN_EVENT,*PSLCAN_EVENT; + +typedef struct _SLCAN_STATE{ + BYTE BusMode; + BYTE Dummy1; + BYTE ErrCountRX; + BYTE ErrCountTX; +}SLCAN_STATE,*PSLCAN_STATE; + +typedef union _SLCAN_TIMESTAMP{ + UINT64 Value; + DWORD dwValue[2]; + USHORT wValue[4]; + BYTE bValue[8]; +}SLCAN_TIMESTAMP,*PSLCAN_TIMESTAMP; + + + +SLCANAPI BOOL STDCALL SlCan_Load( + SLCAN_DEVICE_CALLBACK DeviceProc, + SLCAN_DEVICELIST_CALLBACK DeviceListProc +); + +SLCANAPI BOOL STDCALL SlCan_Free( + BOOL bDoCallBack +); + +SLCANAPI BOOL STDCALL SlCan_Update(); + +SLCANAPI HSLCAN STDCALL SlCan_GetDevice( + DWORD dwIndex +); + +SLCANAPI DWORD STDCALL SlCan_GetDeviceCount(); + + +SLCANAPI HANDLE STDCALL SlCan_DeviceGetHandle( + DWORD dwIndex +); + +SLCANAPI DWORD STDCALL SlCan_DeviceGetProperty( + HSLCAN hDevice, + DWORD dwIndex, + PCHAR pBuf, + DWORD dwSize +); + +SLCANAPI DWORD STDCALL SlCan_DeviceGetPropertyW( + HSLCAN hDevice, + DWORD dwIndex, + PWCHAR pBuf, + DWORD dwSize +); + +SLCANAPI HKEY STDCALL SlCan_DeviceGetRegKey( + HSLCAN hDevice, + DWORD dwIndex +); + +SLCANAPI PVOID STDCALL SlCan_DeviceSetContext( + HSLCAN hDevice, + PVOID pBuf, + DWORD dwBufSize +); + +SLCANAPI PVOID STDCALL SlCan_DeviceGetContext( + HSLCAN hDevice +); + +SLCANAPI DWORD STDCALL SlCan_DeviceGetContextSize( + HSLCAN hDevice +); + +SLCANAPI BOOL STDCALL SlCan_DeviceSetAlias( + HSLCAN hDevice, + PCHAR pBuf +); + +SLCANAPI BOOL STDCALL SlCan_DeviceSetAliasW( + HSLCAN hDevice, + PWCHAR pBuf +); + +SLCANAPI DWORD STDCALL SlCan_DeviceGetAlias( + HSLCAN hDevice, + PCHAR pBuf, + DWORD dwSize +); + +SLCANAPI DWORD STDCALL SlCan_DeviceGetAliasW( + HSLCAN hDevice, + PWCHAR pBuf, + DWORD dwSize +); +SLCANAPI BOOL STDCALL SlCan_DeviceGetCapabilities( + HSLCAN hDevice, + PSLCAN_CAPABILITIES pCapabilities +); + +SLCANAPI BOOL STDCALL SlCan_DeviceOpen( + HSLCAN hDevice +); + +SLCANAPI BOOL STDCALL SlCan_DeviceClose( + HSLCAN hDevice +); + +SLCANAPI BOOL STDCALL SlCan_DeviceSetMode( + HSLCAN hDevice, + DWORD dwMode +); +SLCANAPI BOOL STDCALL SlCan_DeviceGetMode( + HSLCAN hDevice, + PDWORD pdwMode +); + +SLCANAPI BOOL STDCALL SlCan_DeviceGetState( + HSLCAN hDevice, + PSLCAN_STATE pState +); + + +SLCANAPI BOOL STDCALL SlCan_DeviceSetTXTimeOut( + HSLCAN hDevice, + DWORD dwMillisecond +); +SLCANAPI BOOL STDCALL SlCan_DeviceGetTXTimeOut( + HSLCAN hDevice, + PDWORD pdwMillisecond +); + +SLCANAPI BOOL STDCALL SlCan_DeviceGetBitRate( + HSLCAN hDevice, + PSLCAN_BITRATE pBitRate +); + +SLCANAPI BOOL STDCALL SlCan_DeviceSetBitRate( + HSLCAN hDevice, + PSLCAN_BITRATE pBitRate +); + + +SLCANAPI BOOL STDCALL SlCan_DeviceEnaRec( + HSLCAN hDevice, + BYTE bValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceSetLatency( + HSLCAN hDevice, + BYTE bValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceGetLatency( + HSLCAN hDevice, + PBYTE pbValue +); + +SLCANAPI BOOL STDCALL SlCan_DevicePurge( + HSLCAN hDevice, + BYTE bValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceSetEventLevel( + HSLCAN hDevice, + BYTE bValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceGetEventLevel( + HSLCAN hDevice, + PBYTE pbValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceSetStartTimeStamp( + HSLCAN hDevice, + PSLCAN_TIMESTAMP pValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceGetStartTimeStamp( + HSLCAN hDevice, + PSLCAN_TIMESTAMP pValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceGetTimeStamp( + HSLCAN hDevice, + PSLCAN_TIMESTAMP pValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceSetTimeStampPeriod( + HSLCAN hDevice, + LONG lValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceGetTimeStampPeriod( + HSLCAN hDevice, + PLONG plValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceSetExMode( + HSLCAN hDevice, + BYTE bValue +); + +SLCANAPI BOOL STDCALL SlCan_DeviceGetExMode( + HSLCAN hDevice, + PBYTE pbValue +); + + +SLCANAPI BOOL STDCALL SlCan_DeviceWriteMessages( + HSLCAN hDevice, + PSLCAN_MESSAGE pMsg, + DWORD dwCount, + PBYTE pbStatus +); + +SLCANAPI BOOL STDCALL SlCan_DeviceWriteMessagesEx( + HSLCAN hDevice, + PSLCAN_TXMESSAGE pMsg, + DWORD dwCount, + PBYTE pbStatus, + PDWORD pdwCount +); + +SLCANAPI BOOL STDCALL SlCan_DeviceReadMessages( + HSLCAN hDevice, + DWORD dwTimeOut, + PSLCAN_MESSAGE pMsg, + DWORD dwCount, + PDWORD pdwCount +); + +SLCANAPI BOOL STDCALL SlCan_DeviceReadEvents( + HSLCAN hDevice, + DWORD dwTimeOut, + PSLCAN_EVENT pEvent, + DWORD dwCount, + PDWORD pdwCount +); + +#ifdef __cplusplus +} +#endif + +#pragma pack(pop) + +#endif //__SLCAN_H diff --git a/botterm/botterm/bin/Debug/slcan.lib b/botterm/botterm/bin/Debug/slcan.lib new file mode 100644 index 0000000..04cd3c6 Binary files /dev/null and b/botterm/botterm/bin/Debug/slcan.lib differ diff --git a/botterm/botterm/botterm.csproj b/botterm/botterm/botterm.csproj new file mode 100644 index 0000000..1f4608f --- /dev/null +++ b/botterm/botterm/botterm.csproj @@ -0,0 +1,80 @@ + + + + + Debug + AnyCPU + {248BA4E9-444C-4D5E-B605-C371546F8AD5} + WinExe + botterm + botterm + v4.7.2 + 512 + true + true + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + BootloaderGUI.Program + + + + + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/botterm/botterm/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/botterm/botterm/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/botterm/botterm/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/botterm/botterm/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/botterm/botterm/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..6af2086 Binary files /dev/null and b/botterm/botterm/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/botterm/botterm/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/botterm/botterm/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..504d367 Binary files /dev/null and b/botterm/botterm/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/botterm/botterm/obj/Debug/botterm.Properties.Resources.resources b/botterm/botterm/obj/Debug/botterm.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/botterm/botterm/obj/Debug/botterm.Properties.Resources.resources differ diff --git a/botterm/botterm/obj/Debug/botterm.csproj.AssemblyReference.cache b/botterm/botterm/obj/Debug/botterm.csproj.AssemblyReference.cache new file mode 100644 index 0000000..f5e894a Binary files /dev/null and b/botterm/botterm/obj/Debug/botterm.csproj.AssemblyReference.cache differ diff --git a/botterm/botterm/obj/Debug/botterm.csproj.CoreCompileInputs.cache b/botterm/botterm/obj/Debug/botterm.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..1e128e0 --- /dev/null +++ b/botterm/botterm/obj/Debug/botterm.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +bc27571c42487534b7297bfdef2c705a3d0dd908 diff --git a/botterm/botterm/obj/Debug/botterm.csproj.FileListAbsolute.txt b/botterm/botterm/obj/Debug/botterm.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..b684c82 --- /dev/null +++ b/botterm/botterm/obj/Debug/botterm.csproj.FileListAbsolute.txt @@ -0,0 +1,9 @@ +F:\Work\Projects\bootterm\botterm\botterm\obj\Debug\botterm.csproj.AssemblyReference.cache +F:\Work\Projects\bootterm\botterm\botterm\obj\Debug\botterm.Properties.Resources.resources +F:\Work\Projects\bootterm\botterm\botterm\obj\Debug\botterm.csproj.GenerateResource.cache +F:\Work\Projects\bootterm\botterm\botterm\obj\Debug\botterm.csproj.CoreCompileInputs.cache +F:\Work\Projects\bootterm\botterm\botterm\bin\Debug\botterm.exe.config +F:\Work\Projects\bootterm\botterm\botterm\bin\Debug\botterm.exe +F:\Work\Projects\bootterm\botterm\botterm\bin\Debug\botterm.pdb +F:\Work\Projects\bootterm\botterm\botterm\obj\Debug\botterm.exe +F:\Work\Projects\bootterm\botterm\botterm\obj\Debug\botterm.pdb diff --git a/botterm/botterm/obj/Debug/botterm.csproj.GenerateResource.cache b/botterm/botterm/obj/Debug/botterm.csproj.GenerateResource.cache new file mode 100644 index 0000000..e8bae4b Binary files /dev/null and b/botterm/botterm/obj/Debug/botterm.csproj.GenerateResource.cache differ diff --git a/botterm/botterm/obj/Debug/botterm.exe b/botterm/botterm/obj/Debug/botterm.exe new file mode 100644 index 0000000..cbcbe8d Binary files /dev/null and b/botterm/botterm/obj/Debug/botterm.exe differ diff --git a/botterm/botterm/obj/Debug/botterm.pdb b/botterm/botterm/obj/Debug/botterm.pdb new file mode 100644 index 0000000..941cf8a Binary files /dev/null and b/botterm/botterm/obj/Debug/botterm.pdb differ diff --git a/firm.bin b/firm.bin new file mode 100644 index 0000000..4509e6d --- /dev/null +++ b/firm.bin @@ -0,0 +1 @@ +091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789091234567890912345678909123456789 \ No newline at end of file