1 / 23
文档名称:

GPS 编程类.doc

格式:doc   大小:116KB   页数:23页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

GPS 编程类.doc

上传人:yuzonghong1 2017/2/20 文件大小:116 KB

下载得到文件列表

GPS 编程类.doc

相关文档

文档介绍

文档介绍:using System; using ; using ; namespace BaseStationPDA { class GPS { public string PortNum; public int BaudRate; public byte ByteSize; public byte Parity; // 0-4=no,odd,even,mark,space public byte StopBits; //0,1,2 =1,, 2 public int ReadTimeout; //comm port win32 file handle private int hComm = -1; public bool Opened = false; //win32 api constants private const uint GENERIC_READ =0x80000000; private const uint GENERIC_WRITE =0x40000000; private const int OPEN_EXISTING =3; private const int INVALID_HANDLE_VALUE = -1; [StructLayout()] public struct DCB { //taken from c struct in platform sdk public int DCBlength; // sizeof(DCB) public int BaudRate; //指定当前波特率 current baud rate // these are the c struct bit fields, bit twiddle flag to set public int fBinary; //指定是否允许二进制模式,在 windows95 中必须主 TRUE binary mode, no EOF check public int fParity; //指定是否允许奇偶校验 enable parity checking public int fOutxCtsFlow; //指定 CTS 是否用于检测发送控制,当为 TRUE 是 CTS 为 OFF ,发送将被挂起。 CTS output flow control public int fOutxDsrFlow; //指定 CTS 是否用于检测发送控制 DSR output flow control public int fDtrControl; // DTR_CONTROL_DISABLE 值将 DTR 置为 OFF, DTR_CONTROL_ENABLE 值将 DTR 置为 ON, DTR_CONTROL_HANDSHAKE 允许 DTR" 握手" DTR flow control type public int fDsrSensitivity; //当该值为 TRUE 时 DSR 为 OFF 时接收的字节被忽略 DSR sensitivity public int fTXContinueOnXoff; //指定当接收缓冲区已满,并且驱动程序已经发送出 XoffChar 字符时发送是否停止。 TRUE 时,在接收缓冲区接收到缓冲区已满的字节 XoffLim 且驱动程序已经发送出 XoffChar 字符中止接收字节之后, 发送继续进行。 FALSE 时,在接收缓冲区接收到代表缓冲区已空的字节 XonCha r且驱动程序已经发送出恢复发送的 XonCha r之后,发送继续进行。 XOFF continues Tx public int fOutX; // TRUE 时,接收到 XoffChar 之后便停止发送接收到 XonChar 之后将重新开始 XON/XOFF out flow control public int fInX; // TRUE 时,接收缓冲区接收到代表缓冲区满的 XoffLim 之后, XoffChar 发送出去接收缓冲区接收到代表缓冲区空的 XonLim 之后, XonChar 发送出去 XON/XOFF in flow control public int fErrorChar; //该值为 TRU E且 fParit y为 TRU E时,用 ErrorChar 成员指定的字符代替奇偶校验错误的接收字符 enable error replacement public int fNull; // eTRUE 时,接收时去掉空(0值)字节 enable null stripping public int fRtsCo