diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /packages/simpad-utilities/serload/serialdownload.h | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'packages/simpad-utilities/serload/serialdownload.h')
-rw-r--r-- | packages/simpad-utilities/serload/serialdownload.h | 158 |
1 files changed, 0 insertions, 158 deletions
diff --git a/packages/simpad-utilities/serload/serialdownload.h b/packages/simpad-utilities/serload/serialdownload.h deleted file mode 100644 index 1dd05892b1..0000000000 --- a/packages/simpad-utilities/serload/serialdownload.h +++ /dev/null @@ -1,158 +0,0 @@ -//============================================================================= -// Project: SIMpad -//============================================================================= -// FILE-NAME: serialdownload.hpp -// FUNCTION: Serial download interface. -// -// AUTHOR: Juergen Messerer, Peter Voser -// CREAT.-DATE: 01.04.2001 (dd.mm.yy) -// -// NOTES: - -// -//============================================================================= - -#ifndef __SERIAL_DOWNLOAD -#define __SERIAL_DOWNLOAD - -#include <errno.h> -#include <fcntl.h> -#include <poll.h> -#include <stdio.h> -#include <stdlib.h> -#include <termios.h> -#include <unistd.h> - -const unsigned char STX = 2; -const unsigned char ETX = 3; -const unsigned char BEL = 7; -const unsigned char ACK_BD = 11; -const unsigned char ACK_OK = 6; -const unsigned char ACK_NOK = 15; -const unsigned char FILLER = 0xff; - -class SerialDownload -{ -public: - SerialDownload(); - ~SerialDownload(); -//============================================================================= -// PURPOSE: Opening a serial port. -// -// PARAMETERS: -// portDev: (IN) port device to open. -// errorNumber: (OUT) error number determined with -// GetLastError(). -// RETURN VALUE: -// serialPort: Filedescriptor of opened serial port. -// If the function fails, it returns -1. -// -// COMMENTS: - -//============================================================================= - int openSerialPort(const char* portDev, int &errorNumber); - -//============================================================================= -// PURPOSE: Loading file with a image -// -// PARAMETERS: -// fileName: (IN) name of file to open -// buffer: (OUT) pointer to loaded image file. -// numberOfBytes: (OUT) size of file. -// -// RETURN VALUE: -// 0: success -// -1: specified file not found -// -2: not enough memory to load file -// -3: cannot read file -// -// COMMENTS: - -//============================================================================= - int loadFile(const char *fileName, char *&buffer, int &numberOfBytes); - -//============================================================================= -// PURPOSE: Connecting to the SIMpad. -// -// PARAMETERS: -// fastBaudRate: (IN) value of fast baud rate. -// errorNumber: (OUT) error number errno -// -// RETURN VALUE: -// 0: success -// -1: switching to connection baud rate 38400baud failed. -// -2: writing to serial port failed. -// -3: switching to fast baud rate failed. -// -4: writing to serial port with fast baud rate failed. -// -// COMMENTS: The connection is set up according to the bootloader's -// serial download protocoll. -//============================================================================= - int connectToSimpad(const int fastBaudRate, - int& errorNumber); - -//============================================================================= -// PURPOSE: Sending a block of 512byte. -// -// PARAMETERS: -// b: (IN) pointer to the beginning of the 512byte buffer. -// len: (IN) length of the buffer. -// errorNumber: (OUT) error number determined with -// GetLastError(). -// RETURN VALUE: -// TRUE: success -// FALSE: error. See errorNumber for the reason. -// -// COMMENTS: The block, which is sent, is always 512byte long. If the -// buffer counts less than 512byte, the block is filled with -// the FILLER pattern. -//============================================================================= - bool sendBlock(const char *b, - const int len, - int& errorNumber); - -//============================================================================= -// PURPOSE: Waiting for the end of burning. -// -// PARAMETERS: - -// -// RETURN VALUE: - -// -// COMMENTS: - -//============================================================================= - void waitForEndOfBurning(void); - -private: - // File descriptor of open serial port. - int _serialPort; - -//============================================================================= -// PURPOSE: Changing baud rate. -// -// PARAMETERS: -// newBaudRate: (IN) new baud rate to switch to. -// errorNumber: (OUT) error number determined with -// GetLastError(). -// -// RETURN VALUE: -// TRUE: success -// FALSE: error. See errorNumber for the reason. -// -// serialMENTS: - -//============================================================================= - bool changeBaudRate(const int newBaudRate, - int &errorNumber); - -//============================================================================= -// PURPOSE: Waiting for control character. -// -// PARAMETERS: -// transparent: (IN) 0 = received characters are sent to -// stdout. -// -// RETURN VALUE: -// c: control character. -// -// COMMENTS: - -//============================================================================= - unsigned char waitForReply(const int transparent); - -}; -#endif // __SERIAL_DOWNLOAD |