Refactor: rename scpi_context_t to scpi_t
| | |
| | | static const char * cmdlineNext(const char * cmd, size_t len); |
| | | static bool_t cmdMatch(const char * pattern, const char * cmd, size_t len); |
| | | |
| | | static void paramSkipBytes(scpi_context_t * context, size_t num); |
| | | static void paramSkipWhitespace(scpi_context_t * context); |
| | | static bool_t paramNext(scpi_context_t * context, bool_t mandatory); |
| | | static void paramSkipBytes(scpi_t * context, size_t num); |
| | | static void paramSkipWhitespace(scpi_t * context); |
| | | static bool_t paramNext(scpi_t * context, bool_t mandatory); |
| | | |
| | | /* |
| | | int _strnicmp(const char* s1, const char* s2, size_t len) { |
| | |
| | | * @param len - lenght of data to be written |
| | | * @return number of bytes written |
| | | */ |
| | | static inline size_t writeData(scpi_context_t * context, const char * data, size_t len) { |
| | | static inline size_t writeData(scpi_t * context, const char * data, size_t len) { |
| | | return context->interface->write(context, data, len); |
| | | } |
| | | |
| | |
| | | * @param context |
| | | * @return number of bytes written |
| | | */ |
| | | static inline size_t writeDelimiter(scpi_context_t * context) { |
| | | static inline size_t writeDelimiter(scpi_t * context) { |
| | | if (context->output_count > 0) { |
| | | return writeData(context, ", ", 2); |
| | | } else { |
| | |
| | | * @param context |
| | | * @return pocet zapsanych znaku |
| | | */ |
| | | static inline size_t writeNewLine(scpi_context_t * context) { |
| | | static inline size_t writeNewLine(scpi_t * context) { |
| | | if (context->output_count > 0) { |
| | | return writeData(context, "\r\n", 2); |
| | | } else { |
| | |
| | | * @param len - command line length |
| | | * @return 1 if the last evaluated command was found |
| | | */ |
| | | int SCPI_Parse(scpi_context_t * context, const char * data, size_t len) { |
| | | int SCPI_Parse(scpi_t * context, const char * data, size_t len) { |
| | | int32_t i; |
| | | int result = 0; |
| | | const char * cmdline_end = data + len; |
| | |
| | | * @param buffer |
| | | * @param interface |
| | | */ |
| | | void SCPI_Init(scpi_context_t * context, scpi_command_t * command_list, scpi_buffer_t * buffer, scpi_interface_t * interface) { |
| | | void SCPI_Init(scpi_t * context, scpi_command_t * command_list, scpi_buffer_t * buffer, scpi_interface_t * interface) { |
| | | context->cmdlist = command_list; |
| | | context->buffer.data = buffer->data; |
| | | context->buffer.length = buffer->length; |
| | |
| | | * @param len - length of data |
| | | * @return |
| | | */ |
| | | int SCPI_Input(scpi_context_t * context, const char * data, size_t len) { |
| | | int SCPI_Input(scpi_t * context, const char * data, size_t len) { |
| | | int result = 0; |
| | | size_t buffer_free; |
| | | char * cmd_term; |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | bool_t SCPI_DebugCommand(scpi_context_t * context) { |
| | | bool_t SCPI_DebugCommand(scpi_t * context) { |
| | | (void) context; |
| | | printf("**DEBUG: %s (\"", context->paramlist.cmd->pattern); |
| | | fwrite(context->paramlist.parameters, 1, context->paramlist.length, stdout); |
| | |
| | | * @param data |
| | | * @return |
| | | */ |
| | | size_t SCPI_ResultString(scpi_context_t * context, const char * data) { |
| | | size_t SCPI_ResultString(scpi_t * context, const char * data) { |
| | | size_t len = strlen(data); |
| | | size_t result = 0; |
| | | result += writeDelimiter(context); |
| | |
| | | * @param val |
| | | * @return |
| | | */ |
| | | size_t SCPI_ResultInt(scpi_context_t * context, int32_t val) { |
| | | size_t SCPI_ResultInt(scpi_t * context, int32_t val) { |
| | | char buffer[12]; |
| | | size_t result = 0; |
| | | size_t len = longToStr(val, buffer, sizeof (buffer)); |
| | |
| | | * @param val |
| | | * @return |
| | | */ |
| | | size_t SCPI_ResultDouble(scpi_context_t * context, double val) { |
| | | size_t SCPI_ResultDouble(scpi_t * context, double val) { |
| | | char buffer[32]; |
| | | size_t result = 0; |
| | | size_t len = doubleToStr(val, buffer, sizeof (buffer)); |
| | |
| | | * @param data |
| | | * @return |
| | | */ |
| | | size_t SCPI_ResultText(scpi_context_t * context, const char * data) { |
| | | size_t SCPI_ResultText(scpi_t * context, const char * data) { |
| | | size_t result = 0; |
| | | result += writeDelimiter(context); |
| | | result += writeData(context, "\"", 1); |
| | |
| | | * @param context |
| | | * @param num |
| | | */ |
| | | void paramSkipBytes(scpi_context_t * context, size_t num) { |
| | | void paramSkipBytes(scpi_t * context, size_t num) { |
| | | if (context->paramlist.length < num) { |
| | | num = context->paramlist.length; |
| | | } |
| | |
| | | * Skip white spaces from the beggining of parameters |
| | | * @param context |
| | | */ |
| | | void paramSkipWhitespace(scpi_context_t * context) { |
| | | void paramSkipWhitespace(scpi_t * context) { |
| | | size_t ws = skipWhitespace(context->paramlist.parameters, context->paramlist.length); |
| | | paramSkipBytes(context, ws); |
| | | } |
| | |
| | | * @param mandatory |
| | | * @return |
| | | */ |
| | | bool_t paramNext(scpi_context_t * context, bool_t mandatory) { |
| | | bool_t paramNext(scpi_t * context, bool_t mandatory) { |
| | | paramSkipWhitespace(context); |
| | | if (context->paramlist.length == 0) { |
| | | if (mandatory) { |
| | |
| | | * @param mandatory |
| | | * @return |
| | | */ |
| | | bool_t SCPI_ParamInt(scpi_context_t * context, int32_t * value, bool_t mandatory) { |
| | | bool_t SCPI_ParamInt(scpi_t * context, int32_t * value, bool_t mandatory) { |
| | | char * param; |
| | | size_t param_len; |
| | | size_t num_len; |
| | |
| | | * @param mandatory |
| | | * @return |
| | | */ |
| | | bool_t SCPI_ParamDouble(scpi_context_t * context, double * value, bool_t mandatory) { |
| | | bool_t SCPI_ParamDouble(scpi_t * context, double * value, bool_t mandatory) { |
| | | char * param; |
| | | size_t param_len; |
| | | size_t num_len; |
| | |
| | | * @param mandatory |
| | | * @return |
| | | */ |
| | | bool_t SCPI_ParamString(scpi_context_t * context, char ** value, size_t * len, bool_t mandatory) { |
| | | bool_t SCPI_ParamString(scpi_t * context, char ** value, size_t * len, bool_t mandatory) { |
| | | size_t length; |
| | | |
| | | if (!value || !len) { |
| | |
| | | * @param mandatory |
| | | * @return |
| | | */ |
| | | bool_t SCPI_ParamText(scpi_context_t * context, char ** value, size_t * len, bool_t mandatory) { |
| | | bool_t SCPI_ParamText(scpi_t * context, char ** value, size_t * len, bool_t mandatory) { |
| | | size_t length; |
| | | |
| | | if (!value || !len) { |
| | |
| | | typedef bool bool_t; |
| | | //typedef enum { FALSE = 0, TRUE } bool_t; |
| | | |
| | | typedef struct _scpi_context_t scpi_context_t; |
| | | typedef struct _scpi_t scpi_t; |
| | | typedef struct _scpi_param_list_t scpi_param_list_t; |
| | | typedef struct _scpi_command_t scpi_command_t; |
| | | typedef struct _scpi_buffer_t scpi_buffer_t; |
| | | typedef struct _scpi_interface_t scpi_interface_t; |
| | | typedef int (*scpi_command_callback_t)(scpi_context_t *); |
| | | typedef size_t(*scpi_write_t)(scpi_context_t * context, const char * data, size_t len); |
| | | typedef int (*scpi_error_callback_t)(scpi_context_t * context, int_fast16_t error); |
| | | typedef int (*scpi_command_callback_t)(scpi_t *); |
| | | typedef size_t(*scpi_write_t)(scpi_t * context, const char * data, size_t len); |
| | | typedef int (*scpi_error_callback_t)(scpi_t * context, int_fast16_t error); |
| | | |
| | | struct _scpi_param_list_t { |
| | | const scpi_command_t * cmd; |
| | |
| | | scpi_command_callback_t test; |
| | | }; |
| | | |
| | | struct _scpi_context_t { |
| | | struct _scpi_t { |
| | | const scpi_command_t * cmdlist; |
| | | scpi_buffer_t buffer; |
| | | scpi_param_list_t paramlist; |
| | |
| | | #define SCPI_CMD_LIST_END {.pattern = NULL, .callback = NULL, } |
| | | |
| | | |
| | | void SCPI_Init(scpi_context_t * context, scpi_command_t * command_list, scpi_buffer_t * buffer, scpi_interface_t * interface); |
| | | void SCPI_Init(scpi_t * context, scpi_command_t * command_list, scpi_buffer_t * buffer, scpi_interface_t * interface); |
| | | |
| | | int SCPI_Input(scpi_context_t * context, const char * data, size_t len); |
| | | int SCPI_Parse(scpi_context_t * context, const char * data, size_t len); |
| | | int SCPI_Input(scpi_t * context, const char * data, size_t len); |
| | | int SCPI_Parse(scpi_t * context, const char * data, size_t len); |
| | | |
| | | |
| | | size_t SCPI_ResultString(scpi_context_t * context, const char * data); |
| | | size_t SCPI_ResultInt(scpi_context_t * context, int32_t val); |
| | | size_t SCPI_ResultDouble(scpi_context_t * context, double val); |
| | | size_t SCPI_ResultText(scpi_context_t * context, const char * data); |
| | | size_t SCPI_ResultString(scpi_t * context, const char * data); |
| | | size_t SCPI_ResultInt(scpi_t * context, int32_t val); |
| | | size_t SCPI_ResultDouble(scpi_t * context, double val); |
| | | size_t SCPI_ResultText(scpi_t * context, const char * data); |
| | | |
| | | bool_t SCPI_ParamInt(scpi_context_t * context, int32_t * value, bool_t mandatory); |
| | | bool_t SCPI_ParamDouble(scpi_context_t * context, double * value, bool_t mandatory); |
| | | bool_t SCPI_ParamString(scpi_context_t * context, char ** value, size_t * len, bool_t mandatory); |
| | | bool_t SCPI_ParamInt(scpi_t * context, int32_t * value, bool_t mandatory); |
| | | bool_t SCPI_ParamDouble(scpi_t * context, double * value, bool_t mandatory); |
| | | bool_t SCPI_ParamString(scpi_t * context, char ** value, size_t * len, bool_t mandatory); |
| | | |
| | | bool_t SCPI_DebugCommand(scpi_context_t * context); |
| | | bool_t SCPI_DebugCommand(scpi_t * context); |
| | | |
| | | //#define SCPI_DEBUG_COMMAND(a) scpi_debug_command(a) |
| | | #define SCPI_DEBUG_COMMAND(a) |
| | |
| | | * Clear error queue |
| | | * @param context - scpi context |
| | | */ |
| | | void SCPI_ErrorClear(scpi_context_t * context) { |
| | | void SCPI_ErrorClear(scpi_t * context) { |
| | | (void) context; |
| | | scpi_err = 0; |
| | | } |
| | |
| | | * @param context - scpi context |
| | | * @param err - error number |
| | | */ |
| | | void SCPI_ErrorPush(scpi_context_t * context, int16_t err) { |
| | | void SCPI_ErrorPush(scpi_t * context, int16_t err) { |
| | | scpi_err = err; |
| | | |
| | | // Command error (e.g. syntax error) |
| | |
| | | * @param context - scpi context |
| | | * @return error number |
| | | */ |
| | | int16_t SCPI_ErrorPop(scpi_context_t * context) { |
| | | int16_t SCPI_ErrorPop(scpi_t * context) { |
| | | (void) context; |
| | | int16_t result = scpi_err; |
| | | scpi_err = 0; |
| | |
| | | extern "C" { |
| | | #endif |
| | | |
| | | void SCPI_ErrorClear(scpi_context_t * context); |
| | | int16_t SCPI_ErrorPop(scpi_context_t * context); |
| | | void SCPI_ErrorPush(scpi_context_t * context, int16_t err); |
| | | void SCPI_ErrorClear(scpi_t * context); |
| | | int16_t SCPI_ErrorPop(scpi_t * context); |
| | | void SCPI_ErrorPush(scpi_t * context, int16_t err); |
| | | const char * SCPI_ErrorTranslate(int16_t err); |
| | | |
| | | #define SCPI_ERROR_SYNTAX -102 |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreCls(scpi_context_t * context) { |
| | | int SCPI_CoreCls(scpi_t * context) { |
| | | (void) context; |
| | | SCPI_EventClear(); |
| | | SCPI_ErrorClear(context); |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreEse(scpi_context_t * context) { |
| | | int SCPI_CoreEse(scpi_t * context) { |
| | | int32_t new_ESE; |
| | | if (SCPI_ParamInt(context, &new_ESE, TRUE)) { |
| | | SCPI_RegSet(SCPI_REG_ESE, new_ESE); |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreEseQ(scpi_context_t * context) { |
| | | int SCPI_CoreEseQ(scpi_t * context) { |
| | | (void) context; |
| | | SCPI_ResultInt(context, SCPI_RegGet(SCPI_REG_ESE)); |
| | | return 0; |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreEsrQ(scpi_context_t * context) { |
| | | int SCPI_CoreEsrQ(scpi_t * context) { |
| | | (void) context; |
| | | SCPI_ResultInt(context, SCPI_RegGet(SCPI_REG_ESR)); |
| | | SCPI_RegSet(SCPI_REG_ESR, 0); |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreIdnQ(scpi_context_t * context) { |
| | | int SCPI_CoreIdnQ(scpi_t * context) { |
| | | (void) context; |
| | | SCPI_ResultString(context, SCPI_MANUFACTURE); |
| | | SCPI_ResultString(context, SCPI_DEV_NAME); |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreOpc(scpi_context_t * context) { |
| | | int SCPI_CoreOpc(scpi_t * context) { |
| | | (void) context; |
| | | SCPI_RegSetBits(SCPI_REG_ESR, ESR_OPC); |
| | | return 0; |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreOpcQ(scpi_context_t * context) { |
| | | int SCPI_CoreOpcQ(scpi_t * context) { |
| | | (void) context; |
| | | // Operation is always completed |
| | | SCPI_ResultInt(context, 1); |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreRst(scpi_context_t * context) { |
| | | int SCPI_CoreRst(scpi_t * context) { |
| | | if (context && context->interface && context->interface->reset) { |
| | | return context->interface->reset(context); |
| | | } |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreSre(scpi_context_t * context) { |
| | | int SCPI_CoreSre(scpi_t * context) { |
| | | int32_t new_SRE; |
| | | if (SCPI_ParamInt(context, &new_SRE, TRUE)) { |
| | | SCPI_RegSet(SCPI_REG_SRE, new_SRE); |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreSreQ(scpi_context_t * context) { |
| | | int SCPI_CoreSreQ(scpi_t * context) { |
| | | (void) context; |
| | | SCPI_ResultInt(context, SCPI_RegGet(SCPI_REG_SRE)); |
| | | return 0; |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreStbQ(scpi_context_t * context) { |
| | | int SCPI_CoreStbQ(scpi_t * context) { |
| | | (void) context; |
| | | SCPI_ResultInt(context, SCPI_RegGet(SCPI_REG_STB)); |
| | | return 0; |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreTstQ(scpi_context_t * context) { |
| | | int SCPI_CoreTstQ(scpi_t * context) { |
| | | (void) context; |
| | | int result = 0; |
| | | if (context && context->interface && context->interface->test) { |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_CoreWai(scpi_context_t * context) { |
| | | int SCPI_CoreWai(scpi_t * context) { |
| | | (void) context; |
| | | // NOP |
| | | return 0; |
| | |
| | | SCPI_REG_COUNT, |
| | | } scpi_reg_name_t; |
| | | |
| | | int SCPI_CoreCls(scpi_context_t * context); |
| | | int SCPI_CoreEse(scpi_context_t * context); |
| | | int SCPI_CoreEseQ(scpi_context_t * context); |
| | | int SCPI_CoreEsrQ(scpi_context_t * context); |
| | | int SCPI_CoreIdnQ(scpi_context_t * context); |
| | | int SCPI_CoreOpc(scpi_context_t * context); |
| | | int SCPI_CoreOpcQ(scpi_context_t * context); |
| | | int SCPI_CoreRst(scpi_context_t * context); |
| | | int SCPI_CoreSre(scpi_context_t * context); |
| | | int SCPI_CoreSreQ(scpi_context_t * context); |
| | | int SCPI_CoreStbQ(scpi_context_t * context); |
| | | int SCPI_CoreTstQ(scpi_context_t * context); |
| | | int SCPI_CoreWai(scpi_context_t * context); |
| | | int SCPI_CoreCls(scpi_t * context); |
| | | int SCPI_CoreEse(scpi_t * context); |
| | | int SCPI_CoreEseQ(scpi_t * context); |
| | | int SCPI_CoreEsrQ(scpi_t * context); |
| | | int SCPI_CoreIdnQ(scpi_t * context); |
| | | int SCPI_CoreOpc(scpi_t * context); |
| | | int SCPI_CoreOpcQ(scpi_t * context); |
| | | int SCPI_CoreRst(scpi_t * context); |
| | | int SCPI_CoreSre(scpi_t * context); |
| | | int SCPI_CoreSreQ(scpi_t * context); |
| | | int SCPI_CoreStbQ(scpi_t * context); |
| | | int SCPI_CoreTstQ(scpi_t * context); |
| | | int SCPI_CoreWai(scpi_t * context); |
| | | |
| | | |
| | | #define STB_R01 0x01 // Not used |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_Stub(scpi_context_t * context) { |
| | | int SCPI_Stub(scpi_t * context) { |
| | | (void) context; |
| | | return 0; |
| | | } |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_StubQ(scpi_context_t * context) { |
| | | int SCPI_StubQ(scpi_t * context) { |
| | | (void) context; |
| | | SCPI_ResultString(context, ""); |
| | | return 0; |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_SystemVersionQ(scpi_context_t * context) { |
| | | int SCPI_SystemVersionQ(scpi_t * context) { |
| | | (void) context; |
| | | SCPI_ResultString(context, SCPI_DEV_VERSION); |
| | | return 0; |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_SystemErrorNextQ(scpi_context_t * context) { |
| | | int SCPI_SystemErrorNextQ(scpi_t * context) { |
| | | (void) context; |
| | | |
| | | int16_t err = SCPI_ErrorPop(context); |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_StatusQuestionableEventQ(scpi_context_t * context) { |
| | | int SCPI_StatusQuestionableEventQ(scpi_t * context) { |
| | | (void) context; |
| | | |
| | | // return value |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_StatusQuestionableEnableQ(scpi_context_t * context) { |
| | | int SCPI_StatusQuestionableEnableQ(scpi_t * context) { |
| | | (void) context; |
| | | |
| | | // return value |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_StatusQuestionableEnable(scpi_context_t * context) { |
| | | int SCPI_StatusQuestionableEnable(scpi_t * context) { |
| | | int32_t new_QUESE; |
| | | if (SCPI_ParamInt(context, &new_QUESE, TRUE)) { |
| | | SCPI_RegSet(SCPI_REG_QUESE, new_QUESE); |
| | |
| | | * @param context |
| | | * @return |
| | | */ |
| | | int SCPI_StatusPreset(scpi_context_t * context) { |
| | | int SCPI_StatusPreset(scpi_t * context) { |
| | | (void) context; |
| | | // clear STATUS:... |
| | | SCPI_RegSet(SCPI_REG_QUES, 0); |
| | |
| | | extern "C" { |
| | | #endif |
| | | |
| | | int SCPI_Stub(scpi_context_t * context); |
| | | int SCPI_StubQ(scpi_context_t * context); |
| | | int SCPI_Stub(scpi_t * context); |
| | | int SCPI_StubQ(scpi_t * context); |
| | | |
| | | int SCPI_SystemVersionQ(scpi_context_t * context); |
| | | int SCPI_SystemErrorNextQ(scpi_context_t * context); |
| | | int SCPI_StatusQuestionableEventQ(scpi_context_t * context); |
| | | int SCPI_StatusQuestionableEnableQ(scpi_context_t * context); |
| | | int SCPI_StatusQuestionableEnable(scpi_context_t * context); |
| | | int SCPI_StatusPreset(scpi_context_t * context); |
| | | int SCPI_SystemVersionQ(scpi_t * context); |
| | | int SCPI_SystemErrorNextQ(scpi_t * context); |
| | | int SCPI_StatusQuestionableEventQ(scpi_t * context); |
| | | int SCPI_StatusQuestionableEnableQ(scpi_t * context); |
| | | int SCPI_StatusQuestionableEnable(scpi_t * context); |
| | | int SCPI_StatusPreset(scpi_t * context); |
| | | |
| | | |
| | | #ifdef __cplusplus |
| | |
| | | * @param mandatory if the parameter is mandatory |
| | | * @return |
| | | */ |
| | | bool_t SCPI_ParamNumber(scpi_context_t * context, scpi_number_t * value, bool_t mandatory) { |
| | | bool_t SCPI_ParamNumber(scpi_t * context, scpi_number_t * value, bool_t mandatory) { |
| | | bool_t result; |
| | | char * param; |
| | | size_t len; |
| | |
| | | |
| | | } |
| | | |
| | | size_t SCPI_NumberToStr(scpi_context_t * context, scpi_number_t * value, char * str, size_t len) { |
| | | size_t SCPI_NumberToStr(scpi_t * context, scpi_number_t * value, char * str, size_t len) { |
| | | const char * type; |
| | | const char * unit; |
| | | size_t result; |
| | |
| | | #define SCPI_SPECIAL_NUMBERS_LIST_END {.name = NULL, .type = SCPI_NUM_NUMBER} |
| | | |
| | | |
| | | bool_t SCPI_ParamNumber(scpi_context_t * context, scpi_number_t * value, bool_t mandatory); |
| | | size_t SCPI_NumberToStr(scpi_context_t * context, scpi_number_t * value, char * str, size_t len); |
| | | bool_t SCPI_ParamNumber(scpi_t * context, scpi_number_t * value, bool_t mandatory); |
| | | size_t SCPI_NumberToStr(scpi_t * context, scpi_number_t * value, char * str, size_t len); |
| | | |
| | | #ifdef __cplusplus |
| | | } |
| | |
| | | #include "scpi/scpi_utils.h" |
| | | #include "scpi/scpi_units.h" |
| | | |
| | | int DMM_MeasureVoltageDcQ(scpi_context_t * context) { |
| | | int DMM_MeasureVoltageDcQ(scpi_t * context) { |
| | | scpi_number_t param1, param2; |
| | | char bf[15]; |
| | | fprintf(stderr, "meas:volt:dc\r\n"); // debug command name |
| | |
| | | SCPI_CMD_LIST_END |
| | | }; |
| | | |
| | | size_t SCPI_Write(scpi_context_t * context, const char * data, size_t len) { |
| | | size_t SCPI_Write(scpi_t * context, const char * data, size_t len) { |
| | | (void) context; |
| | | return fwrite(data, 1, len, stdout); |
| | | } |
| | | |
| | | int SCPI_Error(scpi_context_t * context, int_fast16_t err) { |
| | | int SCPI_Error(scpi_t * context, int_fast16_t err) { |
| | | (void) context; |
| | | |
| | | fprintf(stderr, "**ERROR: %d, \"%s\"\r\n", (int32_t) err, SCPI_ErrorTranslate(err)); |
| | |
| | | // .data = (char[SCPI_BUFFER_LENGTH]){}, |
| | | }; |
| | | |
| | | scpi_context_t scpi_context; |
| | | scpi_t scpi_context; |
| | | |
| | | /* |
| | | * |