nancy.liao
1 天以前 11f2f2e329ef404d0e9c022cb2f9fbbb45bae285
libscpi/src/parser.c
@@ -37,6 +37,7 @@
#include <ctype.h>
#include <string.h>
#include "scpi/externinterface.h"
#include "scpi/config.h"
#include "scpi/parser.h"
@@ -45,7 +46,7 @@
#include "scpi/error.h"
#include "scpi/constants.h"
#include "scpi/utils.h"
#include "scpi/externinterface.h"
/**
 * Write data to SCPI output
 * @param context
@@ -183,21 +184,13 @@
scpi_bool_t findCommandHeader(scpi_t * context, const char * header, int len)
{
    int32_t i;
    const scpi_command_t * cmd = NULL;
    for (i = 0; i<context->cmdlistSize; i++) {
        cmd = &context->cmdlist[i];
        bool result =test_match(cmd->pattern, header);
        if(result)
    for(int i=0;i<get_pattern_count();i++)
    {
        if( match_segments_global(header,i) )
        {
             context->param_list.cmd = &context->cmdlist[i];
            return TRUE;
        }
        // if (matchCommand(cmd->pattern, header, len, NULL, 0, 0)) {
        //     context->param_list.cmd = cmd;
        //     return TRUE;
        // }
    }
    context->SCPIerror = RETURN_NotFind;
    return FALSE;