Re: Re: USB DVD Device Support

Home › Forums › Development › USB DVD Device Support › Re: Re: USB DVD Device Support

#28334
aka107
Member

@clava wrote:

@Rodries
@rodries wrote:

Seems that the only way to detect if the dvd is inserted is calling to USBStorage_ReadCapacity
So if you use my old USBStorage_IsDVD then it will return 0 if dvd is not inserted

What about adding something like this:


if(__mounted) {
u32 sectorsize, numSectors;
if (USBStorage_ReadCapacity(&__usbfd, __lun, &sectorsize, &numSectors) < 0)
return false;
else
return true;
}

at the beginning of __usbstorage_IsInserted()? It works in wiimc 😀

uhmm, I think we can add another condition to check only if the usb device is a dvd, only for security


if(__mounted && __usbfd.sector_size[__lun]==2048) { //mounted and a dvd
u32 sectorsize, numSectors;
if (USBStorage_ReadCapacity(&__usbfd, __lun, &sectorsize, &numSectors) < 0)
return false;
else
return true;
}

Can you test it using a ios different from ios58?
I want to be sure that works with usb1 and not only with usb2
__mounted is handled in a different way in usb1

Also Tantric has to commit 2 fixes in usbstorage.c I guess he will do it very soon