gsm_win32_serial.h

来自「对各种手机进行编程的工具包源码gsmlib 1.9版本。」· C头文件 代码 · 共 61 行

H
61
字号
// *************************************************************************// * GSM TA/ME library// *// * File:    gsm_win32_port.h// *// * Purpose: WIN32 serial port implementation// *// * Author:  Frediano Ziglio (freddy77@angelfire.com)// *// * Created: 25.10.2000// *************************************************************************#ifndef GSM_WIN32_SERIAL_H#define GSM_WIN32_SERIAL_H#include <string>#include <gsmlib/gsm_error.h>#include <gsmlib/gsm_port.h>#include <gsmlib/gsm_util.h>#define WIN32_MEAN_AND_LEAN#include <windows.h>using namespace std;namespace gsmlib{  class Win32SerialPort : public Port  {  private:    HANDLE _file;               // file handle for device    int _oldChar;               // character set by putBack() (-1 == none)//    OVERLAPPED _overIn;         // overlapped structure for wait    // throw GsmException include UNIX errno    void throwModemException(string message) throw(GsmException);      public:    // create Port given the UNIX device name    Win32SerialPort(string device, int lineSpeed = DEFAULT_BAUD_RATE,                   string initString = DEFAULT_INIT_STRING,                   bool swHandshake = false)      throw(GsmException);    // inherited from Port    void putBack(char c);    int readByte() throw(GsmException);    string getLine() throw(GsmException);    void putLine(string line,                         bool carriageReturn = true) throw(GsmException);    bool wait(GsmTime timeout) throw(GsmException);    void setTimeOut(unsigned int timeout);    virtual ~Win32SerialPort();  };  // convert baudrate string ("300" .. "460800") to speed_t  extern int baudRateStrToSpeed(string baudrate) throw(GsmException);};#endif // GSM_UNIX_SERIAL_H

⌨️ 快捷键说明

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