Octocontrabass wrote:
I'd guess most software uses TEST UNIT READY to detect if a disc is inserted. It seems to be intended for that purpose.
I thought this was the case too, and it probably is.
However, the specification states:
Quote:
If the logical unit is able to accept an appropriate medium-access command without returning CHECK CONDITION status, this command shall return a GOOD status. If the logical unit is unable to become operational or is in a state such that an application client action (e.g., START UNIT command) is required to make the logical unit ready, the command shall be terminated with CHECK CONDITION status, with the sense key set to NOT READY.
The first sentence would imply that this command could be used for exactly this purpose. However, the unit could be in a different state and need a reset or other action before it is ready for medium-access *and* still have a disc inserted. i.e.: It needs the START_UNIT command.
Therefore, I went looking for another technique. I would like a way to see the "inserted" status, no matter the state of the logical-unit. (Granted if the unit can't provide the state, there is no need to know that a disk is inserted.)
Doing some more tests, I think I might stick with the Event Notification command technique. This technique is designed to be periodically sent to the unit, maybe once every few seconds.
Thanks,
Ben