⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 megaco_test_msg_prev3c_lib.erl

📁 OTP是开放电信平台的简称
💻 ERL
📖 第 1 页 / 共 5 页
字号:
cre_StreamID(Val) when 0 =< Val, Val =< 65535 ->    Val;cre_StreamID(Val) ->    exit({invalid_ContextID, Val}).%% RequestID must be present if eventList is non emptycre_EventsDescriptor() ->    #'EventsDescriptor'{eventList = []}.cre_EventsDescriptor(RID, [H|_] = EL)   when integer(RID), record(H, 'RequestedEvent') ->    #'EventsDescriptor'{requestID = RID, eventList = EL}.    cre_RequestedEvent(N) ->    #'RequestedEvent'{pkgdName = N}.cre_RequestedEvent(N, EPL)   when is_list(N) and is_list(EPL) ->    #'RequestedEvent'{pkgdName  = N,		      evParList = EPL};cre_RequestedEvent(N, EA)   when is_list(N) and is_record(EA, 'RequestedActions')->    #'RequestedEvent'{pkgdName    = N,		      eventAction = EA}.cre_RequestedEvent(N, SID, EPL)   when is_list(N) and is_integer(SID) and is_list(EPL) ->    #'RequestedEvent'{pkgdName  = N,		      streamID  = SID, 		      evParList = EPL};cre_RequestedEvent(N, EA, EPL)   when is_list(N) and is_record(EA, 'RequestedActions') and is_list(EPL) ->    #'RequestedEvent'{pkgdName     = N,		      eventAction  = EA, 		      evParList    = EPL}.cre_RequestedEvent(N, SID, EA, EPL)   when is_list(N) and        is_integer(SID) and       is_record(EA, 'RequestedActions') and        is_list(EPL) ->    #'RequestedEvent'{pkgdName     = N,		      streamID     = SID, 		      eventAction  = EA, 		      evParList    = EPL}.cre_RegulatedEmbeddedDescriptor() ->    #'RegulatedEmbeddedDescriptor'{}.cre_RegulatedEmbeddedDescriptor(D) ->    case is_SecondEventsDescriptor(D) of	true ->	    #'RegulatedEmbeddedDescriptor'{secondEvent = D};	false ->	    case is_SignalsDescriptor(D) of		true ->		    #'RegulatedEmbeddedDescriptor'{signalsDescriptor = D};		false ->		    error({invalid_RegulatedEmbeddedDescriptor, D})	    end    end.cre_RegulatedEmbeddedDescriptor(SED, SD)   when ((SED == asn1_NOVALUE) or is_record(SED, 'SecondEventsDescriptor')) and       ((SD  == asn1_NOVALUE) or is_list(SD)) ->    #'RegulatedEmbeddedDescriptor'{secondEvent       = SED,				   signalsDescriptor = SD}.cre_NotifyBehaviour(notifyImmediate = Tag, 'NULL' = Val) ->    {Tag, Val};cre_NotifyBehaviour(notifyRegulated = Tag, Val)   when is_record(Val, 'RegulatedEmbeddedDescriptor') ->    {Tag, Val};cre_NotifyBehaviour(neverNotify = Tag, 'NULL' = Val) ->    {Tag, Val};cre_NotifyBehaviour(Tag, Val) ->    error({invalid_NotifyBehaviour, [Tag, Val]}).cre_RequestedActions() ->    #'RequestedActions'{}.cre_RequestedActions(KA)   when (KA == true) or (KA == true) ->    #'RequestedActions'{keepActive = KA};cre_RequestedActions(SE)   when is_record(SE, 'SecondEventsDescriptor') ->    #'RequestedActions'{secondEvent = SE};cre_RequestedActions(SD)   when is_list(SD) ->    #'RequestedActions'{signalsDescriptor = SD};cre_RequestedActions({Tag, _} = EDM)   when is_atom(Tag) ->    #'RequestedActions'{eventDM = EDM}.cre_RequestedActions(KA, {Tag, _} = EDM, SE, SD)   when ((KA == true) or (KA == true) or (KA == asn1_NOVALUE)) and       (is_atom(Tag) or (EDM == asn1_NOVALUE)) and       (is_record(SE, 'SecondEventsDescriptor') or (SE == asn1_NOVALUE)) and       (is_list(SD) or (SD == asn1_NOVALUE)) ->    #'RequestedActions'{keepActive        = KA, 			eventDM           = EDM, 			secondEvent       = SE, 			signalsDescriptor = SD}.cre_RequestedActions(KA, {EDMTag, _} = EDM, SE, SD, {NBTag, _} = NB, RED)   when ((KA == true) or (KA == true) or (KA == asn1_NOVALUE)) and       (is_atom(EDMTag) or (EDM == asn1_NOVALUE)) and       (is_record(SE, 'SecondEventsDescriptor') or (SE == asn1_NOVALUE)) and       (is_list(SD) or (SD == asn1_NOVALUE)) and       (is_atom(NBTag) or (NB == asn1_NOVALUE)) and       ((RED == 'NULL') or (RED == asn1_NOVALUE))  ->    #'RequestedActions'{keepActive            = KA, 			eventDM               = EDM, 			secondEvent           = SE, 			signalsDescriptor     = SD,			notifyBehaviour       = NB,			resetEventsDescriptor = RED}.cre_EventDM(N) when list(N) ->    {digitMapName, N};cre_EventDM(V) when record(V, 'DigitMapValue') ->    {digitMapValue, V}.cre_SecondEventsDescriptor([H|_] = EL)   when record(H, 'SecondRequestedEvent') ->    #'SecondEventsDescriptor'{eventList = EL}.    cre_SecondEventsDescriptor(RID, [H|_] = EL)   when integer(RID), record(H, 'SecondRequestedEvent') ->    #'SecondEventsDescriptor'{requestID = RID, eventList = EL}.    cre_SecondRequestedEvent(N, EPL)   when is_list(N) and is_list(EPL) ->    #'SecondRequestedEvent'{pkgdName  = N,			    evParList = EPL};cre_SecondRequestedEvent(N, EPL) ->    error({invalid_SecondRequestedEvent, [N, EPL]}).cre_SecondRequestedEvent(N, SID, EPL)   when is_list(N) and is_integer(SID) and is_list(EPL) ->    #'SecondRequestedEvent'{pkgdName  = N,			    streamID  = SID, 			    evParList = EPL};cre_SecondRequestedEvent(N, EA, EPL)   when is_list(N) and        is_record(EA, 'SecondRequestedActions') and        is_list(EPL) ->    #'SecondRequestedEvent'{pkgdName     = N,			    eventAction  = EA, 			    evParList    = EPL}.cre_SecondRequestedEvent(N, SID, EA, EPL)   when is_list(N) and        is_integer(SID) and        is_record(EA, 'SecondRequestedActions') and        is_list(EPL) ->    #'SecondRequestedEvent'{pkgdName     = N,			    streamID     = SID, 			    eventAction  = EA, 			    evParList    = EPL}.cre_SecondRequestedActions() ->    #'SecondRequestedActions'{}.cre_SecondRequestedActions(KA)   when ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) ->    #'SecondRequestedActions'{keepActive = KA};cre_SecondRequestedActions(SD) when list(SD) ->    #'SecondRequestedActions'{signalsDescriptor = SD};cre_SecondRequestedActions({Tag, _} = Val) when atom(Tag) ->    case is_EventDM(Val) of	true ->	    #'SecondRequestedActions'{eventDM = Val};	false ->	    case is_NotifyBehaviour(Val) of		true ->		    #'SecondRequestedActions'{notifyBehaviour = Val};		false ->		    error({invalid_SecondRequestedActions, Val})	    end    end;cre_SecondRequestedActions('NULL' = RED) ->    #'SecondRequestedActions'{resetEventsDescriptor = RED}.cre_SecondRequestedActions(KA, SD)   when ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) and       is_list(SD) ->    #'SecondRequestedActions'{keepActive = KA, signalsDescriptor = SD};cre_SecondRequestedActions(KA, {Tag, _} = Val)   when ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) and       is_atom(Tag) ->    case is_EventDM(Val) of	true ->	    #'SecondRequestedActions'{keepActive = KA, 				      eventDM    = Val};	false ->	    case is_NotifyBehaviour(Val) of		true ->		    #'SecondRequestedActions'{keepActive      = KA, 					      notifyBehaviour = Val};		false ->		    error({invalid_SecondRequestedActions, Val})	    end    end;cre_SecondRequestedActions(KA, 'NULL' = RED)   when ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) ->    #'SecondRequestedActions'{keepActive            = KA, 			      resetEventsDescriptor = RED}.cre_SecondRequestedActions(KA, {Tag, _} = EDM, SD)   when ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) and       is_atom(Tag) and        is_list(SD) ->    #'SecondRequestedActions'{keepActive        = KA, 			      eventDM           = EDM, 			      signalsDescriptor = SD};cre_SecondRequestedActions(KA, SD, {Tag, _} = NB)   when ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) and       is_list(SD) and       is_atom(Tag) ->    #'SecondRequestedActions'{keepActive        = KA,			      signalsDescriptor = SD,			      notifyBehaviour   = NB};cre_SecondRequestedActions(KA, SD, 'NULL' = RED)   when ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) and       is_list(SD) ->    #'SecondRequestedActions'{keepActive            = KA,			      signalsDescriptor     = SD,			      resetEventsDescriptor = RED}.cre_SecondRequestedActions(KA, {EDMTag, _} = EDM, SD, 			   {NBTag, _} = NB, RED)   when ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) and       (is_atom(EDMTag) or (EDM == asn1_NOVALUE)) and       (is_list(SD) or (SD == asn1_NOVALUE)) and        (is_atom(NBTag) or (NB == asn1_NOVALUE)) and       ((RED == 'NULL') or (RED == asn1_NOVALUE)) ->    #'SecondRequestedActions'{keepActive            = KA,			      eventDM               = EDM, 			      signalsDescriptor     = SD,			      notifyBehaviour       = NB,			      resetEventsDescriptor = RED}.cre_EventBufferDescriptor([H|_] = D) when record(H, 'EventSpec') ->    D.cre_EventSpec(N, [H|_] = EPL) when list(N), record(H, 'EventParameter') ->    #'EventSpec'{eventName = N, eventParList = EPL}.cre_EventSpec(N, SID, [H|_] = EPL)   when list(N), integer(SID), record(H, 'EventParameter') ->    #'EventSpec'{eventName = N, streamID = SID, eventParList = EPL}.    cre_SignalsDescriptor(D) ->    case is_SignalsDescriptor(D) of	true ->	    D;	false ->	    error({invalid_SignalsDescriptor, D})    end.cre_SignalRequest(S) when record(S, 'Signal') ->    {signal, S};cre_SignalRequest(S) when record(S, 'SeqSigList') ->    {seqSigList, S}.cre_SeqSigList(ID, [H|_] = SL)   when integer(ID), 0 =< ID, ID =< 65535, record(H, 'Signal') ->    #'SeqSigList'{id = ID, signalList = SL}.cre_Signal(N) when list(N) ->    #'Signal'{signalName = N}.cre_Signal(N, SPL) when list(N), list(SPL) ->    #'Signal'{signalName = N,	      sigParList = SPL}.cre_Signal(N, SID, ST, Dur, NC, KA, SPL)   when is_list(N) and        (is_integer(SID) or (SID == asn1_NOVALUE)) and        ((ST == brief) or (ST == onOff) or (ST == timeOut) or 	(ST == asn1_NOVALUE)) and       ((is_integer(Dur) and (0 =< Dur) and (Dur =< 65535)) or 	(Dur == asn1_NOVALUE)) and       (is_list(NC) or (NC == asn1_NOVALUE)) and       ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) and       is_list(SPL) ->    #'Signal'{signalName       = N,	      streamID         = SID,	      sigType          = ST,	      duration         = Dur,	      notifyCompletion = NC,	      keepActive       = KA,	      sigParList       = SPL}.cre_Signal(N, SID, ST, Dur, NC, KA, SPL, Dir, RID)   when is_list(N) and        (is_integer(SID) or (SID == asn1_NOVALUE)) and        ((ST == brief) or (ST == onOff) or (ST == timeOut) or 	(ST == asn1_NOVALUE)) and       ((is_integer(Dur) and (0 =< Dur) and (Dur =< 65535)) or 	(Dur == asn1_NOVALUE)) and       (is_list(NC) or (NC == asn1_NOVALUE)) and       ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) and       is_list(SPL) and       ((Dir == internal) or (Dir == external) or (Dir == both) or 	(Dir == asn1_NOVALUE)) and       (is_integer(RID) or (RID == asn1_NOVALUE)) ->    #'Signal'{signalName       = N,	      streamID         = SID,	      sigType          = ST,	      duration         = Dur,	      notifyCompletion = NC,	      keepActive       = KA,	      sigParList       = SPL,	      direction        = Dir,	      requestID        = RID}.cre_Signal(N, SID, ST, Dur, NC, KA, SPL, Dir, RID, ISIG)   when is_list(N) and        (is_integer(SID) or (SID == asn1_NOVALUE)) and        ((ST == brief) or (ST == onOff) or (ST == timeOut) or 	(ST == asn1_NOVALUE)) and       ((is_integer(Dur) and (0 =< Dur) and (Dur =< 65535)) or 	(Dur == asn1_NOVALUE)) and       (is_list(NC) or (NC == asn1_NOVALUE)) and       ((KA == true) or (KA == false) or (KA == asn1_NOVALUE)) and       is_list(SPL) and       ((Dir == internal) or (Dir == external) or (Dir == both) or 	(Dir == asn1_NOVALUE)) and       (is_integer(RID) or (RID == asn1_NOVALUE)) and       (is_integer(ISIG) or (ISIG == asn1_NOVALUE)) ->    #'Signal'{signalName       = N,	      streamID         = SID,	      sigType          = ST,	      duration         = Dur,	      notifyCompletion = NC,	      keepActive       = KA,	      sigParList       = SPL,	      direction        = Dir,	      requestID        = RID,	      intersigDelay    = ISIG}.cre_SignalType(brief = ST) ->    ST;cre_SignalType(onOff = ST) ->    ST;cre_SignalType(timeOut = ST) ->    ST.cre_SignalDirection(internal = SD) ->    SD;cre_SignalDirection(external = SD) ->    SD;cre_SignalDirection(both = SD) ->    SD.cre_SignalName(N) ->    cre_PkgdName(N).cre_NotifyCompletion(L) when list(L) ->    Vals = [onTimeOut, onInterruptByEvent, 	    onInterruptByNewSignalDescr, otherReason],    F = fun(E) -> case lists:member(E, Vals) of		      true ->			  ok;		      false ->			  exit({invalid_NotifyCompletion, E})		  end	end,    lists:foreach(F, L),    L.cre_SigParameter(N, V) when list(N), list(V) ->    #'SigParameter'{sigParameterName = N, value = V}.cre_SigParameter(N, V, relation = Tag, R)   when is_list(N) and is_list(V) and is_atom(R) ->    EI = {Tag, R},     #'SigParameter'{sigParameterName = N, value = V, extraInfo = EI};cre_SigParameter(N, V, range = Tag, B)   when is_list(N) and is_list(V) and is_atom(B) ->    EI = {Tag, B},  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -