multimediacommsengine/tsrc/MMCTestDriver/MCETester/ttcn/CtrlProfileFunctions.ttcn
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 // File : CtrlProfileFunctions.ttcn
       
     2 //
       
     3 // Info : This file specifies CTRL functions for using Profiles.
       
     4 //
       
     5 //        Do not modify without permission!
       
     6 //
       
     7 
       
     8 module CtrlProfileFunctions
       
     9 {
       
    10 
       
    11 import from CtrlFunctions all;
       
    12 import from CtrlRel2Types all;
       
    13 import from CtrlRel2Templates all;
       
    14 import from CtrlProfileTemplates all;
       
    15 import from OtherTypesAndConstants all;
       
    16 import from TestSystem all;
       
    17 
       
    18 //
       
    19 // -- Profile functions --------------------------------------------------------
       
    20 //
       
    21 
       
    22 
       
    23 function f_ctrlCreateProfile ( in template ParameterList p_params ) runs on CtrlCompType return AbstractCtrlResponse
       
    24 	{
       
    25 	return f_ctrlGenericRequest( "CreateProfile", {}, omit, p_params );
       
    26 	}
       
    27 
       
    28 function f_ctrlCreateProfileRegistry () runs on CtrlCompType return AbstractCtrlResponse
       
    29 	{
       
    30 	return f_ctrlGenericRequest( "CreateProfileRegistry", {}, omit, omit );
       
    31 	}
       
    32 
       
    33 function f_ctrlDeleteProfile ( in template TestClientIdList p_ids ) runs on CtrlCompType return AbstractCtrlResponse
       
    34 	{
       
    35 	return f_ctrlGenericRequest( "DeleteProfile", {}, p_ids, omit );
       
    36 	}
       
    37 	
       
    38 function f_ctrlDestroyAllProfiles () runs on CtrlCompType return AbstractCtrlResponse
       
    39 	{
       
    40 	return f_ctrlGenericRequest( "DestroyAllProfiles", {}, omit, omit );
       
    41 	}	
       
    42 	
       
    43 function f_ctrlDestroyProfile ( in template TestClientIdList p_ids ) runs on CtrlCompType return AbstractCtrlResponse
       
    44 	{
       
    45 	return f_ctrlGenericRequest( "DestroyProfile", {}, p_ids, omit );
       
    46 	}
       
    47 	
       
    48 function f_ctrlDisableProfile ( in template TestClientIdList p_ids ) runs on CtrlCompType return AbstractCtrlResponse
       
    49 	{
       
    50 	return f_ctrlGenericRequest( "DisableProfile", {}, p_ids, omit );
       
    51 	}
       
    52 
       
    53 function f_ctrlEnableProfile ( in template TestClientIdList p_ids ) runs on CtrlCompType return AbstractCtrlResponse
       
    54 	{
       
    55 	return f_ctrlGenericRequest( "EnableProfile", {}, p_ids, omit );
       
    56 	}
       
    57 
       
    58 // Use f_ctrlGetParameter, f_ctrlGetArray and f_ctrlGetStructure (in CtrlFunctions.ttcn)
       
    59 // to read actual parameter values from the returned AbstractCtrlResponse
       
    60 function f_ctrlGetDefaultProfile () runs on CtrlCompType return AbstractCtrlResponse
       
    61 	{
       
    62 	return f_ctrlGenericRequest( "GetDefaultProfile", {}, omit, omit );
       
    63 	}
       
    64 
       
    65 // Use f_ctrlGetParameter, f_ctrlGetArray and f_ctrlGetStructure (in CtrlFunctions.ttcn)
       
    66 // to read actual parameter values from the returned AbstractCtrlResponse
       
    67 function f_ctrlGetProfile ( in template TestClientIdList p_ids ) runs on CtrlCompType return AbstractCtrlResponse
       
    68 	{
       
    69 	return f_ctrlGenericRequest( "GetProfile", {}, p_ids, omit );
       
    70 	}
       
    71 
       
    72 // Returns ProfileIds as a ValueList
       
    73 function f_ctrlGetProfiles ( in template ParameterList p_params ) runs on CtrlCompType return ValueList
       
    74 	{
       
    75 	var AbstractCtrlResponse res;
       
    76 	res := f_ctrlGenericRequest( "GetProfiles", {}, omit, p_params );
       
    77 	return f_ctrlGetArray( res, a_ctrlProfileIdList( * ) );
       
    78 	}
       
    79 
       
    80 // Returns ProfileErrorCode as integer
       
    81 function f_ctrlGetProfileStatus ( in template ParameterList p_params,
       
    82 								  out charstring p_profileState ) runs on CtrlCompType return integer
       
    83 	{
       
    84 	var AbstractCtrlResponse res;
       
    85 	var charstring profileErrorCode;
       
    86 
       
    87 	res := f_ctrlGenericRequest( "GetProfileStatus", {}, omit, p_params );
       
    88 	p_profileState := f_ctrlGetParameter( res, a_ctrlProfileState( * ) );
       
    89 	profileErrorCode :=  f_ctrlGetParameter( res, a_ctrlProfileErrorCode( * ) );
       
    90 	return str2int( profileErrorCode );
       
    91 	}
       
    92 
       
    93 function f_ctrlUpdateProfile ( in template TestClientIdList p_ids,
       
    94 							   in template ParameterList p_params ) runs on CtrlCompType return AbstractCtrlResponse
       
    95 	{
       
    96 	return f_ctrlGenericRequest( "UpdateProfile", {}, p_ids, p_params );
       
    97 	}
       
    98 
       
    99 } // end of CtrlProfileFunctions