00001 /*************************************************************************** 00002 rl3964r.h - description 00003 ------------------- 00004 begin : Wed Jan 14 2004 00005 copyright : (C) 2004 by Rainer Lehrig 00006 email : lehrig@t-online.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This library is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as * 00013 * published by the Free Software Foundation * 00014 * * 00015 ***************************************************************************/ 00016 #ifndef _RL_3964R_H_ 00017 #define _RL_3964R_H_ 00018 00019 #include "rldefine.h" 00020 #include "rlserial.h" 00021 #include "rlthread.h" 00022 00027 class rl3964R 00028 { 00029 public: 00030 enum priorityEnum 00031 { 00032 highPriority = 0, 00033 lowPriority 00034 }; 00035 00036 rl3964R(int _priority = highPriority); 00037 virtual ~rl3964R(); 00038 int open(const char *devicename, int _baudrate = B9600); 00039 int close(); 00040 int setReadCallback( void (*_readCallback)(const unsigned char *buf, int len)); 00041 int write(const unsigned char *buf, int len); 00042 00043 int send(); 00044 int receive(); 00045 rlThread receiver; 00046 rlSerial tty; 00047 int state; 00048 int priority; 00049 int run; 00050 int debug; 00051 int dprintf(const char *format, ...); 00052 private: 00053 void (*readCallback)(const unsigned char *buf, int len); 00054 unsigned char tel_send[512]; 00055 unsigned char tel_receive[512]; 00056 int tel_send_length; 00057 int tel_receive_length; 00058 int isOpen; 00059 int send_result; 00060 }; 00061 00062 #endif 00063
1.6.3