Skip to content

Conversation

@mr-const
Copy link

@mr-const mr-const commented Dec 6, 2022

This PR contains only commands, parameters and their respective enum values to support DVD devices

ControlModePage = 0x0A,
PowerConditionModePage = 0x1A,
InformationalExceptionsControlModePage = 0x1C,
MMCapabilitiesAndMechanicalStatus = 0x2A,
Copy link
Owner

@TalAloni TalAloni Dec 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is device specific, right? which specification covers that 0x2A code?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is CD/DVD device specific (MMC), Windows requests it, for example, when peripheral device type is 0x5.
You can find it's description in scsi spec paragraph 5.2.3.4 (http://www.13thmonkey.org/documentation/SCSI/x3_304_1997.pdf)

TransferLength = (uint)AllocationLength;
}

public override byte[] GetBytes() => throw new NotImplementedException();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably implement GetBytes for completeness,
Also, it would be easier for me if you add this command implementation as a separate PR - it's hard to find time to sit and review large PRs

// Request Type
public byte RT;
// Starting Feature Number
public ushort SFN;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StartingFeatureNumber is more easily understandable than SFN


namespace SCSI
{
internal class GetConfigurationCommand : SCSICommandDescriptorBlock
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this inherit from SCSICommandDescriptorBlock10? and than you can use some of the fields...


namespace SCSI
{
internal class ReadTocCommand : SCSICommandDescriptorBlock
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this inherit from SCSICommandDescriptorBlock10? and than you can use some of the fields...

TransferLength = (uint)AllocationLength;
}

public override byte[] GetBytes() => throw new NotImplementedException();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer implementing GetBytes for completeness, as it shouldn't take too much work


namespace SCSI
{
public class ModeSense10CommandDescriptorBlock : SCSICommandDescriptorBlock
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this inherit from SCSICommandDescriptorBlock10?


public override byte[] GetBytes()
{
var buffer = new byte[PacketLength];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"byte[] buffer" is better IMO

@@ -0,0 +1,268 @@
using System;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the prettiest class I've seen

@@ -0,0 +1,34 @@
using System;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could have been a more detailed implementation

{
switch(_format)
{
case 0: return GetFormattedTOC();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't each format deserve a class?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants