protected override void CreateInstance() { var firstSegmentCmd = CreateFirstSegmentCmd(_data); _firstSegmentSendOperation = new SendDataOperation(NodeId, firstSegmentCmd, TxOptions) { SubstituteSettings = new SubstituteSettings(SubstituteFlags.DenySecurity, 0) }; _nextSegmentSendOperation = new SendDataOperation(NodeId, null, TxOptions) { SubstituteSettings = new SubstituteSettings(SubstituteFlags.DenySecurity, 0) }; var completeCmd = new COMMAND_CLASS_TRANSPORT_SERVICE_V2.COMMAND_SEGMENT_COMPLETE(); completeCmd.properties2.sessionId = _sessionId; byte[] completeCmdData = completeCmd; _segmentCompleteExpect = new ExpectDataOperation(0, NodeId, new ByteIndex[] { completeCmdData[0], completeCmdData[1], completeCmdData[2] }, SEGMENT_COMPLETE_TIMEOUT ) { SubstituteSettings = new SubstituteSettings(SubstituteFlags.DenySecurity, 0), Name = "ExpectData-SegmentComplete" }; var requestCmd = new COMMAND_CLASS_TRANSPORT_SERVICE_V2.COMMAND_SEGMENT_REQUEST(); _segmentRequestResponse = new ResponseDataOperation(new ResponseDataDelegate(OnRequestSegment), _transportServiceManagerInfo.TxOptions, NodeId, ((byte[])requestCmd)[0], ((byte[])requestCmd)[1] ) { SubstituteSettings = new SubstituteSettings(SubstituteFlags.DenySecurity, 0) }; var waitCmd = new COMMAND_CLASS_TRANSPORT_SERVICE_V2.COMMAND_SEGMENT_WAIT(); _waitSegmentResponse = new ResponseDataOperation(new ResponseDataDelegate(OnWaitSegment), _transportServiceManagerInfo.TxOptions, NodeId, ((byte[])waitCmd)[0], ((byte[])waitCmd)[1] ) { SubstituteSettings = new SubstituteSettings(SubstituteFlags.DenySecurity, 0) }; }
public new ActionToken ExpectData(byte destNodeId, byte[] data, int timeoutMs, Action <IActionItem> completedCallback) { ExpectDataOperation operation = new ExpectDataOperation(destNodeId, 0, data, 2, timeoutMs); return(ExecuteAsync(operation, completedCallback)); }
public ExpectDataResult ExpectData(byte destNodeId, byte[] data, int timeoutMs) { ExpectDataOperation operation = new ExpectDataOperation(destNodeId, 0, data, 2, timeoutMs); return((ExpectDataResult)Execute(operation)); }