Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

54 lines
1.3 KiB

//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright © 2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: ProtocolCCC.h
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Header file of ProtocolCCC.h
//----------------------------------------------------------------------------
#ifndef __PROTOCOL__CCC__H__INCLUDED__
#define __PROTOCOL__CCC__H__INCLUDED__
#include "..\..\lglib\Comm\connect.h"
#include "..\..\lglib\Comm\protocol.h"
class CProtocolCCC :
public CProtocol
{
public:
CProtocolCCC();
virtual ~CProtocolCCC();
public:
BOOL Create( CConnection *pCommPort );
void Destroy();
public:
virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost );
virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost );
public:
enum
{
ADDRESS_POS = 0, // position of address byte
ADDRESS_TAG = 0x80,
ADDRESS_MASK = 0x7F,
DATA_POS = 1, // position of data byte
DATA_TAG = 0x40,
DATA_MASK = 0x3F,
COMMAND_SIZE = 2,
};
private:
CConnection *m_pConnection;
BYTE m_pBuffer[ COMMAND_SIZE ];
PBYTE m_pBufferPtr;
INT m_nCount;
};
#endif