mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Send list devices packet to remote.
This commit is contained in:
@@ -128,6 +128,28 @@ namespace DiscImageChef.Devices.Remote
|
|||||||
|
|
||||||
public DeviceInfo[] ListDevices()
|
public DeviceInfo[] ListDevices()
|
||||||
{
|
{
|
||||||
|
var cmdPkt = new DicPacketCommandListDevices
|
||||||
|
{
|
||||||
|
hdr = new DicPacketHeader
|
||||||
|
{
|
||||||
|
id = Consts.PacketId,
|
||||||
|
len = (uint) Marshal.SizeOf<DicPacketCommandListDevices>(),
|
||||||
|
version = Consts.PacketVersion,
|
||||||
|
packetType = DicPacketType.CommandListDevices
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var buf = Marshal.StructureToByteArrayLittleEndian(cmdPkt);
|
||||||
|
|
||||||
|
var len = _socket.Send(buf, SocketFlags.None);
|
||||||
|
|
||||||
|
if (len >= buf.Length)
|
||||||
|
{
|
||||||
|
DicConsole.ErrorWriteLine("Could not write to the network...");
|
||||||
|
|
||||||
|
return new DeviceInfo[0];
|
||||||
|
}
|
||||||
|
|
||||||
return new DeviceInfo[0];
|
return new DeviceInfo[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user