From 4758bdc8a35c3604f8b6dd72b3d49e7bc5ff9b1e Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周日, 19 4月 2015 05:51:20 +0800 Subject: [PATCH] Add test for command tree traversal --- libscpi/inc/scpi/types.h | 25 +++++++++++++++++-------- 1 files changed, 17 insertions(+), 8 deletions(-) diff --git a/libscpi/inc/scpi/types.h b/libscpi/inc/scpi/types.h index 3597275..ee0d0b9 100644 --- a/libscpi/inc/scpi/types.h +++ b/libscpi/inc/scpi/types.h @@ -105,10 +105,25 @@ typedef struct _scpi_command_t scpi_command_t; + struct _scpi_buffer_t { + size_t length; + size_t position; + char * data; + }; + typedef struct _scpi_buffer_t scpi_buffer_t; + + struct _scpi_const_buffer_t { + size_t length; + size_t position; + const char * data; + }; + typedef struct _scpi_const_buffer_t scpi_const_buffer_t; + struct _scpi_param_list_t { const scpi_command_t * cmd; const char * parameters; size_t length; + scpi_const_buffer_t cmd_raw; }; #define SCPI_CMD_LIST_END {NULL, NULL, } typedef struct _scpi_param_list_t scpi_param_list_t; @@ -116,13 +131,6 @@ /* scpi interface */ typedef struct _scpi_t scpi_t; typedef struct _scpi_interface_t scpi_interface_t; - - struct _scpi_buffer_t { - size_t length; - size_t position; - char * data; - }; - typedef struct _scpi_buffer_t scpi_buffer_t; typedef size_t(*scpi_write_t)(scpi_t * context, const char * data, size_t len); typedef scpi_result_t(*scpi_write_control_t)(scpi_t * context, scpi_ctrl_name_t ctrl, scpi_reg_val_t val); @@ -163,7 +171,8 @@ SCPI_NUM_DOWN, SCPI_NUM_NAN, SCPI_NUM_INF, - SCPI_NUM_NINF + SCPI_NUM_NINF, + SCPI_NUM_AUTO }; typedef enum _scpi_special_number_t scpi_special_number_t; -- Gitblit v1.9.1