serial.h

来自「无线传感器网络操作系统源代码」· C头文件 代码 · 共 38 行

H
38
字号
/*
	Serial.h  
	RS232 Serial Interface for the standard Atmel Programmer
	Uros Platise(c) copyright 1997-1999
*/

#ifndef __Serial
#define __Serial

#include <sys/types.h>
#if defined(__CYGWIN__)
#include "cygwinp.h"
#endif
#include <time.h>
#include <unistd.h>
#include <termios.h>
#include <string.h>
#include "Global.h"
#include "Error.h"

class TSerial{
private:
  int serline;
  struct termios saved_modes;
  
protected:
  int Tx(unsigned char* queue, int queue_size);
  int Rx(unsigned char* queue, int queue_size, timeval* timeout);

public:
  int Send(unsigned char* queue, int queue_size, int rec_queue_size=-1);

  TSerial();
  ~TSerial();
};

#endif

⌨️ 快捷键说明

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