summaryrefslogtreecommitdiff
path: root/mac
diff options
context:
space:
mode:
authorlaranjeiro2007-09-10 14:20:37 +0000
committerlaranjeiro2007-09-10 14:20:37 +0000
commitee3028fcfb0adb2226990012d9152b9bb84f86c1 (patch)
treedc6a10568c5aa46cbbf5331edf3932cc63124822 /mac
parente00e97554a0e6cfe2ed9fc7954fab9f81fa6f7be (diff)
Function test of the SAR on maximus done. Correct the bug #19 #10 #11
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@686 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'mac')
-rw-r--r--mac/sar/test/maximus_test/src/Maximus_sar.cpp51
-rw-r--r--mac/sar/test/maximus_test/src/Sta_sar.c31
2 files changed, 33 insertions, 49 deletions
diff --git a/mac/sar/test/maximus_test/src/Maximus_sar.cpp b/mac/sar/test/maximus_test/src/Maximus_sar.cpp
index 5ebd880d32..9af43a6a8c 100644
--- a/mac/sar/test/maximus_test/src/Maximus_sar.cpp
+++ b/mac/sar/test/maximus_test/src/Maximus_sar.cpp
@@ -36,10 +36,9 @@ using namespace std;
#define debug_info false
-#define launch_seg true
#define launch_seg_debug true
-#define launch_rea false
+#define launch_rea true
#define launch_rea_debug false
unsigned char blk[3][1024]; // 3 PB received from the Segmentation STA, of with
@@ -93,11 +92,6 @@ void stationA_cb (Msg &msg)
buffer = NULL;
}
-void stationB_cb (Msg &msg)
-{
-
-}
-
int main (int argc, char *argv[])
{
unsigned char lid;
@@ -137,28 +131,31 @@ int main (int argc, char *argv[])
return 0;
}
- Sta stationB = maximus.create_sta ();
- //create the function call
- Msg fc2 = maximus.create_fc ("reassembly");
- fc2.set_cb (&stationB_cb);
- fc2.set_sta (stationB);
- //stationB.debug ();
-
- /* Send the pb for a segmentation */
- for (i = 0; i < 3; i++)
+ if (launch_rea)
{
- sprintf (value, "%d", i);
- strcpy (id, "pb");
- strcat (id, value);
- fc2.add_param (id, 1024 * sizeof(unsigned char), blk[i]);
- if (debug_info && i == 0)
- printf ("Length : %d\n", *((unsigned short*)(blk[i]
- + sizeof(unsigned int))) >> 2);
- }
+ Sta stationB = maximus.create_sta ();
+ //create the function call
+ Msg fc2 = maximus.create_fc ("reassembly");
+ fc2.set_sta (stationB);
+
+ if (launch_rea_debug) stationB.debug ();
+
+ /* Send the pb for a segmentation */
+ for (i = 0; i < 3; i++)
+ {
+ sprintf (value, "%d", i);
+ strcpy (id, "pb");
+ strcat (id, value);
+ fc2.add_param (id, 1024 * sizeof(unsigned char), blk[i]);
+ if (debug_info && i == 0)
+ printf ("Length : %d\n", *((unsigned short*)(blk[i]
+ + sizeof(unsigned int))) >> 2);
+ }
- fc2.send_async ();
+ fc2.send_async ();
- /* Wait during 10000 ticks before terminating the program. */
- maximus.wait (10000);
+ /* Wait during 10000 ticks before terminating the program. */
+ maximus.wait (10000);
+ }
return 0;
}
diff --git a/mac/sar/test/maximus_test/src/Sta_sar.c b/mac/sar/test/maximus_test/src/Sta_sar.c
index fdcb210b81..2a97e8124f 100644
--- a/mac/sar/test/maximus_test/src/Sta_sar.c
+++ b/mac/sar/test/maximus_test/src/Sta_sar.c
@@ -596,8 +596,14 @@ bool bridge_dma_interruption_station_rea (void *user, u32 status_word)
else
j = 0;
- for (i = 0; i < packet2_len && !error; i++)
+ for (i = 0; (i < packet2_len - 1) && !error; i++, j++)
{
+ if (j == BLK_SIZE)
+ {
+ j = 0;
+ pb_curr = pb_curr->next;
+ }
+
if (job->job.data_addr[i] != pb_curr->data[j])
{
printf (
@@ -605,43 +611,24 @@ bool bridge_dma_interruption_station_rea (void *user, u32 status_word)
i, job->job.data_addr[i], pb_curr->data[j]);
error = true;
}
-
- j++;
- j = j % BLK_SIZE;
}
}
printf ("[Reassembly] Veryfing the bridge dma copy ended\n");
}
+ printf ("[Reassembly] Veryfing the buffer with the ethernet packet...\n");
for (i = 0; i < packet2_len && !error; i++)
{
if (job->job.data_addr[i] != packet2[i])
error = true;
}
+ printf ("[Reassembly] Veryfication the buffer with the ethernet packet ended\n");
if (error == true)
{
printf ("/***********************************/\n");
printf (" :( [Reassembly] FAIL :(\n");
printf ("/***********************************/\n");
-
- // for (i = 0; i < packet2_len; i++)
- // {
- // if (i % 16== 0)
- // printf ("\n");
- //
- // printf ("0x%02x ", packet2[i]);
- // }
- // printf ("\n");
- //
- // for (i = 0; i < packet2_len; i++)
- // {
- // if (i % 16== 0)
- // printf ("\n");
- //
- // printf ("0x%02x ", job->job.data_addr[i]);
- // }
- // printf ("\n");
}
else
{