home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / src / IrDA / IrPort.h < prev   
C/C++ Source or Header  |  2000-06-06  |  1KB  |  60 lines

  1. //
  2. //  $Id: IrPort.h,v 1.3 2000/06/06 09:30:57 sergey Exp $
  3. //
  4.  
  5. #ifndef _IrPort_h_
  6. #define _IrPort_h_
  7.  
  8. namespace IrDA
  9. {
  10.     class Connection;
  11.     class Callback;
  12.  
  13.     class Port
  14.     {
  15.     public:
  16.         Port();
  17.         ~Port();
  18.  
  19.     // can't be copied
  20.     private:
  21.         Port(const Port&);
  22.         Port& operator =(const Port&);
  23.  
  24.     // operations
  25.     public:
  26.         bool open(Callback* callback);
  27.         void close();
  28.  
  29.         bool connect();
  30.         void disconnect();
  31.  
  32.         bool sendData(const Byte* data, int size);
  33.  
  34.         // Blocks until the channel not ready to accept this portion of data.
  35.         bool blockingSendData(const Byte* data, int size);
  36.  
  37.     // attributes
  38.  
  39.         bool isOpened() const { return _opened; }
  40.         bool isConnected() const;
  41.  
  42.         bool dataSendReady() const;
  43.         int getMaxTxSize() const;
  44.  
  45.     // implementation
  46.     private:
  47.         bool initIrLib();
  48.  
  49.     // data members
  50.     private:
  51.         bool _opened;
  52.         Word _refNum;
  53.  
  54.         Connection* _connection;
  55.     };
  56. }
  57. // namespace IrDA
  58.  
  59. #endif // _IrPort_h_
  60.