Source: include/hpxmodem.H


Annotated List
Files
Globals
Hierarchy
Index
/* -------------------------------------------------------------------------
   hpxmodem.H - Protocol Class for HP's version of Xmodem
   -------------------------------------------------------------------------
   Copyright (C) 2000-2001 Eric R. Schendel
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
 
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
 
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.               
   ------------------------------------------------------------------------- */

#ifndef HPXMODEM_H
#define HPXMODEM_H

#include <string>

#include "status.H"
#include "xmodem.H"

namespace TransferProtocols {

using namespace StatusMsgs;

const unsigned char HPNAK = 'D';
const short HPNAKMAX = 4;

class HpXmodem: public Xmodem {

   public:
      HpXmodem(const string serial, const int speed, LogLevel lvl = NONE);

      virtual bool send(const string fname);
      virtual bool receive(const string fname);

   protected:
      StatusMsgs::Error negotiateSend();
      void processSendCheck();

      StatusMsgs::Error negotiateReceive();
      bool processReceiveCheck(bool& ack);

   private:
      Log log;

      StatusMsgs::Error send_hp_xmodem(const string fname);
      StatusMsgs::Error receive_hp_xmodem(const string fname);

};

}

#endif

Generated on Fri Mar 9 02:04:42 2001, using kdoc 2.0a43.