//-------------------------------
// File:			SerialPort.h
// Function:		Serial port media driver
// Supported Toolchain(s):
//		- Microsoft Visual C++
// Date created:	22-May-2006
// Created by:		JJo
//-------------------------------

#ifndef FIRMWARE_UPGRADER_SERIALPORT_H
#define FIRMWARE_UPGRADER_SERIALPORT_H

//-------------------------------
// Includes
#include <afxwin.h>
#include <afx.h>
#include <winbase.h>
#include "Media.h"

//-------------------------------
// Class

class SerialPort : public Media {

private:
	HANDLE m_handle;
	CString m_name;

public:
	SerialPort::SerialPort(const char * name,
						   unsigned long baudRate,
						   unsigned char parity,
						   unsigned char stopBits);

	SerialPort::~SerialPort();

	unsigned long SerialPort::Write(const void * data, unsigned int size);
	unsigned long SerialPort::Read(void * data, unsigned int size);
	unsigned long SerialPort::Poll();
};

#endif
