From 39b7fbcb39edade740feb182c86cb43a43942cb7 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: ćšć, 10 9æ 2015 03:37:05 +0800 Subject: [PATCH] Clarify disabled characters in program expression --- libscpi/src/ieee488.c | 38 +++++++++++++++++++++++--------------- 1 files changed, 23 insertions(+), 15 deletions(-) diff --git a/libscpi/src/ieee488.c b/libscpi/src/ieee488.c index 5fd7fe9..0593d23 100644 --- a/libscpi/src/ieee488.c +++ b/libscpi/src/ieee488.c @@ -98,7 +98,7 @@ * @param val - new value */ void SCPI_RegSet(scpi_t * context, scpi_reg_name_t name, scpi_reg_val_t val) { - bool_t srq = FALSE; + scpi_bool_t srq = FALSE; scpi_reg_val_t mask; scpi_reg_val_t old_val; @@ -210,9 +210,9 @@ * @return */ scpi_result_t SCPI_CoreEse(scpi_t * context) { - scpi_parameter_t parameter; - if (SCPI_Parameter(context, ¶meter, TRUE)) { - SCPI_RegSet(context, SCPI_REG_ESE, SCPI_ParamGetIntVal(context, ¶meter)); + int32_t new_ESE; + if (SCPI_ParamInt(context, &new_ESE, TRUE)) { + SCPI_RegSet(context, SCPI_REG_ESE, (scpi_reg_val_t)new_ESE); } return SCPI_RES_OK; } @@ -240,13 +240,24 @@ /** * *IDN? + * + * field1: MANUFACTURE + * field2: MODEL + * field4: SUBSYSTEMS REVISIONS + * + * example: MANUFACTURE,MODEL,0,01-02-01 * @param context * @return */ scpi_result_t SCPI_CoreIdnQ(scpi_t * context) { - SCPI_ResultText(context, SCPI_MANUFACTURE); - SCPI_ResultText(context, SCPI_DEV_NAME); - SCPI_ResultText(context, SCPI_DEV_VERSION); + int i; + for (i = 0; i<4; i++) { + if (context->idn[i]) { + SCPI_ResultMnemonic(context, context->idn[i]); + } else { + SCPI_ResultMnemonic(context, "0"); + } + } return SCPI_RES_OK; } @@ -289,9 +300,9 @@ * @return */ scpi_result_t SCPI_CoreSre(scpi_t * context) { - scpi_parameter_t parameter; - if (SCPI_Parameter(context, ¶meter, TRUE)) { - SCPI_RegSet(context, SCPI_REG_SRE, SCPI_ParamGetIntVal(context, ¶meter)); + int32_t new_SRE; + if (SCPI_ParamInt(context, &new_SRE, TRUE)) { + SCPI_RegSet(context, SCPI_REG_SRE, (scpi_reg_val_t)new_SRE); } return SCPI_RES_OK; } @@ -322,11 +333,8 @@ * @return */ scpi_result_t SCPI_CoreTstQ(scpi_t * context) { - int result = 0; - if (context && context->interface && context->interface->test) { - result = context->interface->test(context); - } - SCPI_ResultInt(context, result); + (void) context; + SCPI_ResultInt(context, 0); return SCPI_RES_OK; } -- Gitblit v1.9.1