Commit a12da094 authored by YannGarcia's avatar YannGarcia
Browse files

Add TTCN-3 typing for MEC016

parent a5fda293
......@@ -72,6 +72,10 @@ int json_codec::encode (const LibItsHttp__JsonMessageBodyTypes::JsonBody& msg, O
const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo();
mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
} else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_predictedQos)) {
const V2XInformationServiceAPI__TypesAndValues::PredictedQos& predicted_qos = msg.predictedQos();
predicted_qos.encode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
} else {
loggers::get_instance().error("json_codec::encode: Not supported");
}
......@@ -424,6 +428,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
pc5_provisioning_info.decode(V2XInformationServiceAPI__TypesAndValues::Pc5ProvisioningInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
msg.pc5ProvisioningInfo() = pc5_provisioning_info;
} else if ((it->second.find("\"predictedQos\"") != std::string::npos) || (it->second.find("\"locationGranularity\"") != std::string::npos)) {
V2XInformationServiceAPI__TypesAndValues::PredictedQos predicted_qos;
TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
predicted_qos.decode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
msg.predictedQos() = predicted_qos;
} else if (it->second.find("\"detail\"") != std::string::npos) {
LibMec__TypesAndValues::ProblemDetails problem_details;
problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
......
......@@ -301,15 +301,19 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_NF
# Check that the IUT responds with a configured provisioning information over PC5 when queried by a MEC Application
AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_01
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_01
# Check that the IUT responds with a configured provisioning information over PC5 when queried by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_02
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_BR
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_NF
# Check that the IUT sends a request about QoS information for a vehicular UE when queried by a MEC Application
AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_BR
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_NF
[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
......
module AtsMec_DeviceApplicationInterface_TestCases {
} // End of module AtsMec_DeviceApplicationInterface_TestCases
......@@ -14,6 +14,7 @@ sources := \
AtsMec_UEAppInterfaceAPI_TestCases.ttcn \
AtsMec_UEidentityAPI_TestCases.ttcn \
AtsMec_V2XInformationServiceAPI_TestCases.ttcn \
AtsMec_DeviceApplicationInterface_TestCases.ttcn \
# AtsMec_MeoPkgm_TestCases.ttcn \
# AtsMec_MepmPkgm_TestCases.ttcn \
# AtsMec_FixedAccessInfoAPI_TestCases.ttcn \
......@@ -35,6 +36,7 @@ modules := ../LibCommon \
../LibMec/UEAppInterfaceAPI \
../LibMec/UEidentityAPI \
../LibMec/V2XInformationServiceAPI \
../LibMec/DeviceApplicationInterface \
../../ccsrc/Ports/LibHttp \
../../ccsrc/EncDec/LibHttp \
../../ccsrc/EncDec/LibMec \
......
sources := \
ttcn/DeviceApplicationInterface_TypesAndValues.ttcn \
ttcn/DeviceApplicationInterface_Pics.ttcn \
ttcn/DeviceApplicationInterface_Pixits.ttcn \
ttcn/DeviceApplicationInterface_Templates.ttcn \
module DeviceApplicationInterface_Pics {
/**
* @desc Does the IUT support DeviceApplicationInterface?
*/
modulepar boolean PICS_DEVICE_APPLICATION_INTERFACE_SUPPORTED := true;
} // End of module DeviceApplicationInterface_Pics
module DeviceApplicationInterface_Pixits {
} // End of module DeviceApplicationInterface_Pixits
module DeviceApplicationInterface_Templates {
} // End of module DeviceApplicationInterface_Templates
/**
* @author ETSI / TTF T012
* @version $Url$
* $Id$
* @desc Types ANd Values for ETSI GS MEC 016 V2.2.1 (2020-04)
* @copyright ETSI Copyright Notification
* No part may be reproduced except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* All rights reserved.
*/
module DeviceApplicationInterface_TypesAndValues {
// JSON
import from JSON all;
// LibCommon
import from LibCommon_BasicTypesAndValues all;
/**
* @desc Required service continuity mode for this application.
*/
type enumerated ServiceCount {
SERVICE_CONTINUITY_NOT_REQUIRED (0),
SERVICE_CONTINUITY_REQUIRED (1)
} with {
variant "JSON: as number"
}
/**
* @desc Characteristics of the application
* @member memory The maximum size in Mbytes of the memory resource expected to be used by the MEC application instance in the MEC system
* @member storageThe maximum size in Mbytes of the storage resource expected to be used by the MEC application instance in the MEC system
* @member latency The target round trip time in milliseconds supported by the MEC system for the MEC application instance
* @member bandwidth The required connection bandwidth in kbit/s for the use of the MEC application instance
* @member serviceCont Required service continuity mode for this application
* @see ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList
*/
type record AppCharcs {
UInt32 memory optional,
UInt32 storage optional,
UInt32 latency optional,
UInt32 bandwidth optional,
ServiceCount serviceCont optional
}
/**
* @desc elements comprising the civic address
* @member caType Describe the content type of caValue. The value of caType shall comply with section 3.4 of IETF RFC 4776
* @member caValue Content of civic address element corresponding to the caType. The format caValue shall comply with section 3.4 of IETF RFC 4776
*/
type record CivicAddressElement {
JSON.Integer caType,
JSON.String caValue
}
type record Geometry {
JSON.String type_,
Coordinates coordinates
} with {
variant (type_) "name as 'type'";
}
type record of JSON.Number Coordinate;
type record of Coordinate Coordinates;
type record Property {
JSON.String key,
JSON.String value_
} with {
variant (value_) "name as 'value'";
}
type record of Property Properties;
type record Polygon {
JSON.String type_,
Geometry geometry,
Properties properties,
JSON.String this
} with {
variant (type_) "name as 'type'";
}
/**
* @desc Identifies the locations of the MEC application
* @member countryCode The two-letter ISO 3166 [7] country code in capital letters. Shall be present in case the "area" attribute is absent
* @member civicAddressElement Zero or more elements comprising the civic address
* @member area Geographic area. Shall be absent if the "civicAddressElement" attribute is present
* @see ETSI GS MEC 016 Clause 6.5.2 Type: LocationConstraints
*/
type record LocationConstraints {
JSON.String countryCode optional,
CivicAddressElement civicAddressElement optional,
Polygon area optional
}
type record of LocationConstraints LocationConstraintsList;
/**
* @desc Information on available applications
* @member appDId Identifier of this MEC application descriptor
* @member appName Name of the MEC application
* @member appProvider Provider of the MEC application
* @member appSoftVersion Software version of the MEC application
* @member appDVersion Identifies the version of the application descriptor
* @member appDescription Human readable description of the MEC application
* @member appLocation Identifies the locations of the MEC application
* @member appCharcs Characteristics of the application
* @see ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList
*/
type record ApplicationList_AppInfo {
JSON.String appDId,
JSON.String appName,
JSON.String appProvider,
JSON.String appSoftVersion optional,
JSON.String appDVersion,
JSON.String appDescription optional,
LocationConstraintsList appLocation optional,
AppCharcs appCharcs optional
}
/**
* @desc Extension for vendor specific information
* @member vendorId Vendor identifier
*/
type record VendorSpecificExt {
JSON.String vendorId
}
/**
* @desc Information on available applications
* @member appInfo List of user applications available to the device application
* @member vendorSpecificExt Extension for vendor specific information
* @see ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList
*/
type record AppListItem {
ApplicationList_AppInfo appInfo,
VendorSpecificExt vendorSpecificExt optional
}
type record of AppListItem AppList;
/**
* @desc Information on available applications
* @member appList List of user applications available to the device application
* @see ETSI GS MEC 016 Clause 6.2.2 Type: ApplicationList
*/
type record ApplicationList {
AppList appList optional
}
/**
* @desc user application instance information
* @member appInstanceId Identifier of the user application instance
* @member referenceURI Address of the user application instance
* @member appLocation Location of the user application instance
* @see ETSI GS MEC 016 Clause 6.2.3 Type: AppContext
*/
type record UserAppInstanceInfo {
JSON.String appInstanceId optional,
JSON.AnyURI referenceURI optional,
LocationConstraints appLocation optional
}
type record of UserAppInstanceInfo UserAppInstanceInfoList;
/**
* @desc Information on available applications
* @member appDId Identifier of this MEC application descriptor
* @member appName Name of the MEC application
* @member appProvider Provider of the MEC application
* @member appSoftVersion Software version of the MEC application
* @member appDVersion Identifies the version of the application descriptor
* @member appDescription Human readable description of the MEC application
* @member userAppInstanceInfo List of user application instance information
* @member appPackageSource URI of the application package
* @see ETSI GS MEC 016 Clause 6.2.3 Type: AppContext
*/
type record ApplicationContext_AppInfo {
JSON.String appDId,
JSON.String appName,
JSON.String appProvider,
JSON.String appSoftVersion optional,
JSON.String appDVersion,
JSON.String appDescription optional,
UserAppInstanceInfoList userAppInstanceInfo optional,
JSON.AnyURI appPackageSource optional
}
/**
* @desc Information on application context created by the MEC system
* @member contextId Uniquely identifies the application context in the MEC system
* @member associateDevAppId Uniquely identifies the device application
* @member callbackReference Assigned by the device application to receive application lifecycle related notifications
* @member appLocationUpdates Used by the device application to request to receive notifications at the callbackReference URI relating to location availability for user application instantiation
* @member appAutoInstantiation Provides indication to the MEC system that instantiation of the requested application is desired should a requested appLocation become available that was not at the time of the request
* @member appInfo
* @see ETSI GS MEC 016 Clause 6.2.3 Type: AppContext
*/
type record AppContext {
JSON.String contextId optional,
JSON.String associateDevAppId,
JSON.AnyURI callbackReference optional,
boolean appLocationUpdates optional,
boolean appAutoInstantiation optional,
ApplicationContext_AppInfo appInfo
}
/**
* @desc
* @member appLocation Shall only be included in the response, where it indicates a location constraint available in the MEC system
* @see ETSI GS MEC 016 Clause 6.2.4 Type: ApplicationLocationAvailability
*/
type record AvailableLocations {
LocationConstraints appLocation optional
}
type record of AvailableLocations AvailableLocationsList;
/**
* @desc
* @member appDId Identifier of this MEC application descriptor
* @member appName Name of the MEC application
* @member appProvider Provider of the MEC application
* @member appSoftVersion Software version of the MEC application
* @member appDVersion Identifies the version of the application descriptor
* @member appDescription Human readable description of the MEC application
* @member availableLocations MEC application location constraints
* @member appPackageSource URI of the application package. Shall be included in the request
* @see ETSI GS MEC 016 Clause 6.2.4 Type: ApplicationLocationAvailability
*/
type record ApplicationLocationAvailability_AppInfo {
JSON.String appDId,
JSON.String appName,
JSON.String appProvider,
JSON.String appSoftVersion optional,
JSON.String appDVersion,
JSON.String appDescription optional,
AvailableLocationsList availableLocations optional,
JSON.AnyURI appPackageSource optional
}
/**
* @desc Information on locations available instantiation of new user application instances
* @member associateDevAppId Uniquely identifies the device application
* @member appInfo
* @see ETSI GS MEC 016 Clause 6.2.4 Type: ApplicationLocationAvailability
*/
type record ApplicationLocationAvailability {
JSON.String associateDevAppId,
ApplicationLocationAvailability_AppInfo appInfo
}
/**
* @desc Notification from the UALCMP regarding a change in address of a user application instance
* @member notificationType Shall be set to "AddressChangeNotification"
* @member contextId Uniquely identifies the application context in the MEC system
* @member appInstanceId Identifier of the user application instance
* @member referenceURI Address of the user application. Used as the reference URI for the application
* @see ETSI GS MEC 016 Clause 6.4.2 Type: AddressChangeNotification
*/
type record AddressChangeNotification {
JSON.String notificationType,
JSON.String contextId,
JSON.String appInstanceId,
JSON.AnyURI referenceURI
}
/**
* @desc Notification from the UALCMP regarding the deletion of an application context by the MEC system
* @member notificationType Shall be set to "AddressChangeNotification"
* @member contextId Uniquely identifies the application context in the MEC system
* @see ETSI GS MEC 016 Clause 6.4.3 Type: ApplicationContextDeleteNotification
*/
type record ApplicationContextDeleteNotification {
JSON.String notificationType,
JSON.String contextId
}
/**
* @desc Notification from the UALCMP regarding an update to an application change by the MEC system
* @member notificationType Shall be set to "AddressChangeNotification"
* @member contextId Uniquely identifies the application context in the MEC system
* @member userAppInstanceInfo List of user application instance information
* @see ETSI GS MEC 016 Clause 6.4.4 Type: ApplicationContextDeleteNotification
*/
type record ApplicationContextUpdateNotification {
JSON.String notificationType,
JSON.String contextId,
UserAppInstanceInfoList userAppInstanceInfo
}
/**
* @desc Notification from the UALCMP regarding the availability of a location that was requested in the Application context create that could not be fulfilled at the time of the request
* @member notificationType Shall be set to "AddressChangeNotification"
* @member contextId Uniquely identifies the application context in the MEC system
* @member availableLocations Locations available to the MEC application
* @see ETSI GS MEC 016 Clause 6.4.5 Type: ApplicationLocationAvailabilityNotification
*/
type record ApplicationLocationAvailabilityNotification {
JSON.String notificationType,
JSON.String contextId,
AvailableLocationsList availableLocations
}
} with {
encode "JSON"
} // End of module DeviceApplicationInterface_TypesAndValues
......@@ -9,4 +9,18 @@ module V2XInformationServiceAPI_Pixits {
modulepar charstring PX_V2X_LATITUDE := "latitude,000.000,001.000,longitude,000.000,001.000";
modulepar charstring PX_LOC_GRANULARITY := "17";
modulepar charstring PX_CELL_ID := "4680";
modulepar charstring PX_UNKNOWN_CELL_ID := "4680";
modulepar charstring PX_MCC := "135";
modulepar charstring PX_MNC := "792";
modulepar charstring PX_UNKNOWN_MCC := "136";
modulepar charstring PX_UNKNOWN_MNC := "796";
} // End of module V2XInformationServiceAPI_Pixits
......@@ -37,17 +37,17 @@ module V2XInformationServiceAPI_Templates {
} // End of template mw_uu_unicast_provisioning_info
template (omit) UuMbmsProvisioningInfo m_uu_mbms_provisioning_info(
in template (value) ProInfoUuMbmsList p_proInfoUuMbms,
in template (omit) TimeStamp p_timeStamp := omit
) := {
in template (value) ProInfoUuMbmsList p_proInfoUuMbms,
in template (omit) TimeStamp p_timeStamp := omit
) := {
proInfoUuMbms := p_proInfoUuMbms,
timeStamp := p_timeStamp
} // End of template m_uu_mbms_provisioning_info
template (present) UuMbmsProvisioningInfo mw_uu_mbms_provisioning_info(
template (present) ProInfoUuMbmsList p_proInfoUuMbms := ?,
template TimeStamp p_timeStamp := *
) := {
template (present) ProInfoUuMbmsList p_proInfoUuMbms := ?,
template TimeStamp p_timeStamp := *
) := {
proInfoUuMbms := p_proInfoUuMbms,
timeStamp := p_timeStamp
} // End of template mw_uu_mbms_provisioning_info
......@@ -68,4 +68,128 @@ module V2XInformationServiceAPI_Templates {
timeStamp := p_timeStamp
} // End of template mw_pc5_provisioning_info
template (omit) PredictedQos m_predicted_qos(
in template (value) JSON.String p_locationGranularity,
in template (value) PredictedQosRoutesList p_routes,
in template (omit) TimeStamp p_timeGranularity := omit
) := {
timeGranularity := p_timeGranularity,
locationGranularity := p_locationGranularity,
routes := p_routes
} // End of template m_predicted_qos
template PredictedQos mw_predicted_qos(
template (present) JSON.String p_locationGranularity := ?,
template (present) PredictedQosRoutesList p_routes := ?,
template TimeStamp p_timeGranularity := *
) := {
timeGranularity := p_timeGranularity,
locationGranularity := p_locationGranularity,
routes := p_routes
} // End of template mw_predicted_qos
template (value) PredictedQosRoutes m_predicted_qos_routes(
in template (value) RouteInfoList p_routeinfo
) := {
routeinfo := p_routeinfo
} // End of template m_predicted_qos_routes
template (present) PredictedQosRoutes mw_predicted_qos_routes(
template (present) RouteInfoList p_routeinfo := ?
) := {
routeinfo := p_routeinfo
} // End of template mw_predicted_qos_routes
template (omit) RouteInfo m_route_info(
in template (value) LocationInfo p_location,
in template (omit) TimeStamp p_time := omit,
in template (omit) UInt8 p_rsrp := omit,
in template (omit) UInt8 p_rsrq := omit
) := {
location := p_location,
time := p_time,
rsrp := p_rsrp,
rsrq := p_rsrq
} // End of template m_route_info
template RouteInfo mw_route_info(
template (present) LocationInfo p_location := ?,
template TimeStamp p_time := *,
template UInt8 p_rsrp := *,
template UInt8 p_rsrq := *
) := {
location := p_location,
time := p_time,
rsrp := p_rsrp,
rsrq := p_rsrq
} // End of template mw_route_info
template (omit) LocationInfo m_location_info(
in template (value) Ecgi p_ecgi,
in template (omit) LocationInfoGeoArea p_geoArea := omit
) := {
ecgi := p_ecgi,
geoArea := p_geoArea
} // End of template m_location_info
template LocationInfo mw_location_info(
template (present) Ecgi p_ecgi := ?,
template LocationInfoGeoArea p_geoArea := *
) := {
ecgi := p_ecgi,
geoArea := p_geoArea
} // End of template mw_location_info
template (value) LocationInfoGeoArea m_location_info_geo_area(
in JSON.Number p_latitude,
in JSON.Number p_longitude
) := {
latitude := p_latitude,
longitude := p_longitude
} // End of m_location_info_geo_area
template (present) LocationInfoGeoArea mw_location_info_geo_area(
template (present) JSON.Number p_latitude := ?,
template (present) JSON.Number p_longitude := ?
) := {
latitude := p_latitude,
longitude := p_longitude
} // End of mw_location_info_geo_area
template (value) Ecgi m_ecgi(
in JSON.String p_cellId,
in template (value) Plmn p_plmn
) := {
cellId := {
cellId := p_cellId
},
plmn := p_plmn
} // End of template m_ecgi
template (present) Ecgi mw_ecgi(
template (present) JSON.String p_cellId := ?,
template (present) Plmn p_plmn := ?
) := {
cellId := {
cellId := p_cellId
},
plmn := p_plmn
} // End of template mw_ecgi
template (value) Plmn m_plmn(
in JSON.String p_mcc,
in JSON.String p_mnc
) := {
mcc := p_mcc,
mnc := p_mnc
} // End of template m_plmn
template (present) Plmn mw_plmn(
template (present) JSON.String p_mcc := ?,
template (present) JSON.String p_mnc := ?
) := {
mcc := p_mcc,
mnc := p_mnc
} // End of template mw_plmn
} // End of module V2XInformationServiceAPI_Templates
......@@ -30,8 +30,12 @@ module LibMec_Pixits {