Add packet to close device.

This commit is contained in:
2019-10-26 15:47:36 +01:00
parent 934a836412
commit 1617e54a06
4 changed files with 37 additions and 5 deletions

View File

@@ -1202,5 +1202,23 @@ namespace DiscImageChef.Devices.Remote
return offset;
}
public void Close()
{
var cmdPkt = new DicPacketCmdClose
{
hdr = new DicPacketHeader
{
remote_id = Consts.RemoteId, packet_id = Consts.PacketId,
len = (uint) Marshal.SizeOf<DicPacketCmdClose>(),
version = Consts.PacketVersion,
packetType = DicPacketType.CommandCloseDevice
}
};
var buf = Marshal.StructureToByteArrayLittleEndian(cmdPkt);
_socket.Send(buf, SocketFlags.None);
}
}
}