summaryrefslogtreecommitdiff
path: root/cesar/bsu/src
diff options
context:
space:
mode:
authorYacine Belkadi2013-04-02 17:38:42 +0200
committerYacine Belkadi2013-05-22 10:53:37 +0200
commit46b9d84d9dfca1a27cea6f3b85af148cd72a2434 (patch)
treeed6cf26bf8bbb5a634b6ce758d7fad484160d271 /cesar/bsu/src
parent21ef1bf39c7cbbeff2c333e74b24c8ad426006e3 (diff)
cesar/{bsu,cp}/beacon: make bsu send a fake beacon to cp when no beacon is received
On a Sta, when an expected beacon is not received, make the bsu send a fake beacon to the cp. This allows the bsu to communicate with the cp when no beacon is received, and will be used in following commits.
Diffstat (limited to 'cesar/bsu/src')
-rw-r--r--cesar/bsu/src/bsu.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/cesar/bsu/src/bsu.c b/cesar/bsu/src/bsu.c
index 72557a80db..68e4c9d206 100644
--- a/cesar/bsu/src/bsu.c
+++ b/cesar/bsu/src/bsu.c
@@ -788,6 +788,21 @@ bsu_beacon_send_prepare (bsu_t *ctx, bsu_beacon_type_t type,
}
/**
+ * Inform upper layers (cp, in particular) that an expected beacon was not
+ * received, and use a fake beacon to pass any needed information.
+ * \param ctx bsu context.
+ */
+static void
+bsu_beacon_inform_beacon_not_received (bsu_t *ctx)
+{
+ /* Send a fake beacon to the cp. */
+ bsu_beacon_t *fake_beacon = blk_alloc ();
+ dbg_assert (fake_beacon);
+ bsu_beacon_send_upper_layer (ctx, fake_beacon,
+ BSU_BEACON_DIRECTION_FROM_BSU);
+}
+
+/**
* Handle the timer as STA.
* \param ctx the module context.
*/
@@ -838,6 +853,8 @@ bsu_timer_event_process__sta (bsu_t *ctx)
{
bsu_avln_schedules_decrease_countdown (ctx, ctx->sta_avln);
ctx->sta_avln->beacon.beacon_period_start_date = bpsd0;
+
+ bsu_beacon_inform_beacon_not_received (ctx);
}
}
}