Jan Breuer
2013-10-21 1c02f18e5b718da36a5d78d29434fea282c67cc4
examples/common/scpi-def.c
@@ -89,6 +89,30 @@
    return SCPI_RES_OK;
}
const char * trigger_source[] = {
    "BUS",
    "IMMediate",
    "EXTernal",
    NULL /* termination of option list */
};
scpi_result_t TEST_ChoiceQ(scpi_t * context) {
    int32_t param;
    if (!SCPI_ParamChoice(context, trigger_source, &param, true)) {
        return SCPI_RES_ERR;
    }
    fprintf(stderr, "\tP1=%s (%d)\r\n", trigger_source[param], param);
    SCPI_ResultInt(context, param);
    return SCPI_RES_OK;
}
static const scpi_command_t scpi_commands[] = {
    /* IEEE Mandated Commands (SCPI std V1999.0 4.1.1) */
    { .pattern = "*CLS", .callback = SCPI_CoreCls,},
@@ -139,6 +163,8 @@
    
    {.pattern = "SYSTem:COMMunication:TCPIP:CONTROL?", .callback = SCPI_SystemCommTcpipControlQ,},
    {.pattern = "TEST:CHOice?", .callback = TEST_ChoiceQ,},
    SCPI_CMD_LIST_END
};
@@ -167,4 +193,5 @@
    .registers = scpi_regs,
    .units = scpi_units_def,
    .special_numbers = scpi_special_numbers_def,
    .idn = {"MANUFACTURE", "INSTR2013", NULL, "01-02"},
};