FERSAT-ZAD7-PID_Refactoring/Code/main/parser.cpp
PSR_Status_t PSR_Argument_to_bool(int *retval, const PSR_Command_t *command) {

    /* If there are no arguments */
    if (command->argument_length == 0) {
        return PSR_ERROR;
    }

    /* If Arg is equal to zero then return zero, one otherwise */
    if (command->argument[0] == '0') {
        *retval = 0;
    } else {
        *retval = 1;
    }

    return PSR_OK;   /* Return Success */
}
/**
 * @brief               Converts the parser Function arguments to the
 *                      "boolean" type value. Read the Warning below. 
 * 
 * @param retval        Integer 0 for '0' character argument
 *                      Integer 1 for non '0' character argument
 * @param command       Command with the function name and argument.
 * @return PSR_Status_t PSR_OK
 *                      PSR_ERROR
 * @warning             This is not exactly boolean return type but the
 *                      integer values 0 or 1.
 */
@brief               Converts the parser Function arguments to the
"boolean" type value. Read the Warning below.

@param retval        Integer 0 for '0' character argument
Integer 1 for non '0' character argument
@param command       Command with the function name and argument.
@return PSR_Status_t PSR_OK
PSR_ERROR
@warning             This is not exactly boolean return type but the
integer values 0 or 1.
@brief Converts the parser Function arguments to the " boolean " type value . Read the Warning below . @param retval Integer 0 for ' 0 ' character argument Integer 1 for non ' 0 ' character argument @param command Command with the function name and argument . @return PSR_Status_t PSR_OK PSR_ERROR @warning This is not exactly boolean return type but the integer values 0 or 1 .
PSR_Status_t PSR_Argument_to_bool(int *retval, const PSR_Command_t *command) {
    if (command->argument_length == 0) {
        return PSR_ERROR;
    }
    if (command->argument[0] == '0') {
        *retval = 0;
    } else {
        *retval = 1;
    }
    return PSR_OK;   
}
PSR_Status_t PSR_Argument_to_bool ( int * retval , const PSR_Command_t * command ) { if ( command -> argument_length == 0 ) { return PSR_ERROR ; } if ( command -> argument [ 0 ] == ' ' ) { * retval = 0 ; } else { * retval = 1 ; } return PSR_OK ; }
@brief               Converts the parser Function arguments to the
                      "boolean" type value.
@brief Converts the parser Function arguments to the " boolean " type value .
/* If there are no arguments */ /* If Arg is equal to zero then return zero, one otherwise */ /* Return Success */