apps/examples/flowc: Fix some errors in receiver's verificationg logic. Add a 'canned' data file so that we don't need to deal with the sender program; we can just 'cat' the canned data file.

This commit is contained in:
Gregory Nutt 2017-09-26 13:13:34 -06:00
parent d02ec04ff3
commit ca354f2175
3 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,60 @@
/****************************************************************************
* examples/flowc/flowc_mktestdata.c
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdio.h>
/****************************************************************************
* Public Functions
****************************************************************************/
int main(int argc, char **envp)
{
int ch;
int i;
for (i = 0; i < 100; i++)
{
for (ch = 0x20; ch < 0x7F; ch++)
{
putchar(ch);
}
}
return 0;
}

View File

@ -90,11 +90,16 @@ static inline void check_buffer(FAR uint8_t *buf, size_t buflen)
g_nerrors++;
ch = *ptr;
}
if (++ch > 0x7e)
{
ch = 0x20;
}
}
/* Update globals */
g_expected = ch + 1;
g_expected = ch;
if (g_expected > 0x7e)
{
g_expected = 0x20;

File diff suppressed because one or more lines are too long