Jan Breuer
2015-10-04 18e1b0a79139dd13d5f9770e840f2c4e59aac7e2
libscpi/src/parser.c
@@ -1093,3 +1093,24 @@
scpi_bool_t SCPI_CommandNumbers(scpi_t * context, int32_t * numbers, size_t len) {
    return matchCommand (context->param_list.cmd->pattern,  context->param_list.cmd_raw.data, context->param_list.cmd_raw.length, numbers, len);
}
/**
 * If SCPI_Parameter() returns FALSE, this function can detect, if the parameter
 * is just missing (TRUE) or if there was an error during processing of the command (FALSE)
 * @param parameter
 * @return
 */
scpi_bool_t SCPI_ParamIsValid(scpi_parameter_t * parameter)
{
    return parameter->type == SCPI_TOKEN_UNKNOWN ? FALSE : TRUE;
}
/**
 * Returns TRUE if there was an error during parameter handling
 * @param context
 * @return
 */
scpi_bool_t SCPI_ParamErrorOccurred(scpi_t * context)
{
    return context->cmd_error;
}