Version:
1.0.0
Funktion:
Diese Bibliothek kann eine Datei mithilfe des YMODEM-Protokolls über eine Serielle Schnittstelle senden. Momentan ist nur das Senden einer Datei implementiert.
Verfügbare Funktionen:
Spoiler anzeigen
Aufruf:
Sonstige Details:
Programmiersprache: VB.NET
IDE: Visual Studio 2012 Ultimate
Framework: 4.5 (es wird momentan eine Funktion aus 4.5 gebraucht)
Download:
Im Anhang.
1.0.0
Funktion:
Diese Bibliothek kann eine Datei mithilfe des YMODEM-Protokolls über eine Serielle Schnittstelle senden. Momentan ist nur das Senden einer Datei implementiert.
Verfügbare Funktionen:
VB.NET-Quellcode
- ''' <summary>
- ''' This function sends a file with the ymodem protocol.
- ''' </summary>
- ''' <param name="PortName">the name of the port on which the file will be sent</param>
- ''' <param name="Baudrate">the baudrate of the port</param>
- ''' <param name="Timeout">the timeout in ms for this port</param>
- ''' <param name="FilePath">the path to the file which will be sent</param>
- ''' <returns>1: The file does not exist, 2: Could not open file, 3: Could not open the port, 5: Reached timeout, 6: Wrong acknowledge char received (or timeout), 7: Could not send block, 0: File sucessfully sent</returns>
- ''' <remarks></remarks>
- Public Function SendFile(ByVal PortName As String, ByVal Baudrate As Integer, ByVal Timeout As Integer, ByVal FilePath As String) As Integer
- ''' <summary>
- ''' This function sends a file asynchronus with the ymodem protocol. Use AsyncGetProgress to get the progress or AsyncIsFinished.
- ''' </summary>
- ''' <param name="PortName">the name of the port on which the file will be sent</param>
- ''' <param name="Baudrate">the baudrate of the port</param>
- ''' <param name="Timeout">the timeout in ms for this port</param>
- ''' <param name="FilePath">the path to the file which will be sent</param>
- ''' <returns>true: the sending of the file has started, false: the sending of the file could not be started</returns>
- ''' <remarks></remarks>
- Public Function SendFileAsync(ByVal PortName As String, ByVal Baudrate As Integer, ByVal Timeout As Integer, ByVal FilePath As String) As Boolean
- ''' <summary>
- ''' This function returns the actual progress of a sending started with SendFileAsync.
- ''' </summary>
- ''' <returns>the progress of the file which is currently sent</returns>
- ''' <remarks></remarks>
- Public Function AsyncGetProgress() As Integer
- ''' <summary>
- ''' Checks if a file transfer started with SendFileAsync is finished.
- ''' </summary>
- ''' <returns>-1: the file is still sent (not finished yet), 0: the file was sucessfully sent, 1: The file does not exist, 2: Could not open file, 3: Could not open the port, 5: Reached timeout, 6: Wrong acknowledge char received (or timeout), 7: Could not send block</returns>
- ''' <remarks></remarks>
- Public Function AsyncIsFinished() As Integer
- ''' <summary>
- ''' This function checks if a serial Port can be opened.
- ''' </summary>
- ''' <param name="PortName">the name of the port which should be tested</param>
- ''' <param name="Baudrate">the baudrate for this port</param>
- ''' <param name="Timeout">the timeout in ms for this port</param>
- ''' <returns>true: The Port could be opened, false: The Port could not be opened.</returns>
- ''' <remarks></remarks>
- Public Function CheckPort(ByVal PortName As String, ByVal Baudrate As Integer, ByVal Timeout As Integer) As Boolean
Aufruf:
Sonstige Details:
Programmiersprache: VB.NET
IDE: Visual Studio 2012 Ultimate
Framework: 4.5 (es wird momentan eine Funktion aus 4.5 gebraucht)
Download:
Im Anhang.