Update test and correct IDN implementation
| | |
| | | * @return |
| | | */ |
| | | scpi_result_t SCPI_CoreIdnQ(scpi_t * context) { |
| | | SCPI_ResultString(context, context->idn[0]); |
| | | SCPI_ResultString(context, context->idn[1]); |
| | | SCPI_ResultString(context, context->idn[2]); |
| | | SCPI_ResultString(context, context->idn[3]); |
| | | int i; |
| | | for (i = 0; i<4; i++) { |
| | | if (context->idn[i]) { |
| | | SCPI_ResultString(context, context->idn[i]); |
| | | } else { |
| | | SCPI_ResultString(context, "0"); |
| | | } |
| | | } |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | |
| | | { .pattern = "*WAI", .callback = SCPI_CoreWai,}, |
| | | |
| | | /* Required SCPI commands (SCPI std V1999.0 4.2.1) */ |
| | | {.pattern = "SYSTem:ERRor[:NEXT]?", .callback = SCPI_SystemErrorNextQ,}, |
| | | {.pattern = "SYSTem:ERRor:COUNt?", .callback = SCPI_SystemErrorCountQ,}, |
| | | {.pattern = "SYSTem:VERSion?", .callback = SCPI_SystemVersionQ,}, |
| | | { .pattern = "SYSTem:ERRor[:NEXT]?", .callback = SCPI_SystemErrorNextQ,}, |
| | | { .pattern = "SYSTem:ERRor:COUNt?", .callback = SCPI_SystemErrorCountQ,}, |
| | | { .pattern = "SYSTem:VERSion?", .callback = SCPI_SystemVersionQ,}, |
| | | |
| | | {.pattern = "STATus:QUEStionable[:EVENt]?", .callback = SCPI_StatusQuestionableEventQ,}, |
| | | {.pattern = "STATus:QUEStionable:ENABle", .callback = SCPI_StatusQuestionableEnable,}, |
| | | {.pattern = "STATus:QUEStionable:ENABle?", .callback = SCPI_StatusQuestionableEnableQ,}, |
| | | { .pattern = "STATus:QUEStionable[:EVENt]?", .callback = SCPI_StatusQuestionableEventQ,}, |
| | | { .pattern = "STATus:QUEStionable:ENABle", .callback = SCPI_StatusQuestionableEnable,}, |
| | | { .pattern = "STATus:QUEStionable:ENABle?", .callback = SCPI_StatusQuestionableEnableQ,}, |
| | | |
| | | {.pattern = "STATus:PRESet", .callback = SCPI_StatusPreset,}, |
| | | { .pattern = "STATus:PRESet", .callback = SCPI_StatusPreset,}, |
| | | |
| | | SCPI_CMD_LIST_END |
| | | }; |
| | |
| | | CU_ASSERT_STRING_EQUAL(output, output_buffer); \ |
| | | } |
| | | output_buffer_clear(); |
| | | error_buffer_clear(); |
| | | |
| | | /* Test single command */ |
| | | TEST_INPUT("*IDN?\r\n", "MA, IN, 0, VER\r\n"); |
| | |
| | | CU_cleanup_registry(); |
| | | return CU_get_error(); |
| | | } |
| | | |