summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschodet2008-07-28 13:10:28 +0000
committerschodet2008-07-28 13:10:28 +0000
commitcd5e703ffe18c0440ecd196949419d75d1672381 (patch)
treec4c2cc81d9f06a1c72ff286c0c5f73d23b640fcf
parent2390faa89e5a2e6fee32f5178dec9e752c431752 (diff)
* cp2/fsm, cp2/sta/action:
- separated functions for USTA and POWERON states. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@2674 017c9cb6-072f-447c-8318-d5b54f68fe89
-rw-r--r--cesar/cp2/fsm/src/fsm/cp.fsm16
-rw-r--r--cesar/cp2/sta/action/poweron.h47
-rw-r--r--cesar/cp2/sta/action/src/poweron.c23
-rw-r--r--cesar/cp2/sta/action/test/utest/inc/scenario_defs.h18
-rw-r--r--cesar/cp2/sta/action/test/utest/src/scenario_actions.c11
5 files changed, 87 insertions, 28 deletions
diff --git a/cesar/cp2/fsm/src/fsm/cp.fsm b/cesar/cp2/fsm/src/fsm/cp.fsm
index c74fddbfc0..9709487df6 100644
--- a/cesar/cp2/fsm/src/fsm/cp.fsm
+++ b/cesar/cp2/fsm/src/fsm/cp.fsm
@@ -130,28 +130,28 @@ STOPPING:
POWERON:
+ ustt_timeout -> . [cp_sta_action_poweron__poweron__ustt_timeout]
+ send CM_UNASSOCIATED_STA.IND if an AVLN is present
btt_timeout: nid match cco -> CCO [cp_sta_action_poweron__poweron__btt_timeout]
btt_timeout: avln -> USTA
btt_timeout: no avln -> UCCO
- BEACON: nid match -> POWERON_JOINING [cp_sta_action_poweron__poweron_usta__beacon]
+ BEACON: nid match -> POWERON_JOINING [cp_sta_action_poweron__poweron__beacon]
BEACON: no nid match -> .
USTA:
- BEACON: nid match -> USTA_JOINING [cp_sta_action_poweron__poweron_usta__beacon]
+ ustt_timeout -> . [cp_sta_action_poweron__usta__ustt_timeout]
+ send CM_UNASSOCIATED_STA.IND if an AVLN is present
+ BEACON: nid match -> USTA_JOINING [cp_sta_action_poweron__usta__beacon]
BEACON: no nid match -> .
net_list_empty -> UCCO [NULL]
usta_ind: nid match cco -> CCO [cp_sta_action_poweron__usta__usta_ind]
usta_ind: else -> .
-POWERON, USTA:
- ustt_timeout -> . [cp_sta_action_poweron__poweron_usta__ustt_timeout]
- send CM_UNASSOCIATED_STA.IND if an AVLN is present
-
POWERON_JOINING:
- unassociated -> POWERON [cp_sta_action_poweron__joining__unassociated]
+ unassociated -> POWERON [cp_sta_action_poweron__poweron_joining__unassociated]
USTA_JOINING:
- unassociated -> POWERON [cp_sta_action_poweron__joining__unassociated]
+ unassociated -> POWERON [cp_sta_action_poweron__usta_joining__unassociated]
POWERON_JOINING, USTA_JOINING:
associated -> STA [NULL]
diff --git a/cesar/cp2/sta/action/poweron.h b/cesar/cp2/sta/action/poweron.h
index 3105646878..39b9ec9cb2 100644
--- a/cesar/cp2/sta/action/poweron.h
+++ b/cesar/cp2/sta/action/poweron.h
@@ -45,7 +45,7 @@ void
cp_sta_action_poweron_start (cp_t *ctx);
/**
- * Handle POWERON, USTA => USTT TIMEOUT.
+ * Handle POWERON => USTT TIMEOUT.
* \param ctx control plane context
*
* If there is at least one AVLN in the discovered list, send a
@@ -53,7 +53,7 @@ cp_sta_action_poweron_start (cp_t *ctx);
* (in the right range).
*/
void
-cp_sta_action_poweron__poweron_usta__ustt_timeout (cp_t *ctx);
+cp_sta_action_poweron__poweron__ustt_timeout (cp_t *ctx);
/**
* Handle POWERON => BTT TIMEOUT.
@@ -70,7 +70,7 @@ void
cp_sta_action_poweron__poweron__btt_timeout (cp_t *ctx);
/**
- * Handle POWERON, USTA => BEACON.
+ * Handle POWERON => BEACON.
* \param ctx control plane context
* \param net STA net
* \param sta STA emitting the beacon
@@ -80,17 +80,41 @@ cp_sta_action_poweron__poweron__btt_timeout (cp_t *ctx);
* AVLN to track in the list of discovered AVLN and continue searching.
*/
void
-cp_sta_action_poweron__poweron_usta__beacon (cp_t *ctx, cp_net_t *net,
- cp_sta_t *sta);
+cp_sta_action_poweron__poweron__beacon (cp_t *ctx, cp_net_t *net,
+ cp_sta_t *sta);
/**
- * Handle POWERON_JOINING, USTA_JOINING => UNASSOCIATED.
+ * Handle POWERON_JOINING => UNASSOCIATED.
* \param ctx control plane context
*
* Select an AVLN to track and continue searching.
*/
void
-cp_sta_action_poweron__joining__unassociated (cp_t *ctx);
+cp_sta_action_poweron__poweron_joining__unassociated (cp_t *ctx);
+
+/**
+ * Handle USTA => USTT TIMEOUT.
+ * \param ctx control plane context
+ *
+ * If there is at least one AVLN in the discovered list, send a
+ * CM_UNASSOCIATED_STA.IND, then restart the USTT timer with a random value
+ * (in the right range).
+ */
+void
+cp_sta_action_poweron__usta__ustt_timeout (cp_t *ctx);
+
+/**
+ * Handle USTA => BEACON.
+ * \param ctx control plane context
+ * \param net STA net
+ * \param sta STA emitting the beacon
+ *
+ * When a beacon is received, if NID matches, go to corresponding JOINING
+ * states and start the association procedure. In the other case, select an
+ * AVLN to track in the list of discovered AVLN and continue searching.
+ */
+void
+cp_sta_action_poweron__usta__beacon (cp_t *ctx, cp_net_t *net, cp_sta_t *sta);
/**
* Handle USTA => USTA IND.
@@ -105,6 +129,15 @@ cp_sta_action_poweron__usta__usta_ind (cp_t *ctx, cp_net_t *net,
cp_sta_t *sta);
/**
+ * Handle USTA_JOINING => UNASSOCIATED.
+ * \param ctx control plane context
+ *
+ * Select an AVLN to track and continue searching.
+ */
+void
+cp_sta_action_poweron__usta_joining__unassociated (cp_t *ctx);
+
+/**
* Handle STA => BEACON.
* \param ctx control plane context
* \param net STA net
diff --git a/cesar/cp2/sta/action/src/poweron.c b/cesar/cp2/sta/action/src/poweron.c
index b02747efac..90b5d3d339 100644
--- a/cesar/cp2/sta/action/src/poweron.c
+++ b/cesar/cp2/sta/action/src/poweron.c
@@ -20,7 +20,7 @@ cp_sta_action_poweron_start (cp_t *ctx)
}
void
-cp_sta_action_poweron__poweron_usta__ustt_timeout (cp_t *ctx)
+cp_sta_action_poweron__poweron__ustt_timeout (cp_t *ctx)
{
}
@@ -30,13 +30,23 @@ cp_sta_action_poweron__poweron__btt_timeout (cp_t *ctx)
}
void
-cp_sta_action_poweron__poweron_usta__beacon (cp_t *ctx, cp_net_t *net,
- cp_sta_t *sta)
+cp_sta_action_poweron__poweron__beacon (cp_t *ctx, cp_net_t *net,
+ cp_sta_t *sta)
{
}
void
-cp_sta_action_poweron__joining__unassociated (cp_t *ctx)
+cp_sta_action_poweron__poweron_joining__unassociated (cp_t *ctx)
+{
+}
+
+void
+cp_sta_action_poweron__usta__ustt_timeout (cp_t *ctx)
+{
+}
+
+void
+cp_sta_action_poweron__usta__beacon (cp_t *ctx, cp_net_t *net, cp_sta_t *sta)
{
}
@@ -47,6 +57,11 @@ cp_sta_action_poweron__usta__usta_ind (cp_t *ctx, cp_net_t *net,
}
void
+cp_sta_action_poweron__usta_joining__unassociated (cp_t *ctx)
+{
+}
+
+void
cp_sta_action_poweron__sta__beacon (cp_t *ctx, cp_net_t *net, cp_sta_t *sta)
{
}
diff --git a/cesar/cp2/sta/action/test/utest/inc/scenario_defs.h b/cesar/cp2/sta/action/test/utest/inc/scenario_defs.h
index be2bd65612..4434111bf8 100644
--- a/cesar/cp2/sta/action/test/utest/inc/scenario_defs.h
+++ b/cesar/cp2/sta/action/test/utest/inc/scenario_defs.h
@@ -74,11 +74,14 @@
process_cm_mme_error_ind, \
\
poweron_start, \
- poweron__poweron_usta__ustt_timeout, \
+ poweron__poweron__ustt_timeout, \
poweron__poweron__btt_timeout, \
- poweron__poweron_usta__beacon, \
- poweron__joining__unassociated, \
+ poweron__poweron__beacon, \
+ poweron__poweron_joining__unassociated, \
+ poweron__usta__ustt_timeout, \
+ poweron__usta__beacon, \
poweron__usta__usta_ind, \
+ poweron__usta_joining__unassociated, \
poweron__sta__beacon, \
poweron__sta__beacon_not_received, \
poweron__cco__join_timeout, \
@@ -162,11 +165,14 @@ __m (process_cc_relay_ind)
__m (process_cm_mme_error_ind)
__0 (poweron_start)
-__0 (poweron__poweron_usta__ustt_timeout)
+__0 (poweron__poweron__ustt_timeout)
__0 (poweron__poweron__btt_timeout)
-__n (poweron__poweron_usta__beacon, cp_net_t *net, cp_sta_t *sta)
-__0 (poweron__joining__unassociated)
+__n (poweron__poweron__beacon, cp_net_t *net, cp_sta_t *sta)
+__0 (poweron__poweron_joining__unassociated)
+__0 (poweron__usta__ustt_timeout)
+__n (poweron__usta__beacon, cp_net_t *net, cp_sta_t *sta)
__n (poweron__usta__usta_ind, cp_net_t *net, cp_sta_t *sta)
+__0 (poweron__usta_joining__unassociated)
__n (poweron__sta__beacon, cp_net_t *net, cp_sta_t *sta)
__0 (poweron__sta__beacon_not_received)
__0 (poweron__cco__join_timeout)
diff --git a/cesar/cp2/sta/action/test/utest/src/scenario_actions.c b/cesar/cp2/sta/action/test/utest/src/scenario_actions.c
index cf0c5588f0..7fc3c5554f 100644
--- a/cesar/cp2/sta/action/test/utest/src/scenario_actions.c
+++ b/cesar/cp2/sta/action/test/utest/src/scenario_actions.c
@@ -98,15 +98,20 @@ __m (process_cc_relay_ind)
__m (process_cm_mme_error_ind)
__0 (poweron_start)
-__0 (poweron__poweron_usta__ustt_timeout)
+__0 (poweron__poweron__ustt_timeout)
__0 (poweron__poweron__btt_timeout)
-__n (poweron__poweron_usta__beacon,
+__n (poweron__poweron__beacon,
+ (cp_net_t *, net),
+ (cp_sta_t *, sta))
+__0 (poweron__poweron_joining__unassociated)
+__0 (poweron__usta__ustt_timeout)
+__n (poweron__usta__beacon,
(cp_net_t *, net),
(cp_sta_t *, sta))
-__0 (poweron__joining__unassociated)
__n (poweron__usta__usta_ind,
(cp_net_t *, net),
(cp_sta_t *, sta))
+__0 (poweron__usta_joining__unassociated)
__n (poweron__sta__beacon,
(cp_net_t *, net),
(cp_sta_t *, sta))