Merge branch 'master' of https://github.com/j123b567/scpi-parser
| | |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | /** |
| | | * Return 0 as OK and other number as error |
| | | */ |
| | | scpi_result_t SCPI_Test(scpi_t * context) { |
| | | (void) context; |
| | | iprintf("**Test\r\n"); |
| | | return 0; |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | scpi_result_t SCPI_Reset(scpi_t * context) { |
| | |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | /** |
| | | * Return 0 as OK and other number as error |
| | | */ |
| | | scpi_result_t SCPI_Test(scpi_t * context) { |
| | | fprintf(stderr, "**Test\r\n"); |
| | | return 0; |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | scpi_result_t SCPI_Reset(scpi_t * context) { |
| | |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | /** |
| | | * Return 0 as OK and other number as error |
| | | */ |
| | | scpi_result_t SCPI_Test(scpi_t * context) { |
| | | fprintf(stderr, "**Test\r\n"); |
| | | return 0; |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | scpi_result_t SCPI_Reset(scpi_t * context) { |
| | |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | /** |
| | | * Return 0 as OK and other number as error |
| | | */ |
| | | scpi_result_t SCPI_Test(scpi_t * context) { |
| | | fprintf(stderr, "**Test\r\n"); |
| | | return 0; |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | scpi_result_t SCPI_Reset(scpi_t * context) { |
| | |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | /** |
| | | * Return 0 as OK and other number as error |
| | | */ |
| | | scpi_result_t SCPI_Test(scpi_t * context) { |
| | | fprintf(stderr, "**Test\r\n"); |
| | | return 0; |
| | | return SCPI_RES_OK; |
| | | } |
| | | |
| | | scpi_result_t SCPI_Reset(scpi_t * context) { |
| | |
| | | * @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; |
| | | } |
| | | |
| | |
| | | scpi_result_t SCPI_CoreTstQ(scpi_t * context) { |
| | | int result = 0; |
| | | if (context && context->interface && context->interface->test) { |
| | | result = context->interface->test(context); |
| | | result = context->interface->test(context) == SCPI_RES_OK ? 0 : 1; |
| | | } |
| | | SCPI_ResultInt(context, result); |
| | | return SCPI_RES_OK; |
| | |
| | | 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_ASSERT_EQUAL(RST_executed, TRUE); |
| | | |
| | | TST_executed = FALSE; |
| | | TEST_IEEE4882("*TST?\r\n", "1\r\n"); |
| | | TEST_IEEE4882("*TST?\r\n", "0\r\n"); |
| | | CU_ASSERT_EQUAL(TST_executed, TRUE); |
| | | |
| | | TEST_IEEE4882("*WAI\r\n", ""); |
| | |
| | | CU_cleanup_registry(); |
| | | return CU_get_error(); |
| | | } |
| | | |