Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 854 → Rev 855

/trunk/javasrc/uppertester/org/etsi/its/uppertester/IDenmUpperTester.java
1,7 → 1,5
package org.etsi.its.uppertester;
 
import org.etsi.its.codec.TestAdapterMessageTypeEnum;
 
/**
* This interface provides methods to support DENM upper tester
*/
40,12 → 38,10
 
/**
* Creates a new Denm event in SUT
* @param denmEvent Denm event to be generated
* @param type Event type to be generated
* @param event Event value
* @return True if operation is successful, false otherwise
* TODO
*/
public boolean generateDenmEvent(DenmEvent denmEvent, TestAdapterMessageTypeEnum type, int event);
public boolean generateDenmEvent(DenmEvent denmEvent, int severity, int reliability);
 
/**
* Creates a new Denm event in SUT
/trunk/javasrc/uppertester/org/etsi/its/uppertester/generic/CamUpperTester.java
130,9 → 130,7
byte[] response = _utSendPort.receive();
if (
(response[0] == TestAdapterMessageTypeEnum.UtResult.convert()) &&
(response[1] == 0x00) &&
(response[2] == 0x01) &&
(response[3] == 0x01)) {
(response[1] == 0x01)) {
return true;
} // else, return false
} catch (IOException e) {
/trunk/javasrc/uppertester/org/etsi/its/uppertester/generic/DenmUpperTester.java
69,9 → 69,7
byte[] response = _utSendPort.receive();
if (
(response[0] == TestAdapterMessageTypeEnum.UtResult.convert()) &&
(response[1] == 0x00) &&
(response[2] == 0x01) &&
(response[3] == 0x01)) {
(response[1] == 0x01)) {
return true;
} // else, return false
} catch (IOException e) {
213,8 → 211,36
}
 
@Override
public boolean generateDenmEvent(DenmEvent denmEvent, TestAdapterMessageTypeEnum type, int event) {
throw new RuntimeException("Not implemented");
public boolean generateDenmEvent(DenmEvent denmEvent, int severity, int reliability) {
_logger.entering("DenmUpperTester", "generateDenmEvent", String.format("%d - %d ", denmEvent.cause, denmEvent.subCause));
try {
byte[] buffer = new byte[] { (byte)denmEvent.cause };
buffer = ByteHelper.concat(buffer, new byte[] { (byte)denmEvent.subCause });
// Fixed all values with default 0x00
// Traffic flow effect
buffer = ByteHelper.concat(buffer, new byte[] { (byte)0x00 });
// Repetition frequency
buffer = ByteHelper.concat(buffer, new byte[] { (byte)0x00 });
// Severity of the event
buffer = ByteHelper.concat(buffer, ByteHelper.intToByteArray(severity, 1));
// Timestamp indicating event expiration
buffer = ByteHelper.concat(buffer, ByteHelper.longToByteArray((long)(new Date().getTime() + _defaultExpiryTime), 6));
// M|CT|Rel|T
buffer = ByteHelper.concat(buffer, ByteHelper.intToByteArray( (reliability << 1 ) & 0x0F, 1));
// Linked Cause
buffer = ByteHelper.concat(buffer, new byte[] { (byte)0x00 });
// Linked SubCause
buffer = ByteHelper.concat(buffer, new byte[] { (byte)0x00 });
buffer = ByteHelper.concat(new byte[] { TestAdapterMessageTypeEnum.UtDenmEvent.convert() }, buffer);
_utSendPort.send(buffer);
 
return true;
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
 
@Override
/trunk/javasrc/uppertester/org/etsi/its/uppertester/generic/NwtUpperTester.java
80,9 → 80,7
byte[] response = _utSendPort.receive();
if (
(response[0] == TestAdapterMessageTypeEnum.UtResult.convert()) &&
(response[1] == 0x00) &&
(response[2] == 0x01) &&
(response[3] == 0x01)) {
(response[1] == 0x01)) {
return true;
} // else, return false
} catch (IOException e) {
/trunk/javasrc/uppertester/org/etsi/its/uppertester/operator/ItsUpperTester.java
1,7 → 1,6
package org.etsi.its.uppertester.operator;
 
import org.etsi.common.ByteHelper;
import org.etsi.its.codec.TestAdapterMessageTypeEnum;
import org.etsi.its.uppertester.IBtpUpperTester;
import org.etsi.its.uppertester.ICamUpperTester;
import org.etsi.its.uppertester.IDenmUpperTester;
201,12 → 200,14
}
 
@Override
public boolean generateDenmEvent(DenmEvent denmEvent, TestAdapterMessageTypeEnum type, int event) {
public boolean generateDenmEvent(DenmEvent denmEvent, int severity,
int reliability) {
OperatorGUI gui = new OperatorGUI();
boolean res = gui.pop("<html>Please generate DENM event:<br/>"
+ "cause => " + denmEvent.cause + "<br/>"
+ "subcause => " + denmEvent.subCause + "<br/>"
+ type.name() + " => " + event + "<br/>"
+ "severity => " + severity + "<br/>"
+ "reliability => " + reliability + "<br/>"
+ "</html>"
);
gui.dispose();
/trunk/javasrc/uppertester/org/etsi/its/uppertester/yes/ItsUpperTester.java
1,6 → 1,5
package org.etsi.its.uppertester.yes;
 
import org.etsi.its.codec.TestAdapterMessageTypeEnum;
import org.etsi.its.uppertester.IBtpUpperTester;
import org.etsi.its.uppertester.ICamUpperTester;
import org.etsi.its.uppertester.IDenmUpperTester;
119,7 → 118,8
}
 
@Override
public boolean generateDenmEvent(DenmEvent denmEvent, TestAdapterMessageTypeEnum type, int eventSeverity) {
public boolean generateDenmEvent(DenmEvent denmEvent, int severity,
int reliability) {
return true;
}