From 31c1e390d2f7a5278e73491aee3568a6352482d1 Mon Sep 17 00:00:00 2001 From: nancy.liao <huihui.liao@greentest.com.cn> Date: 周三, 23 4月 2025 18:30:16 +0800 Subject: [PATCH] 完善了SCPI库对于<>内可选参数的解析 --- libscpi/inc/scpi/types.h | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/libscpi/inc/scpi/types.h b/libscpi/inc/scpi/types.h index 0e9bc30..45e4d53 100644 --- a/libscpi/inc/scpi/types.h +++ b/libscpi/inc/scpi/types.h @@ -368,6 +368,20 @@ SCPI_NUM_NINF, SCPI_NUM_AUTO }; + + enum SCPIRError + { + RETURN_TRUE = 0, + //鍛戒护鏈畾涔� + RETURN_UnDefine = -1, + //闀垮害婧㈠嚭 + RETURN_LengthOverFlow = -2, + //鍛戒护闈炴硶 + RETURN_IllegalCommand = -3, + //鍥炶皟鍑芥暟娌℃湁鎵惧埌 + RETURN_NotFind = -4 + + }; typedef enum _scpi_special_number_t scpi_special_number_t; struct _scpi_choice_def_t { @@ -420,6 +434,7 @@ scpi_command_callback_t reset; }; + struct _scpi_t { //鍛戒护琛ㄧ殑鎸囬拡 const scpi_command_t * cmdlist; @@ -427,7 +442,7 @@ scpi_buffer_t buffer; //瑙f瀽鍛戒护鐨勫弬鏁板垪琛� scpi_param_list_t param_list; - //SCPI鐨勭‖浠舵帴鍙o紝鍒锋柊 閲嶇疆 鍐欏叆 鎶ラ敊 + //SCPI鐨勫閮ㄦ帴鍙o紝鍒锋柊 閲嶇疆 鍐欏叆 鎶ラ敊 scpi_interface_t * interface; //杈撳嚭鏁版嵁鐨勪釜鏁� int_fast16_t output_count; @@ -455,8 +470,14 @@ const char * idn[4]; //鍓╀綑寰呬紶杈撶殑瀛楄妭 size_t arbitrary_remaining; + + int SCPIerror; + //澧炲姞浜嗕竴涓懡浠ゅ垪琛ㄧ殑闀垮害 闃叉闈炴硶瓒婄晫 + int cmdlistSize; }; + + enum _scpi_array_format_t { SCPI_FORMAT_ASCII = 0, SCPI_FORMAT_NORMAL = 1, -- Gitblit v1.9.1