Commit 5fadbdfe authored by garciay's avatar garciay
Browse files

Changes after test session in Livorno (20160613-14)

parent 7ab73a70
......@@ -253,7 +253,7 @@ public class PcapMultiplexer implements Runnable {
return null;
}
public void resetFilter(String pcapFilter) {
public void resetFilter(String pcapFilter) {
// Sanity check
if ((pcapFilter == null) || pcapFilter.isEmpty()) {
return;
......@@ -270,7 +270,10 @@ public class PcapMultiplexer implements Runnable {
if (r != Pcap.OK) {
TERFactory.getInstance().logError("Filter error: " + pcap.getErr());
}
pcap.setFilter(bpfFilter);
r = pcap. setFilter(bpfFilter);
if (r != Pcap.OK) {
TERFactory.getInstance().logError("Filter error: " + pcap.getErr());
}
}
/**
......
......@@ -27,10 +27,11 @@ import com.commsignia.v2x.client.model.dev.FacilityModule;
public class CommsigniaLayer extends Layer implements IEthernetSpecific {
private static final byte[] DeviceMacAddress = new byte[] { (byte)0x70, (byte)0xb3, (byte)0xd5, (byte)0xf2, (byte)0xa1, (byte)0xe3 };
private static final String TargetHost = "172.17.15.38";
private static final String TargetHost = "10.200.1.101";
private static final int TargetPort = 7942;
private static final int SourcePort = 7943;
private static final int ItsAid = 5;
private static final int InterfaceID = 2;
private static final int TxPowerDbm = -10; // Max value: -33dBm, RSU: -30dBm, Lab: -10dBm
private static String pcapFilter = null;
......@@ -65,18 +66,6 @@ public class CommsigniaLayer extends Layer implements IEthernetSpecific {
System.out.println(deviceInfoResponse);
itsApplication.setFacilityModuleStatus(FacilityModule.BSM, false);
itsApplication.setFacilityModuleStatus(FacilityModule.CAM, false);
// itsApplication.addEventListener(new ITSEventAdapter() {
// @Override
// public void onGnNotification(GNNotification notification) {
// ByteBuffer buffer = ByteBuffer.wrap(notification.getData());
//
// System.out.printf("GN GBC receive. GN address: %s Sequence number: %d RSSI: %d dBm\n",
// notification.getGNAddress(),
// buffer.getInt(),
// notification.getRssi()
// );
// }
// });
itsApplication. gnBindBlocking(BTPType.NONE, 65535);
} catch (TimeoutException e) {
e.printStackTrace();
......@@ -129,7 +118,7 @@ public class CommsigniaLayer extends Layer implements IEthernetSpecific {
for(int i=1; i < localMacAddress.length; i++) {
strMacAddress += String.format(":%02x", localMacAddress[i]);
}
//udp dst port 74 && wlan src 8b:ad:f0:0d:01:02
//udp dst port 7493 && wlan src 8b:ad:f0:0d:01:02
pcapFilter = pcapFilter + "not wlan src " + strMacAddress;
// Reset filter
PcapMultiplexer.getInstance().resetFilter(pcapFilter);
......@@ -146,6 +135,10 @@ public class CommsigniaLayer extends Layer implements IEthernetSpecific {
public void receive(byte[] message, Map<String, Object> lowerInfo) {
TERFactory.getInstance().logDebug(">>> CommsigniaLayer.receive: " + ByteHelper.byteArrayToString(message));
if (message.length <= 20+8+29+26) { // TODO To be refine
// Skip it
return;
}
ByteBuffer byteBuffer = ByteBuffer.wrap(message);
// Skip C2P protocol
......@@ -168,7 +161,7 @@ public class CommsigniaLayer extends Layer implements IEthernetSpecific {
byteBuffer.position(byteBuffer.position() + 10);
// Skip LLC header
byteBuffer.position(byteBuffer.position() + 6);
byteBuffer.position(byteBuffer.position() + 8);
// Extract FrameType info
byte[] rawFrameType = new byte[2];
......@@ -231,7 +224,7 @@ public class CommsigniaLayer extends Layer implements IEthernetSpecific {
.withDstAddress(dstAddress)
.withSrcAddress(srcAddress)
.withType(Type.GNP)
.withInterfaceID(2)
.withInterfaceID(InterfaceID)
.withTxPowerDbm(TxPowerDbm)
.withData(message);
InjectData injectData = build.build();
......
......@@ -30,8 +30,8 @@ ipv6OverGeoNetworkingPort=Debug
#fsapPort=FSAP/UdpIp
#UpperTesterSettings=192.168.42.1:12345
UpperTesterSettings=172.17.15.38:12345
ConfigTesterSettings=172.17.15.39:12346
UpperTesterSettings=10.200.1.102:12345
ConfigTesterSettings=10.200.1.102:12346
# Peer ITS station
#LinkLayer_Peer=8BADF00D0199
......
Supports Markdown
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