<commit_before>/* Copyright 2016 <NAME> <<EMAIL>>
 * BSD License
 *
 * https://github.com/pvizeli/CmdParser
 */

#include "CmdCallback.hpp"

void CmdCallbackObject::loopCmdProcessing(CmdParser *      cmdParser,
                                          CmdBufferObject *cmdBuffer,
                                          Stream * serial)
{
    do {
        // read data
        if (cmdBuffer->readFromSerial(serial)) {

            // parse command line
            if (cmdParser->parseCmd(cmdBuffer) != CMDPARSER_ERROR) {
                // search command in store and call function
                if (this->processCmd(cmdParser)) {
                    // FIXME: handling cmd not found
                }
            }
        }
    } while (true);<commit_msg>clear cmdBuffer after each command (#8)<commit_after>/* Copyright 2016 <NAME> <<EMAIL>>
 * BSD License
 *
 * https://github.com/pvizeli/CmdParser
 */

#include "CmdCallback.hpp"

void CmdCallbackObject::loopCmdProcessing(CmdParser *      cmdParser,
                                          CmdBufferObject *cmdBuffer,
                                          Stream * serial)
{
    do {
        // read data
        if (cmdBuffer->readFromSerial(serial)) {

            // parse command line
            if (cmdParser->parseCmd(cmdBuffer) != CMDPARSER_ERROR) {
                // search command in store and call function
                if (this->processCmd(cmdParser)) {
                    // FIXME: handling cmd not found
                }
            	cmdBuffer->clear();
            }
        }
    } while (true);
{'fraction_non_alphanumeric': 0.10094637223974763, 'fraction_numerical': 0.0056782334384858045, 'mean_word_length': 1.4437596302003082, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5588901', 'n_tokens_mistral': 404, 'n_tokens_neox': 385, 'n_words': 93}