libcdio  0.90
mmc_util.h
Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2010, 2012 Rocky Bernstein <rocky@gnu.org>
00003 
00004     This program is free software: you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation, either version 3 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 
00025 #ifndef CDIO_MMC_UTIL_H_
00026 #define CDIO_MMC_UTIL_H_
00027 
00028 #include <cdio/device.h>
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif /* __cplusplus */
00033 
00036     typedef enum {
00037         CDIO_MMC_FEATURE_PROF_NON_REMOVABLE = 0x0001, 
00039         CDIO_MMC_FEATURE_PROF_REMOVABLE     = 0x0002, 
00041         CDIO_MMC_FEATURE_PROF_MO_ERASABLE   = 0x0003, 
00044         CDIO_MMC_FEATURE_PROF_MO_WRITE_ONCE = 0x0004, 
00046         CDIO_MMC_FEATURE_PROF_AS_MO         = 0x0005, 
00048         CDIO_MMC_FEATURE_PROF_CD_ROM        = 0x0008, 
00050         CDIO_MMC_FEATURE_PROF_CD_R          = 0x0009, 
00052         CDIO_MMC_FEATURE_PROF_CD_RW         = 0x000A, 
00055         CDIO_MMC_FEATURE_PROF_DVD_ROM       = 0x0010, 
00056         CDIO_MMC_FEATURE_PROF_DVD_R_SEQ     = 0x0011, 
00058         CDIO_MMC_FEATURE_PROF_DVD_RAM       = 0x0012, 
00059         CDIO_MMC_FEATURE_PROF_DVD_RW_RO     = 0x0013, 
00061         CDIO_MMC_FEATURE_PROF_DVD_RW_SEQ    = 0x0014, 
00063         CDIO_MMC_FEATURE_PROF_DVD_R_DL_SEQ  = 0x0015, 
00065         CDIO_MMC_FEATURE_PROF_DVD_R_DL_JR   = 0x0016, 
00067         CDIO_MMC_FEATURE_PROF_DVD_PRW       = 0x001A, 
00068         CDIO_MMC_FEATURE_PROF_DVD_PR        = 0x001B, 
00069         CDIO_MMC_FEATURE_PROF_DDCD_ROM      = 0x0020, 
00070         CDIO_MMC_FEATURE_PROF_DDCD_R        = 0x0021, 
00071         CDIO_MMC_FEATURE_PROF_DDCD_RW       = 0x0022, 
00072         CDIO_MMC_FEATURE_PROF_DVD_PRW_DL    = 0x002A, 
00073         CDIO_MMC_FEATURE_PROF_DVD_PR_DL     = 0x002B, 
00076         CDIO_MMC_FEATURE_PROF_BD_ROM        = 0x0040, 
00077         CDIO_MMC_FEATURE_PROF_BD_SEQ        = 0x0041, 
00079         CDIO_MMC_FEATURE_PROF_BD_R_RANDOM   = 0x0042, 
00080         CDIO_MMC_FEATURE_PROF_BD_RE         = 0x0043, 
00082         CDIO_MMC_FEATURE_PROF_HD_DVD_ROM    = 0x0050, 
00083         CDIO_MMC_FEATURE_PROF_HD_DVD_R      = 0x0051, 
00084         CDIO_MMC_FEATURE_PROF_HD_DVD_RAM    = 0x0052, 
00086         CDIO_MMC_FEATURE_PROF_NON_CONFORM   = 0xFFFF, 
00088     } cdio_mmc_feature_profile_t;
00089   
00094     const char *mmc_feature2str( int i_feature );
00095     
00104     void mmc_get_drive_cap ( CdIo_t *p_cdio,
00105                              /*out*/ cdio_drive_read_cap_t  *p_read_cap,
00106                              /*out*/ cdio_drive_write_cap_t *p_write_cap,
00107                              /*out*/ cdio_drive_misc_cap_t  *p_misc_cap);
00108     
00112     const char *mmc_feature_profile2str( int i_feature_profile );
00113 
00114     bool mmc_is_disctype_bd(cdio_mmc_feature_profile_t disctype);
00115     bool mmc_is_disctype_cdrom(cdio_mmc_feature_profile_t disctype);
00116     bool mmc_is_disctype_dvd(cdio_mmc_feature_profile_t disctype);
00117     bool mmc_is_disctype_hd_dvd (cdio_mmc_feature_profile_t disctype);
00118     bool mmc_is_disctype_overwritable (cdio_mmc_feature_profile_t disctype);
00119     bool mmc_is_disctype_rewritable(cdio_mmc_feature_profile_t disctype);
00120     
00122 #define MMC_READ_TIMEOUT_DEFAULT 3*60*1000
00123     
00128     extern uint32_t mmc_read_timeout_ms;
00129     
00133     extern const char mmc_sense_key2str[16][40];
00134 
00138 #define MMC_TIMEOUT_DEFAULT 6000
00139 
00144     extern uint32_t mmc_timeout_ms; 
00145 
00146 #ifdef __cplusplus
00147 }
00148 #endif /* __cplusplus */
00149 
00150 #endif /* CDIO_MMC_UTIL_H_ */
00151 /* 
00152  * Local variables:
00153  *  c-file-style: "gnu"
00154  *  tab-width: 8
00155  *  indent-tabs-mode: nil
00156  * End:
00157  */