Add example to ParamChoice
| | |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | |
| | | const char * trigger_source[] = { |
| | | "BUS", |
| | | "IMMediate", |
| | | "EXTernal", |
| | | NULL /* termination of option list */ |
| | | }; |
| | | |
| | | |
| | | scpi_result_t TEST_ChoiceQ(scpi_t * context) { |
| | | |
| | | size_t param; |
| | | |
| | | if (!SCPI_ParamChoice(context, trigger_source, ¶m, true)) { |
| | | return SCPI_RES_ERR; |
| | | } |
| | | |
| | | fprintf(stderr, "\tP1=%s (%u)\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,}, |
| | |
| | | |
| | | {.pattern = "SYSTem:COMMunication:TCPIP:CONTROL?", .callback = SCPI_SystemCommTcpipControlQ,}, |
| | | |
| | | {.pattern = "TEST:CHOice?", .callback = TEST_ChoiceQ,}, |
| | | |
| | | SCPI_CMD_LIST_END |
| | | }; |
| | | |