summaryrefslogtreecommitdiff
path: root/cesar/test_general/maximus/integration/interface-dp
diff options
context:
space:
mode:
authorlaranjeiro2009-05-22 09:31:17 +0000
committerlaranjeiro2009-05-22 09:31:17 +0000
commit29675be9f10c938a5bb090284366e553272a8b20 (patch)
tree78ef2fd4f65a45c5fcd3a4eadce8218b4a8c5e58 /cesar/test_general/maximus/integration/interface-dp
parentfcdd6c70615a0fb7f806ee3073e2430f08fdec26 (diff)
* test_general/maximus/integration/interface-dp:
* Fix the python test to send the correctly values in the MME for the sniffer module. * Removed trailing white spaces in the source file. * Removed the mac address on the beacon prepare function call. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4683 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/test_general/maximus/integration/interface-dp')
-rw-r--r--cesar/test_general/maximus/integration/interface-dp/src/station.c37
-rw-r--r--cesar/test_general/maximus/integration/interface-dp/test1.py21
2 files changed, 26 insertions, 32 deletions
diff --git a/cesar/test_general/maximus/integration/interface-dp/src/station.c b/cesar/test_general/maximus/integration/interface-dp/src/station.c
index bb0aa04662..7713911cdc 100644
--- a/cesar/test_general/maximus/integration/interface-dp/src/station.c
+++ b/cesar/test_general/maximus/integration/interface-dp/src/station.c
@@ -7,11 +7,11 @@
* }}} */
/**
* \file test_general/integration/interface-dp/src/station.c
- * \brief Station interface - DP.
+ * \brief Station interface - DP.
* \ingroup test_general
*
* Test the integration of the interface with the data plane.
- * The sniffer will be added to this test later.
+ * The sniffer will be added to this test later.
*/
#include <cyg/kernel/kapi.h>
#include <cyg/hal/hal_arch.h>
@@ -48,7 +48,7 @@ struct station_test_t
u8 snid;
/** The mac store. */
mac_store_t *mac_store;
-
+
// Layers
/** Pbproc context. */
pbproc_t *pbproc;
@@ -118,7 +118,7 @@ cp_send_data_t cp_data;
* - fw forward link
* - rw reverse link
* - bcast broadcast.
- *
+ *
* \param fcall the fcall context.
* \param param the fcall param
* \param msg the message
@@ -151,7 +151,7 @@ int fc_add_mme_link (fcall_ctx_t *fcall, fcall_param_t **param,
if (fw)
{
mfs_tx = mac_store_mfs_add_tx (station_test.mac_store, bcast, true, MAC_LID_NONE, dtei, &added);
-
+
if (mfs_tx == NULL)
return false;
@@ -162,7 +162,7 @@ int fc_add_mme_link (fcall_ctx_t *fcall, fcall_param_t **param,
if (rw)
{
mfs_rx = mac_store_mfs_add_rx (station_test.mac_store, bcast, true, MAC_LID_NONE, dtei, &added);
-
+
if (mfs_rx == NULL)
return false;
@@ -180,7 +180,7 @@ int fc_add_mme_link (fcall_ctx_t *fcall, fcall_param_t **param,
}
/** Initialise the station parameters data as the mac address the tei.
- *
+ *
* - stei.
* - mac_addr.
*
@@ -211,7 +211,7 @@ int fc_station_config (fcall_ctx_t *fcall, fcall_param_t **param,
* It will create default schedules for the Channel Access in CSMA-only mode
* and activate the pbproc to start the communication with the others
* stations.
- *
+ *
* \param fcall the fcall context.
* \param param the fcall param
* \param msg the message
@@ -261,7 +261,7 @@ int fc_station_start (fcall_ctx_t *fcall, fcall_param_t **param,
* - mme the mme buffer to send
* - length the MME length
* - bcast the bradcast flag
- *
+ *
* \param fcall the fcall context.
* \param param the fcall param
* \param msg the message
@@ -362,7 +362,6 @@ cp_run (cyg_addrword_t data)
// send the beacon.
interface_beacon_prepare (station_test.interface, beacon,
- station_test.mac_config.sta_mac_address,
mfs, &beacon->data[128]);
interface_beacon_add (station_test.interface, beacon,
@@ -398,24 +397,24 @@ cp_init (void)
/**
* CE measurements. To be replace by the CE function to get the measurements
- *
+ *
* Pb measurement RX callback for Channel estimation.
- * This call back will return one or two block in order to insert all the
+ * This call back will return one or two block in order to insert all the
* measurements contained in each PB of the mpdu received.
- * Two cases can happen, the first the pb_nb is lesser than the blk capacity,
- * this callback will return only a blk pointed by the first and the last
+ * Two cases can happen, the first the pb_nb is lesser than the blk capacity,
+ * this callback will return only a blk pointed by the first and the last
* pointer.
* In the second case the quantity of PB are greater than one blk capacity, this
* callback will return two blk (chained) the first pointed by the first pointer
* and the last one by the last pointer.
- *
- * \param user User data
+ *
+ * \param user User data
* \param rx_params Frame control information to know date and tonemap used
* \param number of pbs
* \param first blk to insert the measurements.
* \param last blk to insert the measurements.
* \param chandata chan data measurements
- *
+ *
* \return boolean to indicate if a block had been returned or not.
*/
bool ce_measurements (void *user, pbproc_rx_params_t *rx_params, uint pb_nb,
@@ -538,8 +537,8 @@ cesar_init (void)
// Initialise the HLE
station_test.hle = hle_init (station_test.cl);
- // Interface init.
- station_test.interface = interface_init (station_test.hle,
+ // Interface init.
+ station_test.interface = interface_init (station_test.hle,
station_test.cl, station_test.sar,
&station_test.mac_config);
diff --git a/cesar/test_general/maximus/integration/interface-dp/test1.py b/cesar/test_general/maximus/integration/interface-dp/test1.py
index a4215eaa59..c3aaa89bcc 100644
--- a/cesar/test_general/maximus/integration/interface-dp/test1.py
+++ b/cesar/test_general/maximus/integration/interface-dp/test1.py
@@ -90,24 +90,19 @@ alloc_mme_buffer (maximus, sta1)
alloc_interface_buffer (maximus, sta1)
alloc_interface_buffer (maximus, sta1)
-
-#this one will be provide to the CP.
-alloc_mme_buffer (maximus, sta2)
-
-
# The station 1 will now send a MME to the second station.
-mme_payload = [0x1, 0x1, 0xf]
-
-s=''
-for i in range (0, len(mme_payload)):
- s+=pack('B', mme_payload[i])
-
+print "Configure sniffer on station 2"
mme = MME(MMHeader=MMHeader(ODA=sta2_mac_str, OSA=sta2_mac_str, MTYPE=0x88E1,
- MMV=0, MMTYPE=0xA030, FMI=0),MMEntry=MMEntry(s))
+ MMV=1, MMTYPE=0xA02C, FMI=0),MMEntry=MMEntry(pack('B', 0xF)))
mme.send(maximus, sta2)
-mme.send(maximus, sta1)
+rsp = recv(maximus, count = 1, filter = my_eth_filter)
+if rsp is None:
+ print "No confirmation received"
# The sniffer shall sniff this one...
+print "Send a MME to be sniffed"
+mme = MME(MMHeader=MMHeader(ODA=sta2_mac_str, OSA=sta2_mac_str, MTYPE=0x88E1,
+ MMV=0, MMTYPE=0x0030, FMI=0),MMEntry=MMEntry(pack('B', 1)))
mme.send(maximus, sta2)
#Catch the ethernet packets