From 92c70c86d8d7c023e16c87a1bd39cc0d7981d017 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 12 Jul 2013 19:06:00 -0600 Subject: More Zmodem-related changes --- apps/system/zmodem/sz_main.c | 180 +++++++++++++++++++++++++++++++++++++++--- apps/system/zmodem/zm.h | 2 +- apps/system/zmodem/zm_proto.c | 14 ++-- 3 files changed, 176 insertions(+), 20 deletions(-) (limited to 'apps') diff --git a/apps/system/zmodem/sz_main.c b/apps/system/zmodem/sz_main.c index 6f77042c1..c6693f0b5 100644 --- a/apps/system/zmodem/sz_main.c +++ b/apps/system/zmodem/sz_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * system/xmodem/sz_main.c + * system/zmodem/sz_main.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -40,28 +40,182 @@ #include #include +#include +#include +#include +#include +#include +#include #include /**************************************************************************** - * Definitions + * Private Functions ****************************************************************************/ -/**************************************************************************** - * Private Data - ****************************************************************************/ +static void show_usage(FAR const char *progname, int errcode) +{ + fprintf(stderr, "USAGE: %s [OPTIONS] [ [ ...]]\n", progname); + fprintf(stderr, "\nWhere:\n"); + fprintf(stderr, "\t is the local file name\n"); + fprintf(stderr, "\nand OPTIONS include the following:\n"); + fprintf(stderr, "\t-d : Communication device to use. Default /dev/console\n"); + fprintf(stderr, "\t-r : Remote file name. Default \n"); + fprintf(stderr, "\t-x : Transfer type\n"); + fprintf(stderr, "\t\t0: Normal file (default)\n"); + fprintf(stderr, "\t\t1: Binary file\n"); + fprintf(stderr, "\t\t2: Convert \\n to local EOF convention\n"); + fprintf(stderr, "\t\t3: Resume or append to existing file\n"); + fprintf(stderr, "\t-o