From ecff23366e442e5cc657e3eb78edc4fa5bb93a9e Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Mon, 8 Feb 2010 19:28:44 -0500 Subject: [PATCH] Use mmc_get_disctype in mmc example. --- example/mmc1.c | 15 ++++++++++++--- test/driver/mmc.c | 4 +++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/example/mmc1.c b/example/mmc1.c index 67adaace..8feae0c9 100644 --- a/example/mmc1.c +++ b/example/mmc1.c @@ -32,6 +32,7 @@ #endif #include #include +#include /* Set how long to wait for MMC commands to complete */ #define DEFAULT_TIMEOUT_MS 10000 @@ -81,12 +82,20 @@ main(int argc, const char *argv[]) } { - driver_return_code_t drc; - bool b_erasable = mmc_get_disc_erasable(p_cdio, &drc); - if (DRIVER_OP_SUCCESS == drc) + driver_return_code_t i_status; + bool b_erasable = mmc_get_disc_erasable(p_cdio, &i_status); + cdio_mmc_feature_profile_t disctype; + if (DRIVER_OP_SUCCESS == i_status) printf("Disc is %serasable.\n", b_erasable ? "" : "not "); else printf("Can't determine if disc is erasable.\n"); + + i_status = mmc_get_disctype(p_cdio, 0, &disctype); + if (DRIVER_OP_SUCCESS == i_status) { + printf("disc type: profile is %s (0x%X)\n", + mmc_feature_profile2str(disctype), + disctype); + } } } diff --git a/test/driver/mmc.c b/test/driver/mmc.c index e4b7236c..2a916256 100644 --- a/test/driver/mmc.c +++ b/test/driver/mmc.c @@ -130,7 +130,9 @@ test_get_disctype(CdIo_t *p_cdio, bool b_verbose) driver_return_code_t i_status = mmc_get_disctype(p_cdio, 0, &disctype); if (DRIVER_OP_SUCCESS == i_status) { if (b_verbose) - fprintf(stderr, "test_disctype: type is 0x%X\n", disctype); + fprintf(stderr, "test_disctype: profile is %s (0x%X)\n", + mmc_feature_profile2str(disctype), + disctype); } return DRIVER_OP_SUCCESS; }