⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commprotocol.h

📁 一个操作系统源代码 用于嵌入式设备 在Vc++环境下仿真 成功移植到多款处理器上
💻 H
字号:
/*
 * Copyright (c) 2000-2001 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of Sun
 * Microsystems, Inc. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Sun.
 * 
 * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
 * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
 * THIS SOFTWARE OR ITS DERIVATIVES.
 * 
 */

/*=========================================================================
 * SYSTEM:    KVM
 * SUBSYSTEM: networking
 * FILE:      commProtocol.h
 * OVERVIEW:  Prototypes for supporting serial communication ports.
 *            If a target platform wants to support serial ports,
 *            a platform-specific implementation of the functions
 *            must be provided in the Vm<Port>/src directory,
 *            where <Port> is the name of your target platform
 *            (e.g., Win, Unix, Pilot).
 * AUTHOR:    Stephen Flores, Nik Shaylor
 *=======================================================================*/

#ifndef _COMM_PROTOCOL_H_
#define _COMM_PROTOCOL_H_

#ifndef __P
# ifdef __STDC__
#  define __P(p) p
# else
#  define __P(p) ()
# endif
#endif /* __P */

/* COMM options */
#define STOP_BITS_2     0x01
#define ODD_PARITY      0x02
#define EVEN_PARITY     0x04
#define AUTO_RTS        0x10
#define AUTO_CTS        0x20
#define BITS_PER_CHAR_7 0x80
#define BITS_PER_CHAR_8 0xC0

/*=========================================================================
 * Serial protocol prototypes (each platform/port must supply definitions
 * of these prototypes)    
 *=======================================================================*/

extern long openPortByNumber __P ((char** ppszError, long port, long baudRate, long options, long blocking));
extern long openPortByName __P ((char** ppszError, char* pszDeviceName, long baudRate, long options, long blocking));

extern long peekFromPort __P ((long hPort));
extern long readFromPort __P ((char** ppszError, long hPort, char* pBuffer, long nNumberOfBytesToRead));

extern long writeToPort __P ((char** ppszError, long hPort, char* pBuffer, long nNumberOfBytesToWrite));

extern void closePort __P ((long hPort));
extern void freePortError __P ((char* pszError));

#endif /* _COMM_PROTOCOL_H_ */


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -