示例#1
0
        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);
        }
示例#2
0
        private void NotifyDcmAppRxIndication(int canId, int hostId, List <byte> reqData)
        {
            DcmTpHandleResult handleResult = protocol.GetHandleResult();
            List <byte>       receivedData = protocol.GetReceivedData();

            DcmAppRxIndicationArgs args = new DcmAppRxIndicationArgs();

            args.Result        = handleResult;
            args.RequestData   = reqData;
            args.ResponseData  = receivedData;
            args.RequestCanId  = canId;
            args.ResponseCanId = hostId;
            rxIndication(args);

            workState = WorkStateEnum.Idle;
        }
示例#3
0
        private void DcmAppRxIndication(DcmAppRxIndicationArgs args)
        {
            List <KeyValuePair <string, string> > parsedList = null;
            bool postiveRes = false;

            switch (args.Result)
            {
            case DcmTpHandleResult.OK:
                parsedList = parser.Parse(args.ResponseData, out postiveRes);
                break;

            case DcmTpHandleResult.OKWithSupporessResp:
                return;

            case DcmTpHandleResult.Fail:
                parsedList = FailedHandleResult;
                break;

            case DcmTpHandleResult.FailWithReceive:
                parsedList = FailedWithReceiveHandleResult;
                break;

            case DcmTpHandleResult.FailWithReceiveTimeout:
                parsedList = FailWithReceiveTimeoutHanldeResult;
                break;

            case DcmTpHandleResult.FailWithSend:
                parsedList = FailWithSendHandleResult;
                break;

            default:
                throw new InvalidOperationException("DcmApp: Unknown handle result->"
                                                    + args.Result.ToString());
            }

            NotifyParsingDataIncommingEvent(parsedList, args, postiveRes);
        }