12345678910111213141516171819202122232425262728293031323334353637 |
- using Core.Communication.Transport;
- using PLC.Siemens.Protocol.Common;
- using PLC.Siemens.Protocol.Header;
- using PLC.Siemens.O;
- namespace PLC.Siemens.Protocol.Upload
- {
- public class StartUploadRequest:IBuildRequest
- {
- public HeaderPacket Header { get; set; }
- public StartUploadParamsRequest Params { get; set; }
- public BlockType BlockType { get; set; }
- public ushort BlockNum { get; set; }
- public StartUploadRequest()
- {
- Header = new HeaderPacket();
- Params=new StartUploadParamsRequest();
- }
- public void Build()
- {
- Params.Build(BlockType, BlockNum);
- Header.Build(PduType.Request, Params.PacketLength, 0x000);
- }
- public ByteBuffer GetBuffer()
- {
- ByteBuffer buffer = ByteBuffer.Allocate();
- Header.GetByteBuffer(buffer);
- Params.GetByteBuffer(buffer);
- return buffer;
- }
- }
- }
|