home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Headers / misckit / MiscXmodem.h < prev    next >
Encoding:
Text File  |  1994-03-28  |  1.7 KB  |  74 lines

  1. //
  2. // MiscXmodem.h: spawn and control a thread performing a XMODEM file transfer
  3. //        Written by Eric Norum Copyright (c) 1994 by Eric Norum.
  4. //                Version 1.0.  All rights reserved.
  5. //        This notice may not be removed from this source code.
  6. //
  7. //    This object is included in the MiscKit by permission from the author
  8. //    and its use is governed by the MiscKit license, found in the file
  9. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  10. //    for a list of all applicable permissions and restrictions.
  11. //    
  12.  
  13. #import <appkit/appkit.h>
  14. /* #import <misckit/misckit.h> /* */
  15.  
  16. @interface MiscXmodem:Object
  17. {
  18.     BOOL            isActive;
  19.     BOOL            isText;
  20.     BOOL            use1kPackets;
  21.     BOOL            isDynamicCheck;
  22.     BOOL            useCRC;
  23.  
  24.     MiscSerialPort    *serialPort;
  25.     BOOL            serialPortWasSuspended;
  26.     int                fd;
  27.     fd_set            checkFdSet;
  28.     NXStream        *stream;
  29.  
  30.     cthread_t        xmodemThread;
  31.     port_t            messagePort;
  32.     port_t            replyPort;
  33.     id                delegate;
  34.  
  35.     unsigned char    packetBuffer[1024+5];
  36.     unsigned char    smallPacketData[1024];
  37.     int                smallPacketIndex;
  38.     int                smallPacketCount;
  39.     BOOL            newlineFlag;
  40.  
  41.     BOOL            isDynamicCheckPacket;
  42.     int                lastPacketNumber;
  43.     int                goodPacketCount;
  44.     float            kbytes;
  45. }
  46.  
  47. - init;
  48. - free;
  49.  
  50. - setFileTypeText:(BOOL)flag;
  51. - xmodemSet1kPackets:(BOOL)flag;
  52. - xmodemSetCheckTypeDynamic:(BOOL)flag;
  53. - xmodemSetCheckTypeCRC:(BOOL)flag;
  54. - (BOOL)isFileTypeText;
  55. - (BOOL)xmodemIs1kPackets;
  56. - (BOOL)xmodemIsCheckTypeDynamic;
  57. - (BOOL)xmodemIsCheckTypeCRC;
  58.  
  59. - sendToSerialPort:serialPort fromStream:(NXStream *)aStream;
  60. - sendToStream:(NXStream *)aStream fromSerialPort:serialPort;
  61. - (BOOL)isActive;
  62.  
  63. - setDelegate:id;
  64. - delegate;
  65.  
  66. /*
  67.  * Delegate methods
  68.  */
  69. - didTransferPacket:(int)anInt kbytes:(float)aFloat;
  70. - didRetryNumber:(int)anInt;
  71. - didFinish:(const char *)failureCode;
  72.  
  73. @end
  74.