Compare Revisions

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

Ignore whitespace Rev 842 → Rev 843

/trunk/javasrc/uppertester/org/etsi/its/uppertester/generic/NwtUpperTester.java
1,4 → 1,4
package org.etsi.its.uppertester.itri;
package org.etsi.its.uppertester.generic;
 
import java.io.IOException;
import java.net.SocketException;
9,7 → 9,6
 
import org.etsi.common.ByteHelper;
import org.etsi.its.codec.TestAdapterMessageTypeEnum;
import org.etsi.its.codec.adapter.UpperTesterCodecImpl;
import org.etsi.its.network.UdpImpl;
import org.etsi.its.uppertester.IBtpUpperTester;
import org.etsi.its.uppertester.IGnUpperTester;
36,11 → 35,6
*/
private Pattern _pattern;
/**
* Reference to the TA codec
*/
private UpperTesterCodecImpl _codec;
private UdpImpl _utSendPort;
/**
49,7 → 43,6
public NwtUpperTester() {
_logger.entering("NwtUpperTester", "Constructor", String.format("version: %s", Version));
_pattern = Pattern.compile("(\\w+)\\:(\\S+)\\:(\\d+)\\:(\\d+)"); // For Java regex test, see http://www.cis.upenn.edu/~matuszek/General/RegexTester/regex-tester.html
_codec = new UpperTesterCodecImpl();
_utSendPort = null;
}
59,7 → 52,7
try {
byte[] buffer = ByteHelper.intToByteArray(0, 4);
buffer = _codec.Encode(TestAdapterMessageTypeEnum.changePosition, buffer, 0);
buffer = ByteHelper.concat(new byte[] { TestAdapterMessageTypeEnum.changePosition.convert() }, buffer);
_utSendPort.send(buffer);
 
return true;
113,7 → 106,7
ByteHelper.intToByteArray(angle, 2),
ByteHelper.intToByteArray(payload.length, 2));
if (payload.length != 0) buffer = ByteHelper.concat(buffer, payload);
buffer = _codec.Encode(TestAdapterMessageTypeEnum.GenerateGeoAnycastMessage, buffer, 0);
buffer = ByteHelper.concat(new byte[] { TestAdapterMessageTypeEnum.GenerateGeoAnycastMessage.convert() }, buffer);
_utSendPort.send(buffer);
 
return true;
139,7 → 132,7
ByteHelper.intToByteArray(angle, 2),
ByteHelper.intToByteArray(payload.length, 2));
if (payload.length != 0) buffer = ByteHelper.concat(buffer, payload);
buffer = _codec.Encode(TestAdapterMessageTypeEnum.GenerateGeoBroadcastMessage, buffer, 0);
buffer = ByteHelper.concat(new byte[] { TestAdapterMessageTypeEnum.GenerateGeoBroadcastMessage.convert() }, buffer);
_utSendPort.send(buffer);
 
return true;
160,7 → 153,7
ByteHelper.intToByteArray(lifetime, 2),
ByteHelper.intToByteArray(payload.length, 2));
if (payload.length != 0) buffer = ByteHelper.concat(buffer, payload);
buffer = _codec.Encode(TestAdapterMessageTypeEnum.GenerateGeoUnicastMessage, buffer, 0);
buffer = ByteHelper.concat(new byte[] { TestAdapterMessageTypeEnum.GenerateGeoUnicastMessage.convert() }, buffer);
_utSendPort.send(buffer);
 
return true;
179,7 → 172,7
byte[] buffer = ByteHelper.concat(
ByteHelper.intToByteArray(payload.length, 2));
if (payload.length != 0) buffer = ByteHelper.concat(buffer, payload);
buffer = _codec.Encode(TestAdapterMessageTypeEnum.GenerateSHBMessage, buffer, 0);
buffer = ByteHelper.concat(new byte[] { TestAdapterMessageTypeEnum.GenerateSHBMessage.convert() }, buffer);
_utSendPort.send(buffer);
 
return true;
199,7 → 192,7
new byte[] { (byte)nbHops },
ByteHelper.intToByteArray(payload.length, 2));
if (payload.length != 0) buffer = ByteHelper.concat(buffer, payload);
buffer = _codec.Encode(TestAdapterMessageTypeEnum.GenerateTSBMessage, buffer, 0);
buffer = ByteHelper.concat(new byte[] { TestAdapterMessageTypeEnum.GenerateTSBMessage.convert() }, buffer);
_utSendPort.send(buffer);
 
return true;