summaryrefslogtreecommitdiff
path: root/cesar/cp/eoc/sta/action
diff options
context:
space:
mode:
authorYacine Belkadi2012-12-14 14:38:30 +0100
committerYacine Belkadi2012-12-20 12:48:30 +0100
commit75365aba8acf8e725a99a66704c869ff287b646c (patch)
treec3d52a71c2dc752fef1d4e583d3debff40a4209a /cesar/cp/eoc/sta/action
parentb30d837193a809d744d634f372b99662c70718cd (diff)
cp/eoc/sta/action[eoc]: fix status in DRV_STA_GET_STATUS_IND, closes #3571
cp_eoc_sta_action_drv__drv_sta_get_status_ind() puts the current status in the MME it sends. The problem was the call happened before the current status got updated by cp_sta_own_data_set_authenticated_status() and cp_sta_own_data_set_tei(). This resulted in the following bug: - One master, one authenticated slave. - The master is switched off. - On the slave, the attachment LED stays on. The reason was that the DRV_STA_GET_STATUS_IND received by Cleopatre (which manages the LED) incorrectly contained STATUS=2 (Authenticated) instead of 0 (Unassociated). Call cp_eoc_sta_action_drv__drv_sta_get_status_ind() _after_ updating the current status.
Diffstat (limited to 'cesar/cp/eoc/sta/action')
-rw-r--r--cesar/cp/eoc/sta/action/src/assoc_slave.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cesar/cp/eoc/sta/action/src/assoc_slave.c b/cesar/cp/eoc/sta/action/src/assoc_slave.c
index 9e6bff8dad..74711cb7ba 100644
--- a/cesar/cp/eoc/sta/action/src/assoc_slave.c
+++ b/cesar/cp/eoc/sta/action/src/assoc_slave.c
@@ -50,6 +50,7 @@ cp_eoc_sta_action_sta_clear_status (cp_t *ctx)
ctx->sta_action.assoc.beacon_loss = 0;
ctx->sta_action.assoc.init_count = CP_EOC_STA_ASSOC_REQ_OFFSET;
cp_sta_own_data_t *own_data = cp_sta_mgr_get_sta_own_data (ctx);
+ bool send_mme = false;
/* If sta has been associated set UNASSOCIATED state and remove master. */
if (MAC_TEI_IS_EOC_STA (cp_sta_own_data_get_tei (ctx)))
@@ -59,7 +60,7 @@ cp_eoc_sta_action_sta_clear_status (cp_t *ctx)
sta = cp_sta_mgr_sta_get_assoc (ctx, net, own_data->tei_track);
if (sta)
{
- cp_eoc_sta_action_drv__drv_sta_get_status_ind(ctx);
+ send_mme = true;
cp_sta_set_authenticated (ctx, sta, false);
cp_sta_mgr_sta_remove (ctx, sta);
@@ -68,6 +69,8 @@ cp_eoc_sta_action_sta_clear_status (cp_t *ctx)
}
cp_sta_own_data_set_authenticated_status (ctx, false);
cp_sta_own_data_set_tei (ctx, MAC_TEI_UNASSOCIATED);
+ if (send_mme)
+ cp_eoc_sta_action_drv__drv_sta_get_status_ind (ctx);
cp_beacon_process_untracked_avln (ctx);
cp_eoc_cco_bw_sta_allocations (ctx);
}