Commit 75913aa9 authored by garciay's avatar garciay
Browse files

Bug fixed on AcStartPassBeaconing

parent a5fd7160
...@@ -106,7 +106,7 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl ...@@ -106,7 +106,7 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl
Management.getInstance(getComponentName()).stopBeaconing(); Management.getInstance(getComponentName()).stopBeaconing();
break; break;
case AcStartPassBeaconing: case AcStartPassBeaconing:
ProcessAcStartPassBeaconing(data); Management.getInstance(getComponentName()).startEnqueueingBeacons(data);
break; break;
case AcStopPassBeaconing: case AcStopPassBeaconing:
Management.getInstance(getComponentName()).stopEnqueueingBeacons(); Management.getInstance(getComponentName()).stopEnqueueingBeacons();
...@@ -231,15 +231,6 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl ...@@ -231,15 +231,6 @@ public class AdapterControlPort extends AdapterPort implements IPort, IObservabl
}).start(); }).start();
} }
private void ProcessAcStartPassBeaconing(final byte[] beacon) {
byte[] response = {(byte)AcGnResponse, (byte)AcGnResponseFailure, (byte)AcFalse};
Management.getInstance(getComponentName()).startEnqueueingBeacons(beacon);
setChanged();
notifyObservers(new PortEvent(response, getPortName(), getComponentName()));
}
private void LoadScenario(final int scenario) { private void LoadScenario(final int scenario) {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
......
...@@ -98,9 +98,8 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific ...@@ -98,9 +98,8 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
byte[] tst = ByteHelper.intToByteArray((int)(((currentTime - 1072915200000L) % modulo) - 3000), 4); byte[] tst = ByteHelper.intToByteArray((int)(((currentTime - 1072915200000L) % modulo) - 3000), 4);
System.arraycopy(tst, 0, beaconHeader, 20, 4); System.arraycopy(tst, 0, beaconHeader, 20, 4);
/* TODO Uncomment to get secured beacon*/if (!management.isSecuredModeSet()) { // Secure mode disabled if (!management.isSecuredModeSet()) { // Secure mode disabled
send(beaconHeader, params); send(beaconHeader, params);
/* TODO Uncomment to get secured beacon*/
} else { // Send a secured beacon } else { // Send a secured beacon
byte[] securedBeaconHeader = buildSecuredBeacon(beaconHeader, tst, currentTime, false); byte[] securedBeaconHeader = buildSecuredBeacon(beaconHeader, tst, currentTime, false);
// triggerTime = currentTime; // triggerTime = currentTime;
...@@ -108,7 +107,6 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific ...@@ -108,7 +107,6 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific
//TERFactory.getInstance().logDebug("GnPort: Call send " + ByteHelper.byteArrayToString(securedBeaconHeader)); //TERFactory.getInstance().logDebug("GnPort: Call send " + ByteHelper.byteArrayToString(securedBeaconHeader));
send(securedBeaconHeader, params); send(securedBeaconHeader, params);
} }
/* TODO Uncomment to get secured beacon*/
try { try {
Thread.sleep(management.getGnBeaconInterval()); Thread.sleep(management.getGnBeaconInterval());
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -194,7 +192,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific ...@@ -194,7 +192,7 @@ public class GnPort extends ProtocolPort implements Runnable, IEthernetSpecific
management.getLongitude(), // Longitude management.getLongitude(), // Longitude
new byte[] { (byte)0x00, (byte)0x00 }, // Elevation new byte[] { (byte)0x00, (byte)0x00 }, // Elevation
new byte[] { new byte[] {
(byte)0x05 // Its-aid (byte)0x05 // Its-aid
}, },
b b
); );
......
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