Skip to content

Instantly share code, notes, and snippets.

@piotrjurkiewicz
Last active December 22, 2015 14:09
Show Gist options
  • Save piotrjurkiewicz/6483746 to your computer and use it in GitHub Desktop.
Save piotrjurkiewicz/6483746 to your computer and use it in GitHub Desktop.
--- ./src/wifi/model/sta-wifi-mac.cc
+++ ./src/wifi/model/sta-wifi-mac.cc
@@ -109,6 +109,16 @@
StaWifiMac::~StaWifiMac ()
{
NS_LOG_FUNCTION (this);
+}
+
+void
+StaWifiMac::SetAddress (Mac48Address address)
+{
+ NS_LOG_FUNCTION (this << address);
+ RegularWifiMac::SetAddress (address);
+ // We need to deassociate station after address change
+ // Station will associate again with the new address
+ SetState (BEACON_MISSED);
}
void
--- ./src/wifi/model/sta-wifi-mac.h
+++ ./src/wifi/model/sta-wifi-mac.h
@@ -57,6 +57,11 @@
* access is granted to this MAC.
*/
virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);
+
+ /**
+ * \param address the current address of this MAC layer.
+ */
+ virtual void SetAddress (Mac48Address address);
/**
* \param missed the number of beacons which must be missed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment