private void NotifyParsingDataIncommingEvent( List <KeyValuePair <string, string> > parsedList, DcmAppRxIndicationArgs args, bool postiveRes) { ParsingDataIncommingEventArgs parsingArgs = new ParsingDataIncommingEventArgs(); parsingArgs.EntryList = parsedList; parsingArgs.ResponseData = args.ResponseData; parsingArgs.RequestData = args.RequestData; parsingArgs.PostiveResponse = postiveRes; parsingArgs.RequestCanId = args.RequestCanId; parsingArgs.ResponseCanId = args.ResponseCanId; DcmService.FireParsingDataIncommingEvent(parsingArgs); }
private static void Timer_Elapsed(object sender, ElapsedEventArgs e) { #region Debug Raw Data Incomming event RawDataIncommingEventArgs rawArgs = new RawDataIncommingEventArgs(); rawArgs.CanId = random.Next(0x7ff); Func <List <byte> > autoRandomPackage = () => { List <byte> result = new List <byte>(); int packageLen = random.Next(8); packageLen = Math.Max(1, packageLen); for (int i = 0; i < packageLen; i++) { result.Add((byte)random.Next(0xff)); } return(result); }; rawArgs.Data = autoRandomPackage(); RawDataIncomming?.Invoke(rawArgs); #endregion #region Debug Parsing incomming event ParsingDataIncommingEventArgs parsingArgs = new ParsingDataIncommingEventArgs(); parsingArgs.EntryList = new List <KeyValuePair <string, string> >(); int argsCount = random.Next(0x30); argsCount = Math.Max(argsCount, 1); for (int i = 0; i < argsCount; i++) { parsingArgs.EntryList.Add(new KeyValuePair <string, string>( string.Format("Key={0}", random.Next(0x10)), string.Format("Value={0}", random.Next(0x10)))); } ParsingDataIncomming?.Invoke(parsingArgs); #endregion }
public static void FireParsingDataIncommingEvent(ParsingDataIncommingEventArgs args) { ParsingDataIncomming?.Invoke(args); }