summaryrefslogtreecommitdiff
path: root/cesar/cp
diff options
context:
space:
mode:
authorlaranjeiro2009-03-17 10:34:22 +0000
committerlaranjeiro2009-03-17 10:34:22 +0000
commitac5ce009745f1ad1022b66f5f58a003510884817 (patch)
treebcf68fc357c2c62cf992fcbf0c295a1647fcb21a /cesar/cp
parentb9534cc890a385021c62bd1d28dd2c506167badc (diff)
cp/cco/action: Tested the handover with three stations. (Closes #161).
* Fix the FSM, on the discover_process_done event, if no station can become the CCo the FSM stays in the CCO state. * When the CCo sends the cc_handover_info.ind MME to the new CCo, it adds itself to the message. * The new CCo inserts its TEI to the compute TEI mechanism of the CCo module. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4234 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp')
-rw-r--r--cesar/cp/cco/action/src/handover.c10
-rw-r--r--cesar/cp/cco/action/test/utest/src/handover.c7
-rw-r--r--cesar/cp/fsm/src/fsm/cp.fsm3
-rw-r--r--cesar/cp/sta/action/src/handover.c1
4 files changed, 18 insertions, 3 deletions
diff --git a/cesar/cp/cco/action/src/handover.c b/cesar/cp/cco/action/src/handover.c
index 99a3359cad..ae16afb97e 100644
--- a/cesar/cp/cco/action/src/handover.c
+++ b/cesar/cp/cco/action/src/handover.c
@@ -109,13 +109,18 @@ cp_cco_action_handover__cc_handover_cnf_receive (cp_t *ctx, cp_mme_rx_t *mme)
net = cp_sta_mgr_get_our_avln (ctx);
/* All the AVLN stations without the new CCo STA. */
- nb_sta = cp_net_num_sta_associated (ctx, net);
+ nb_sta = cp_net_num_sta_associated (ctx, net) + 1;
mme_tx = cp_msg_cc_handover_info_ind_send_begin (ctx, &mme->peer,
ctx->cco_action.handover_reason,
MAC_TEI_UNASSOCIATED,
nb_sta);
+ cp_msg_cc_handover_info_ind_send (ctx, mme_tx,
+ cp_sta_own_data_get_tei (ctx),
+ cp_sta_own_data_get_mac_address (ctx),
+ true, false);
+
for (current_sta = cp_net_sta_get_first (ctx, net, CP_NET_STA_ASSOC);
current_sta;
current_sta = cp_net_sta_get_next (ctx, net, current_sta))
@@ -208,7 +213,10 @@ cp_cco_action_handover__discover_done (cp_t *ctx)
{
cp_cco_action_handover__cc_handover_req_prepare (ctx, sta);
slab_release (sta);
+ cp_fsm_branch (ctx, CCO, DISCOVER_PROCESS_DONE, sta);
}
+ else
+ cp_fsm_branch (ctx, CCO, DISCOVER_PROCESS_DONE, no_sta);
}
diff --git a/cesar/cp/cco/action/test/utest/src/handover.c b/cesar/cp/cco/action/test/utest/src/handover.c
index 3ec709de56..ec7aff1cf3 100644
--- a/cesar/cp/cco/action/test/utest/src/handover.c
+++ b/cesar/cp/cco/action/test/utest/src/handover.c
@@ -58,7 +58,12 @@ handover__handover_cc_handover_cnf_receive (test_t test)
.peer = CP_MME_PEER (3, 3),
.rsc = CP_MSG_CC_HANDOVER_REQ_REASON_CCO_SELECTION,
.bcco = MAC_TEI_UNASSOCIATED,
- .num_sta = 1),
+ .num_sta = 2),
+ SCENARIO_EVENT (cp_msg_cc_handover_info_ind_send,
+ .tei = 1,
+ .mac_addr = 1,
+ .status = 0x1,
+ .ptei = MAC_TEI_UNASSOCIATED),
SCENARIO_EVENT (cp_msg_cc_handover_info_ind_send,
.tei = 4,
.mac_addr = 4,
diff --git a/cesar/cp/fsm/src/fsm/cp.fsm b/cesar/cp/fsm/src/fsm/cp.fsm
index fc4145ff02..f4a6f225fc 100644
--- a/cesar/cp/fsm/src/fsm/cp.fsm
+++ b/cesar/cp/fsm/src/fsm/cp.fsm
@@ -414,7 +414,8 @@ CCO:
CC_ASSOC_REQ -> . [cp_cco_action__cco__cc_assoc_req]
CM_GET_KEY_REQ_PID0 -> . [cp_cco_action__cco__cm_get_key_req_pid0]
CC_LEAVE_REQ -> . [cp_cco_action__cco__cc_leave]
- DISCOVER_PROCESS_DONE -> CCO_HANDOVER_WAIT_CC_HANDOVER_CNF [cp_cco_action_handover__discover_done]
+ DISCOVER_PROCESS_DONE: sta -> CCO_HANDOVER_WAIT_CC_HANDOVER_CNF [cp_cco_action_handover__discover_done]
+ DISCOVER_PROCESS_DONE: no_sta -> .
DISCOVERED_STA -> . [cp_cco_action_cco_selection__sta_add]
SC_CCO:
diff --git a/cesar/cp/sta/action/src/handover.c b/cesar/cp/sta/action/src/handover.c
index 7356b13da5..10b67ce46c 100644
--- a/cesar/cp/sta/action/src/handover.c
+++ b/cesar/cp/sta/action/src/handover.c
@@ -127,6 +127,7 @@ cp_sta_action_handover__handover_info_ind_receive (cp_t *ctx,
if (res)
{
+ cp_cco_action_tei_in_use (ctx, cp_sta_own_data_get_tei (ctx));
/* Send the confirmation. */
cp_msg_cc_handover_info_rsp_send (ctx, &mme->peer);
}