Commit ebd44bfd authored by garciay's avatar garciay

Add external function fx_getDSecond()

parent a4441d41
......@@ -46,6 +46,15 @@ public interface IItsExternalFunctionsProvider {
*/
public IntegerValue fx_getMinuteOfTheYear();
/**
* This external function gets the milliseconds point in the current UTC minute
* @return The milliseconds point in the current UTC minute (0..60000)
*
* TTCN-3 signature:
* external function fx_getDSecond() return DSecond;
*/
public IntegerValue fx_getDSecond();
/**
* This external function gets the current time
* @param p_latitudeA Latitude of node A
......
......@@ -155,6 +155,17 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid
return now;
}
public IntegerValue fx_getDSecond() {
IntegerValue now = null;
//TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_getDSecond");
ZonedDateTime t = ZonedDateTime.now(ZoneOffset.UTC);
now = _tcicdWrapper.setInteger(new Integer(t.getSecond() + Math.round(t.getNano() / 1000)));
//TERFactory.getInstance().logDebug("ItsExternalFunctionsProvider", "fx_getDSecond", String.format("%4d", _tcicdWrapper.getBigInteger(now)));
return now;
}
/**
* This external function gets the current time
*
......@@ -993,6 +1004,6 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid
}
return result;
}
} // End of class ExternalFunctions
......@@ -287,6 +287,9 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT
} else if (functionId.getFunctionName().endsWith("fx_getMinuteOfTheYear")) {
// Gets the the minutes of current UTC year
exec_getMinuteOfTheYear(returnValue);
} else if (functionId.getFunctionName().endsWith("fx_getDSecond")) {
// Gets the milliseconds point in the current UTC minute
exec_getDSecond(returnValue);
} else if (functionId.getFunctionName().endsWith("xf_parseIpv6Address")) {
exec_parseIpv6Address(parameterList, returnValue);
} else if (functionId.getFunctionName().endsWith("fx_hashWithSha256") && (parameterList.size() == 1)) {
......@@ -736,6 +739,23 @@ public class PluginAdapter implements TriCommunicationSA, TriCommunicationTE, xT
//_logger.exiting("PluginAdapter", "exec_getMinuteOfTheYear: ", ByteHelper.byteArrayToString(returnValue.getEncodedParameter()));
} // End of method exec_getMinuteOfTheYear
private void exec_getDSecond(TriParameter returnValue) {
//_logger.entering("PluginAdapter", "exec_getDSecond");
// Execute the function
IntegerValue time = _extfuncsImpl.fx_getDSecond();
//_logger.info(String.format("exec_getDSecond returns %d", ((IntegerValueEx)time).getInt64()));
returnValue.setParameterPassingMode(TriParameterPassingMode.TRI_OUT);
returnValue.setNumberOfBits(Long.SIZE);
returnValue.setEncodedParameter(
ByteHelper.longToByteArray(
((IntegerValueEx)time).getInt64(),
2/*Short.SIZE / Byte.SIZE*/ // Encoding on 16 bits
));
//_logger.exiting("PluginAdapter", "exec_getDSecond: ", ByteHelper.byteArrayToString(returnValue.getEncodedParameter()));
} // End of method exec_getDSecond
private void exec_generateKeyPair(TriParameterList parameterList, TriParameter returnValue) {
_logger.entering("PluginAdapter", "exec_generateKeyPair");
......
# Debug level - Authorized values: OFF, ALL, INFO, SEVERE
DEBUG_ENABLED=OFF
# Define the port/layer configuration for CAM
camPort=BTP/GN/ETH
#camPort=BTP/GN/UdpIpCSG
#camPort=BTP/GN/CSG
#camPort=BTP/GN/UdpIpMarben
# Define the port/layer configuration for DENM
denmPort=BTP/GN/ETH
#denmPort=BTP/GN/UdpIpCSG
#denmPort=BTP/GN/CSG
#denmPort=BTP/GN/UdpIpMarben
# Define the port/layer configuration for MAPEM-SPATEM
mapemSpatemPort=BTP/GN/ETH
#mapemSpatemPort=BTP/GN/CSG
# Define the port/layer configuration for IVIM
ivimPort=BTP/GN/ETH
#ivimPort=BTP/GN/CSG
# Define the port/layer configuration for SREM-SSEM
sremSsemPort=BTP/GN/ETH
#sremSsemPort=BTP/GN/CSG
# Define the port/layer configuration for BTP
btpPort=GN/ETH
# Define the port/layer configuration for GeoNetworking
geoNetworkingPort=ETH
#geoNetworkingPort=ETH
#geoNetworkingPort=UdpIpCSG
#geoNetworkingPort=CSG
geoNetworkingPort=CSG
#geoNetworkingPort=UdpIpMarben
# Define the port/layer configuration for GeoNetworking over IPv6
ipv6OverGeoNetworkingPort=Debug
# Define the port/layer configuration for CALM FNTP
#fntpPort=FNTP/ETH
#fntpPort=FNTP/UdpIp
# Define the port/layer configuration for CALM FSAP
#fsapPort=FSAP/UdpIp
#fsapPort=FSAP/UdpIp
# Commsignia RSU and OBU Simulator
#UpperTesterSettings=10.200.1.101:12345
UpperTesterSettings=10.200.1.101:12345
# Commsignia Wireless OBU
#UpperTesterSettings=80.98.62.165:18502
# Savari/VPN
......@@ -44,59 +54,68 @@ ipv6OverGeoNetworkingPort=Debug
# Yogoko/VPN
#UpperTesterSettings=192.168.201.2:12345
# Home laptop
UpperTesterSettings=192.168.1.53:12345
#UpperTesterSettings=192.168.1.53:12345
# Marben Jupiter VM32G upper tester
#UpperTesterSettings=192.168.7.182:10005
# Nordsys upper tester
#UpperTesterSettings=172.23.0.1:1234
# RSU simulator
ConfigTesterSettings=10.200.1.102:12346
# Peer ITS station
#LinkLayer_Peer=001C6B0D0199
#LinkLayer_Peer=001C6B0D0099
# Define the MAC address of the Ethernet interface connected to the IUT device
# Home laptop VMWare MAC address
#LocalEthernetMAC=005056C00008
# Home laptop MAC address (Wireless)
LocalEthernetMAC=DC536045AF7E
#LocalEthernetMAC=DC536045AF7E
# Home laptop MAC address (Wired)
LocalEthernetMAC=F8CAB8083918
# Home laptop/VPN MAC address
#LocalEthernetMAC=00FF6BADBFC2
# ETSI computer MAC address
#LocalEthernetMAC=0022191B7FDB
# G5 bridge connected on USB3/Ethernet
#LocalEthernetMAC=00E08F008855
# Post-mortem ATS execution mode (G5 raw Ethernet only)
OfflineMode=false
#PcapFile=pcap/vendor/Livorno 20160914-2 DENM Full packet.pcap
PcapFile=F:/FSCOM/ETSI/ITS/STF517_ITS_Valid_Conform_Frmwk.2016/ITS-CMS5 PreQ/Savari/TC_SEC_ITSS_SND_MSG_01_01_BV.pcap
# Start at time in seconds since 1970-01-01, e.g. 1421661427.233361
OffsetTime=0
# Define the Ethernet type value used by the IUT
IutEthernetTypeValue=0x8947
# Node Ethernet addresses
LinkLayer_MTC=001C6B0D0100
LinkLayer_MTC=001C6B0D0000
# Link-Layer address of component NodeA
LinkLayer_NodeA=001C6B0D0101
LinkLayer_NodeA=001C6B0D0001
# Link-Layer address of component NodeB
LinkLayer_NodeB=001C6B0D0102
LinkLayer_NodeB=001C6B0D0002
# Link-Layer address of component NodeC
LinkLayer_NodeC=001C6B0D0103
LinkLayer_NodeC=001C6B0D0003
# Link-Layer address of component NodeD
LinkLayer_NodeD=001C6B0D0104
LinkLayer_NodeD=001C6B0D0004
# Link-Layer address of component NodeE
LinkLayer_NodeE=001C6B0D0105
LinkLayer_NodeE=001C6B0D0005
# Link-Layer address of component NodeF
LinkLayer_NodeF=001C6B0D0106
LinkLayer_NodeF=001C6B0D0006
# Link-Layer address of component NodeG
LinkLayer_NodeG=001C6B0D0107
LinkLayer_NodeG=001C6B0D0007
# Link-Layer address of component NodeH
LinkLayer_NodeH=001C6B0D0108
LinkLayer_NodeH=001C6B0D0008
# Link-Layer address of component NodeI
LinkLayer_NodeI=001C6B0D0109
LinkLayer_NodeI=001C6B0D0009
# Link-Layer address of component NodeJ
LinkLayer_NodeJ=001C6B0D010A
LinkLayer_NodeJ=001C6B0D000A
# Interval between each beacon sent by TS (ms)
TsBeaconInterval=1000
# Latitude of Test System
#Commsignia TsLatitude=435525450
#Yogoko TsLatitude=481210840
......@@ -120,4 +139,3 @@ TsSecuredRootPath=data/certificates
# Secured root path to access certificates and private keys
TsSecuredConfiId=
......@@ -158,6 +158,17 @@ public class ExternalFunctionsPluginProvider implements ExternalFunctionsProvide
return _externalFunctionsPluginProvider.fx_getMinuteOfTheYear();
}
/**
* This external function gets the milliseconds point in the current UTC minute
* @return The milliseconds point in the current UTC minute (0..60000)
*
* TTCN-3 signature:
* external function fx_getDSecond() return DSecond;
*/
public IntegerValue fx_getDSecond() {
return _externalFunctionsPluginProvider.fx_getDSecond();
}
/**
* External function to compute timestamp based on current time
* @return Unix-Epoch-Time mod 2^32
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment