summaryrefslogtreecommitdiff
path: root/cesar/cp/eoc/sta/action
diff options
context:
space:
mode:
authorNélio Laranjeiro2012-09-14 10:52:49 +0200
committerNélio Laranjeiro2012-10-19 14:25:41 +0200
commitd0a4397aba66a2101fdf210cba26f68e94774df7 (patch)
treeac6f6dfbe02fe2f362458a447afb80b64fdd7be0 /cesar/cp/eoc/sta/action
parent6727826e8798942ee72715d01a2b6be20ad6f421 (diff)
cesar/cp/eoc/sta/action: some clean, refs #3358
* Modify the Module file to inform with comments which sources are common and those which are slave specific * Remove a useless header file * Make PRIVATE the function cp_eoc_sta_action__power_on_no_beacons and add -DNO_PRIVATE to makefiles in test to declare this function. * Remove useless instantiation of the TEI in cp_eoc_sta_action__power_on_no_beacons for the sta_own_data init.
Diffstat (limited to 'cesar/cp/eoc/sta/action')
-rw-r--r--cesar/cp/eoc/sta/action/Module5
-rw-r--r--cesar/cp/eoc/sta/action/action.h1
-rw-r--r--cesar/cp/eoc/sta/action/poweron.h36
-rw-r--r--cesar/cp/eoc/sta/action/src/assoc.c4
-rw-r--r--cesar/cp/eoc/sta/action/src/poweron.c14
-rw-r--r--cesar/cp/eoc/sta/action/test/utest/actions-Makefile2
-rw-r--r--cesar/cp/eoc/sta/action/test/utest/fsm-Makefile2
-rw-r--r--cesar/cp/eoc/sta/action/test/utest/src/fsm_stub.c1
-rw-r--r--cesar/cp/eoc/sta/action/test/utest/src/test_actions.c3
9 files changed, 18 insertions, 50 deletions
diff --git a/cesar/cp/eoc/sta/action/Module b/cesar/cp/eoc/sta/action/Module
index e470bdd0e0..a3c17077dc 100644
--- a/cesar/cp/eoc/sta/action/Module
+++ b/cesar/cp/eoc/sta/action/Module
@@ -1,7 +1,8 @@
+# Common sources
SOURCES := action.c poweron.c drv.c vs.c assoc.c
-
+# Slave Sources
ifeq ($(CONFIG_CP_EOC_IS_MASTER),n)
- SOURCES += assoc_slave.c
+ SOURCES += assoc_slave.c
endif
MODULES := cp/sta/action
diff --git a/cesar/cp/eoc/sta/action/action.h b/cesar/cp/eoc/sta/action/action.h
index 192602ccaf..168bed77a1 100644
--- a/cesar/cp/eoc/sta/action/action.h
+++ b/cesar/cp/eoc/sta/action/action.h
@@ -17,7 +17,6 @@
#include "cp/eoc/sta/action/assoc.h"
#include "cp/eoc/sta/action/assoc_slave.h"
-#include "cp/eoc/sta/action/poweron.h"
#include "cp/eoc/sta/action/drv.h"
#include "cp/eoc/sta/action/vs.h"
diff --git a/cesar/cp/eoc/sta/action/poweron.h b/cesar/cp/eoc/sta/action/poweron.h
deleted file mode 100644
index 45e4d79a2f..0000000000
--- a/cesar/cp/eoc/sta/action/poweron.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef cp_eoc_sta_action_poweron_h
-#define cp_eoc_sta_action_poweron_h
-/* Cesar project {{{
- *
- * Copyright (C) 2009 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file cp/eoc/sta/action/poweron.h
- * \brief CCo Public functions.
- * \ingroup cp_eoc_sta_action
- *
- */
-
-#include "cp/sta/action/poweron.h"
-
-BEGIN_DECLS
-
-/* Declared in VARIANT :
- * - cp_sta_action_poweron__many__to_idle
- * - cp_sta_action_poweron__idle__to_poweron
- */
-
-/**
- * Poweron function. Basic initialization.
- * \param ctx control plane context
- *
- */
-void
-cp_eoc_sta_action__power_on_no_beacons (cp_t *ctx);
-
-END_DECLS
-
-#endif /* cp_eoc_sta_action_poweron_h */
diff --git a/cesar/cp/eoc/sta/action/src/assoc.c b/cesar/cp/eoc/sta/action/src/assoc.c
index 01ff75cfc3..76aff37d74 100644
--- a/cesar/cp/eoc/sta/action/src/assoc.c
+++ b/cesar/cp/eoc/sta/action/src/assoc.c
@@ -28,15 +28,15 @@ cp_eoc_sta_action_assoc_init (cp_t *ctx)
ctx->sta_action.assoc.assoc_req_retry_nb = 0;
}
+#if !CONFIG_CP_EOC_IS_MASTER
void
cp_eoc_sta_action_assoc__start_retry_timer (cp_t *ctx)
{
/* only Slave compilation */
-#if !CONFIG_CP_EOC_IS_MASTER
dbg_assert (ctx);
cp_fsm_event_t *event = cp_fsm_event_bare_new (
ctx, CP_FSM_EVENT_TYPE_timeout_associating);
cp_sta_core_gen_timed_event (ctx, &ctx->sta_action.assoc.timer, event,
RETRY_TIMEOUT_MS);
-#endif
}
+#endif
diff --git a/cesar/cp/eoc/sta/action/src/poweron.c b/cesar/cp/eoc/sta/action/src/poweron.c
index 016dbdd281..3a8926927d 100644
--- a/cesar/cp/eoc/sta/action/src/poweron.c
+++ b/cesar/cp/eoc/sta/action/src/poweron.c
@@ -17,25 +17,25 @@
/* Public headers. */
#include "cp/defs.h"
-#include "cp/eoc/sta/action/poweron.h"
#include "cp/eoc/cco/bw/bw.h"
#include "cp/sta/action/action.h"
#include "cp/sta/mgr/sta_mgr.h"
#include "cp/beacon/beacon.h"
-/* Initial settings for station */
-void
+/*
+ * Initial settings for all Master and slave
+ * \param ctx the module context.
+ */
+PRIVATE void
cp_eoc_sta_action__power_on_no_beacons (cp_t *ctx)
{
- cp_tei_t tei;
cp_net_t *net;
cp_nid_t nid;
cp_snid_t snid;
cp_sta_own_data_t *own;
dbg_assert (ctx);
- tei = MAC_TEI_UNASSOCIATED;
- cp_sta_own_data_set_tei (ctx, tei);
+ cp_sta_own_data_set_tei (ctx, MAC_TEI_UNASSOCIATED);
cp_sta_own_data_set_authenticated_status (ctx, false);
/* Set our AVLN. */
@@ -53,8 +53,6 @@ cp_eoc_sta_action__power_on_no_beacons (cp_t *ctx)
/* set start values */
ctx->sta_action.assoc.retry = 0;
ctx->sta_action.assoc.beacon_loss = 0;
-
- /* Call the beacon module to send the central beacon. */
}
void
diff --git a/cesar/cp/eoc/sta/action/test/utest/actions-Makefile b/cesar/cp/eoc/sta/action/test/utest/actions-Makefile
index cde8558bc2..5a537081c6 100644
--- a/cesar/cp/eoc/sta/action/test/utest/actions-Makefile
+++ b/cesar/cp/eoc/sta/action/test/utest/actions-Makefile
@@ -1,5 +1,7 @@
BASE = ../../../../../..
+DEFS = -DNO_PRIVATE
+
VARIANT = actions
INCLUDES = cp/eoc/sta/action/test/utest/actions-override
diff --git a/cesar/cp/eoc/sta/action/test/utest/fsm-Makefile b/cesar/cp/eoc/sta/action/test/utest/fsm-Makefile
index 4bb5daa928..25ea0aa7ba 100644
--- a/cesar/cp/eoc/sta/action/test/utest/fsm-Makefile
+++ b/cesar/cp/eoc/sta/action/test/utest/fsm-Makefile
@@ -1,5 +1,7 @@
BASE = ../../../../../..
+DEFS = -DNO_PRIVATE
+
VARIANT = fsm
INCLUDES = cp/eoc/sta/action/test/utest \
diff --git a/cesar/cp/eoc/sta/action/test/utest/src/fsm_stub.c b/cesar/cp/eoc/sta/action/test/utest/src/fsm_stub.c
index 802fecec6b..4bee0e8346 100644
--- a/cesar/cp/eoc/sta/action/test/utest/src/fsm_stub.c
+++ b/cesar/cp/eoc/sta/action/test/utest/src/fsm_stub.c
@@ -16,7 +16,6 @@
#include "cp/eoc/sta/action/assoc_slave.h"
#include "cp/eoc/sta/action/drv.h"
#include "cp/eoc/sta/action/vs.h"
-#include "cp/eoc/sta/action/poweron.h"
#include "cp/fsm/fsm.h"
#include "cp/fsm/inc/tables.h"
diff --git a/cesar/cp/eoc/sta/action/test/utest/src/test_actions.c b/cesar/cp/eoc/sta/action/test/utest/src/test_actions.c
index 4a55dc6265..f8a88a8cb3 100644
--- a/cesar/cp/eoc/sta/action/test/utest/src/test_actions.c
+++ b/cesar/cp/eoc/sta/action/test/utest/src/test_actions.c
@@ -32,6 +32,9 @@
#include "cp/sta/action/assoc.h"
void
+cp_eoc_sta_action__power_on_no_beacons (cp_t *ctx);
+
+void
cp_test_init (cp_t * ctx)
{
static pbproc_t pbproc;