maa: add result print function.
* Fixed error in comments in maa.h Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
@@ -50,7 +50,7 @@ typedef enum {
|
|||||||
MAA_ERROR_NO_DATA_AVAILABLE = 9, /**< No data available */
|
MAA_ERROR_NO_DATA_AVAILABLE = 9, /**< No data available */
|
||||||
MAA_ERROR_INVALID_PLATFORM = 10, /**< Platform not recognised */
|
MAA_ERROR_INVALID_PLATFORM = 10, /**< Platform not recognised */
|
||||||
MAA_ERROR_PLATFORM_NOT_INITIALISED = 11, /**< Board information not initialised */
|
MAA_ERROR_PLATFORM_NOT_INITIALISED = 11, /**< Board information not initialised */
|
||||||
MAA_ERROR_PLATFORM_ALREADY_INITIALISED = 12, /**< Board is already initialised
|
MAA_ERROR_PLATFORM_ALREADY_INITIALISED = 12, /**< Board is already initialised */
|
||||||
|
|
||||||
MAA_ERROR_UNSPECIFIED = 99 /**< Unknown Error */
|
MAA_ERROR_UNSPECIFIED = 99 /**< Unknown Error */
|
||||||
} maa_result_t;
|
} maa_result_t;
|
||||||
@@ -202,6 +202,12 @@ maa_pin_t* maa_check_pwm(int pin);
|
|||||||
*/
|
*/
|
||||||
const char* maa_get_version();
|
const char* maa_get_version();
|
||||||
|
|
||||||
|
/** Print a textual representation of the maa_result_t
|
||||||
|
*
|
||||||
|
* @param result the result to print,
|
||||||
|
*/
|
||||||
|
void maa_result_print(maa_result_t result);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
50
src/maa.c
50
src/maa.c
@@ -166,3 +166,53 @@ maa_check_pwm(int pin)
|
|||||||
ret->parent_id = plat->pins[pin].pwm.parent_id;
|
ret->parent_id = plat->pins[pin].pwm.parent_id;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
maa_result_print(maa_result_t result)
|
||||||
|
{
|
||||||
|
switch (result) {
|
||||||
|
case MAA_SUCCESS: fprintf(stderr, "MAA: SUCCESS\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_FEATURE_NOT_IMPLEMENTED:
|
||||||
|
fprintf(stderr, "MAA: Feature not implemented.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_FEATURE_NOT_SUPPORTED:
|
||||||
|
fprintf(stderr, "MAA: Feature not supported by Hardware.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_INVALID_VERBOSITY_LEVEL:
|
||||||
|
fprintf(stderr, "MAA: Invalid verbosity level.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_INVALID_PARAMETER:
|
||||||
|
fprintf(stderr, "MAA: Invalid parameter.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_INVALID_HANDLE:
|
||||||
|
fprintf(stderr, "MAA: Invalid Handle.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_NO_RESOURCES:
|
||||||
|
fprintf(stderr, "MAA: No resources.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_INVALID_RESOURCE:
|
||||||
|
fprintf(stderr, "MAA: Invalid resource.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_INVALID_QUEUE_TYPE:
|
||||||
|
fprintf(stderr, "MAA: Invalid Queue Type.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_NO_DATA_AVAILABLE:
|
||||||
|
fprintf(stderr, "MAA: No Data available.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_INVALID_PLATFORM:
|
||||||
|
fprintf(stderr, "MAA: Platform not recognised.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_PLATFORM_NOT_INITIALISED:
|
||||||
|
fprintf(stderr, "MAA: Platform not initialised.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_PLATFORM_ALREADY_INITIALISED:
|
||||||
|
fprintf(stderr, "MAA: Platform already initialised.\n");
|
||||||
|
break;
|
||||||
|
case MAA_ERROR_UNSPECIFIED:
|
||||||
|
fprintf(stderr, "MAA: Unspecified Error.\n");
|
||||||
|
break;
|
||||||
|
default: fprintf(stderr, "MAA: Unrecognised error.\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user