| | |
| | | |
| | | #include <ctype.h> |
| | | #include <string.h> |
| | | #include "scpi/externinterface.h" |
| | | |
| | | #include "scpi/config.h" |
| | | #include "scpi/parser.h" |
| | |
| | | #include "scpi/error.h" |
| | | #include "scpi/constants.h" |
| | | #include "scpi/utils.h" |
| | | |
| | | #include "scpi/externinterface.h" |
| | | /** |
| | | * Write data to SCPI output |
| | | * @param context |
| | |
| | | * @param context |
| | | * @result TRUE if context->paramlist is filled with correct values |
| | | */ |
| | | static scpi_bool_t findCommandHeader(scpi_t * context, const char * header, int len) { |
| | | int32_t i; |
| | | const scpi_command_t * cmd; |
| | | scpi_bool_t findCommandHeader(scpi_t * context, const char * header, int len) |
| | | { |
| | | |
| | | for (i = 0; context->cmdlist[i].pattern != NULL; i++) { |
| | | cmd = &context->cmdlist[i]; |
| | | if (matchCommand(cmd->pattern, header, len, NULL, 0, 0)) { |
| | | context->param_list.cmd = cmd; |
| | | for(int i=0;i<get_pattern_count();i++) |
| | | { |
| | | if( match_segments_global(header,i) ) |
| | | { |
| | | context->param_list.cmd = &context->cmdlist[i]; |
| | | return TRUE; |
| | | } |
| | | } |
| | |
| | | context->buffer.data = input_buffer; |
| | | context->buffer.length = input_buffer_length; |
| | | context->buffer.position = 0; |
| | | |
| | | |
| | | SCPI_ErrorInit(context, error_queue_data, error_queue_size); |
| | | } |
| | | |