xyzModem.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SPDX-License-Identifier: eCos-2.0 */
  2. /*
  3. *==========================================================================
  4. *
  5. * xyzModem.h
  6. *
  7. * RedBoot stream handler for xyzModem protocol
  8. *
  9. *==========================================================================
  10. *#####DESCRIPTIONBEGIN####
  11. *
  12. * Author(s): gthomas
  13. * Contributors: gthomas
  14. * Date: 2000-07-14
  15. * Purpose:
  16. * Description:
  17. *
  18. * This code is part of RedBoot (tm).
  19. *
  20. *####DESCRIPTIONEND####
  21. *
  22. *==========================================================================
  23. */
  24. #ifndef _XYZMODEM_H_
  25. #define _XYZMODEM_H_
  26. #define xyzModem_xmodem 1
  27. #define xyzModem_ymodem 2
  28. /* Don't define this until the protocol support is in place */
  29. /*#define xyzModem_zmodem 3 */
  30. #define xyzModem_access -1
  31. #define xyzModem_noZmodem -2
  32. #define xyzModem_timeout -3
  33. #define xyzModem_eof -4
  34. #define xyzModem_cancel -5
  35. #define xyzModem_frame -6
  36. #define xyzModem_cksum -7
  37. #define xyzModem_sequence -8
  38. #define xyzModem_close 1
  39. #define xyzModem_abort 2
  40. #define CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT
  41. #define CYGACC_CALL_IF_SET_CONSOLE_COMM(x)
  42. #define diag_vprintf vprintf
  43. #define diag_printf printf
  44. #define diag_vsprintf vsprintf
  45. #define CYGACC_CALL_IF_DELAY_US(x) udelay(x)
  46. typedef struct {
  47. char *filename;
  48. int mode;
  49. int chan;
  50. } connection_info_t;
  51. int xyzModem_stream_open(connection_info_t *info, int *err);
  52. void xyzModem_stream_close(int *err);
  53. void xyzModem_stream_terminate(bool method, int (*getc)(void));
  54. int xyzModem_stream_read(char *buf, int size, int *err);
  55. char *xyzModem_error(int err);
  56. #endif /* _XYZMODEM_H_ */