summaryrefslogtreecommitdiff
path: root/maximus/coreengine
diff options
context:
space:
mode:
authorburet2007-08-24 08:29:31 +0000
committerburet2007-08-24 08:29:31 +0000
commit7aad01e48647c734f7aceb79951d6962ca53315a (patch)
tree0530ca7d2496e50ed4446dc2a485b512ce19a44a /maximus/coreengine
parent1b492e01c5fea61bec88f0b1fba68d6290825702 (diff)
Maximus: delete unused folder
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@606 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'maximus/coreengine')
-rw-r--r--maximus/coreengine/test/Makefile8
-rw-r--r--maximus/coreengine/test/inc/CoreEngine.h149
-rwxr-xr-xmaximus/coreengine/test/inc/Maximus_Sar.h46
-rwxr-xr-xmaximus/coreengine/test/inc/Maximus_sar_complete.h43
-rw-r--r--maximus/coreengine/test/inc/TestExample.h127
-rw-r--r--maximus/coreengine/test/src/CoreEngine.cpp228
-rwxr-xr-xmaximus/coreengine/test/src/Maximus_Sar.cpp59
-rwxr-xr-xmaximus/coreengine/test/src/Maximus_sar_complete.cpp225
-rw-r--r--maximus/coreengine/test/src/TestExample.cpp284
-rw-r--r--maximus/coreengine/test/src/main.cpp89
10 files changed, 0 insertions, 1258 deletions
diff --git a/maximus/coreengine/test/Makefile b/maximus/coreengine/test/Makefile
deleted file mode 100644
index db35450c58..0000000000
--- a/maximus/coreengine/test/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-BASE = ../../..
-
-HOST_PROGRAMS = maximustest
-maximustest_SOURCES = main.cpp CoreEngine.cpp TestExample.cpp
-maximustest_MODULES = maximus
-HOST_INCLUDES = maximus/coreengine/test/inc
-
-include $(BASE)/common/make/top.mk
diff --git a/maximus/coreengine/test/inc/CoreEngine.h b/maximus/coreengine/test/inc/CoreEngine.h
deleted file mode 100644
index 88a2b13072..0000000000
--- a/maximus/coreengine/test/inc/CoreEngine.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/************************************************************************
- CoreEngine.h - Copyright buret
-
-Here you can write a license for your code, some comments or any other
-information you want to have in your generated code. To to this simply
-configure the "headings" directory in uml to point to a directory
-where you have your heading files.
-
-or you can just replace the contents of this file with your own.
-If you want to do this, this file is located at
-
-/usr/share/apps/umbrello/headings/heading.h
-
--->Code Generators searches for heading files based on the file extension
- i.e. it will look for a file name ending in ".h" to include in C++ header
- files, and for a file name ending in ".java" to include in all generated
- java code.
- If you name the file "heading.<extension>", Code Generator will always
- choose this file even if there are other files with the same extension in the
- directory. If you name the file something else, it must be the only one with that
- extension in the directory to guarantee that Code Generator will choose it.
-
-you can use variables in your heading files which are replaced at generation
-time. possible variables are : author, date, time, filename and filepath.
-just write %variable_name%
-
-This file was generated on %date% at %time%
-The original location of this file is /home/buret/eclipse/maximus/coreengine/inc/CoreEngine.h
-**************************************************************************/
-
-#ifndef COREENGINE_H
-#define COREENGINE_H
-
-#include <string>
-
-class PhyProcessor;
-class FunctionCallManager;
-class NetworkClockProcessor;
-class SystemManager;
-class SciServer;
-
-
-/**
- * class CoreEngine
- * Main simulator part which is managing the overall working of PHY interface,
- * Network Clock and other AV stations
- */
-
-class CoreEngine
-{
-
-public:
-
- // public attributes
- //
-
-private:
-
- // private attributes
- //
-
- FunctionCallManager * mpFunctionCallManager;
- SystemManager * mpSystemManager;
- NetworkClockProcessor * mpNetworkClockProcessor;
- PhyProcessor * mpPhyProcessor;
- SciServer * mpSciServer;
-
-protected:
-
- // protected attributes
- //
-
-public:
-
- // Constructors/Destructors
- //
-
- /**
- * Empty Constructor
- */
- CoreEngine ( );
-
- /**
- * Constructor
- */
- CoreEngine ( const std::string station_exec );
-
- /**
- * Empty Destructor
- */
- virtual ~CoreEngine ( );
-
- // public methods
- //
-
- int run ( );
-
- // public attribute accessor methods
- //
-
- // private attribute accessor methods
- //
-
- /**
- * @return FunctionCallManager *
- */
- FunctionCallManager * getFunctionCallManager ( ) const;
-
- /**
- * @return SystemManager *
- */
- SystemManager * getSystemManager ( ) const;
-
- /**
- * @return NetworkClockProcessor *
- */
- NetworkClockProcessor * getNetworkClockProcessor ( ) const;
-
- /**
- * @return PhyProcessor *
- */
- PhyProcessor * getPhyProcessor ( ) const;
-
- /**
- * @return SciServer *
- */
- SciServer * getSciServer ( ) const;
-
- // protected attribute accessor methods
- //
-
-private:
-
- // private methods
- //
-
- void initAttributes ( );
-
- void stop ( );
-
-protected:
-
- // protected methods
- //
-
-};
-
-
-#endif // COREENGINE_H
diff --git a/maximus/coreengine/test/inc/Maximus_Sar.h b/maximus/coreengine/test/inc/Maximus_Sar.h
deleted file mode 100755
index b8456a9120..0000000000
--- a/maximus/coreengine/test/inc/Maximus_Sar.h
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-//
-// Generated by StarUML(tm) C++ Add-In
-//
-// @ Project : Sar_procedure_test
-// @ File Name : Maximus_Sar.h
-// @ Date : 25/07/2007
-// @ Author : Nelio Laranjeiro
-//
-//
-
-
-#if !defined(_MAXIMUS_SAR_H)
-#define _MAXIMUS_SAR_H
-
-#include "FunctionSciMsg.h"
-#include "FunctionCallParameter.h"
-#include "FunctionCallManager.h"
-#include "SystemManager.h"
-#include "NetworkClockProcessor.h"
-#include "PhyProcessor.h"
-
-#include "Error.h"
-#include <iostream> // for 'cout', 'cerr' and 'clog'
-using namespace std;
-
-class FunctionCallManager;
-class SystemManager;
-class FunctionSciMsg;
-class NetworkClockProcessor;
-class PhyProcessor;
-
-class Maximus_Sar
-{
-public:
- Maximus_Sar(FunctionCallManager *p_function_call_manager, NetworkClockProcessor *p_network_clock_processor, PhyProcessor *p_phy_processor, SystemManager *p_system_manager);
- ~Maximus_Sar();
-protected:
- FunctionCallManager * mpFunctionCallManager;
- SystemManager * mpSystemManager;
- NetworkClockProcessor * mpNetworkClockProcessor;
- PhyProcessor * mpPhyProcessor;
- void process();
-};
-
-#endif //_MAXIMUS_SAR_H
diff --git a/maximus/coreengine/test/inc/Maximus_sar_complete.h b/maximus/coreengine/test/inc/Maximus_sar_complete.h
deleted file mode 100755
index 3b713da1b8..0000000000
--- a/maximus/coreengine/test/inc/Maximus_sar_complete.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-//
-// Generated by StarUML(tm) C++ Add-In
-//
-// @ Project : Sar_procedure_test
-// @ File Name : Maximus_sar_complete.h
-// @ Date : 25/07/2007
-// @ Author : Nelio Laranjeiro
-//
-//
-
-
-#if !defined(_MAXIMUS_SAR_COMPLETE_H)
-#define _MAXIMUS_SAR_COMPLETE_H
-
-#include <iostream> // for 'cout', 'cerr' and 'clog'
-#include "sci_types.h"
-#include "Maximus_Sar.h"
-
-static unsigned char **blk;
-static int blk_array_length;
-
-class Maximus_sar_complete : public Maximus_Sar
-{
-public:
- Maximus_sar_complete(FunctionCallManager *p_function_call_manager,
- NetworkClockProcessor *p_network_clock_processor,
- PhyProcessor *p_phy_processor, SystemManager *p_system_manager);
- ~Maximus_sar_complete();
- int run();
-
-private:
- unsigned char *buffer;
- unsigned int type_length;
- unsigned int ats_confounder;
- unsigned int lid;
- unsigned int tei;
-
- int maximus_send_msdu(Sci_Msg_Station_Id station_id);
- int maximus_send_mpdu(Sci_Msg_Station_Id station_id);
-};
-
-#endif //_MAXIMUS_SAR_COMPLETE_H
diff --git a/maximus/coreengine/test/inc/TestExample.h b/maximus/coreengine/test/inc/TestExample.h
deleted file mode 100644
index d983e50a74..0000000000
--- a/maximus/coreengine/test/inc/TestExample.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/************************************************************************
- TestExample.h - Copyright buret
-
-Here you can write a license for your code, some comments or any other
-information you want to have in your generated code. To to this simply
-configure the "headings" directory in uml to point to a directory
-where you have your heading files.
-
-or you can just replace the contents of this file with your own.
-If you want to do this, this file is located at
-
-/usr/share/apps/umbrello/headings/heading.h
-
--->Code Generators searches for heading files based on the file extension
- i.e. it will look for a file name ending in ".h" to include in C++ header
- files, and for a file name ending in ".java" to include in all generated
- java code.
- If you name the file "heading.<extension>", Code Generator will always
- choose this file even if there are other files with the same extension in the
- directory. If you name the file something else, it must be the only one with that
- extension in the directory to guarantee that Code Generator will choose it.
-
-you can use variables in your heading files which are replaced at generation
-time. possible variables are : author, date, time, filename and filepath.
-just write %variable_name%
-
-This file was generated on %date% at %time%
-The original location of this file is /home/buret/eclipse/maximus/coreengine/test/inc/TestExample.h
-**************************************************************************/
-
-#ifndef TESTEXAMPLE_H_
-#define TESTEXAMPLE_H_
-
-#include "sci_types.h"
-
-class FunctionCallManager;
-class SystemManager;
-class FunctionSciMsg;
-class NetworkClockProcessor;
-class PhyProcessor;
-
-void maximus_function_call_test ( FunctionSciMsg & function_sci_msg );
-
-
-/**
- * class TestExample
- */
-
-class TestExample
-{
-
-public:
-
- // public attributes
- //
-
-private:
-
- // private attributes
- //
-
- FunctionCallManager * mpFunctionCallManager;
- SystemManager * mpSystemManager;
- NetworkClockProcessor * mpNetworkClockProcessor;
- PhyProcessor * mpPhyProcessor;
-
-protected:
-
- // protected attributes
- //
-
-public:
-
- // Constructors/Destructors
- //
-
- /**
- * Empty Constructor
- */
- TestExample ( FunctionCallManager * p_function_call_manager,
- SystemManager * p_system_manager,
- NetworkClockProcessor * p_network_clock_processor,
- PhyProcessor * p_phy_processor );
-
- /**
- * Empty Destructor
- */
- virtual ~TestExample ( );
-
- // public methods
- //
-
- int run ( );
-
- // public attribute accessor methods
- //
-
- // private attribute accessor methods
- //
-
- // protected attribute accessor methods
- //
-
-private:
-
- // private methods
- //
-
- void process ( );
-
- int testFunctionCall ( Sci_Msg_Station_Id station_id );
-
- int testProbe1 ( Sci_Msg_Station_Id station_id );
-
- int testProbe2 ( Sci_Msg_Station_Id station_id );
-
- int testProbe3 ( Sci_Msg_Station_Id station_id );
-
-protected:
-
- // protected methods
- //
-
-};
-
-
-#endif /*TESTEXAMPLE_H_*/
diff --git a/maximus/coreengine/test/src/CoreEngine.cpp b/maximus/coreengine/test/src/CoreEngine.cpp
deleted file mode 100644
index 6cad779dea..0000000000
--- a/maximus/coreengine/test/src/CoreEngine.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-/************************************************************************
- CoreEngine.cpp - Copyright buret
-
-Here you can write a license for your code, some comments or any other
-information you want to have in your generated code. To to this simply
-configure the "headings" directory in uml to point to a directory
-where you have your heading files.
-
-or you can just replace the contents of this file with your own.
-If you want to do this, this file is located at
-
-/usr/share/apps/umbrello/headings/heading.cpp
-
--->Code Generators searches for heading files based on the file extension
- i.e. it will look for a file name ending in ".h" to include in C++ header
- files, and for a file name ending in ".java" to include in all generated
- java code.
- If you name the file "heading.<extension>", Code Generator will always
- choose this file even if there are other files with the same extension in the
- directory. If you name the file something else, it must be the only one with that
- extension in the directory to guarantee that Code Generator will choose it.
-
-you can use variables in your heading files which are replaced at generation
-time. possible variables are : author, date, time, filename and filepath.
-just write %variable_name%
-
-This file was generated on %date% at %time%
-The original location of this file is /home/buret/eclipse/maximus/coreengine/test/src/CoreEngine.cpp
-**************************************************************************/
-
-#include "CoreEngine.h"
-#include "TestExample.h"
-
-#include "PhyProcessor.h"
-#include "FunctionCallManager.h"
-#include "NetworkClockProcessor.h"
-#include "SystemManager.h"
-#include "SciServer.h"
-
-#include "Error.h"
-#include <iostream> // for 'cout', 'cerr' and 'clog'
-using namespace std;
-
-
-// Constructors/Destructors
-//
-
-
-CoreEngine::CoreEngine ( ):
-mpFunctionCallManager(NULL),
-mpSystemManager(NULL),
-mpNetworkClockProcessor(NULL),
-mpPhyProcessor(NULL),
-mpSciServer(NULL)
-{
- clog << "CoreEngine()" << endl;
-
- initAttributes();
-}
-
-
-CoreEngine::CoreEngine ( const string station_exec ):
-mpFunctionCallManager(NULL),
-mpSystemManager(NULL),
-mpNetworkClockProcessor(NULL),
-mpPhyProcessor(NULL),
-mpSciServer(NULL)
-{
- clog << "CoreEngine()" << endl;
-
- initAttributes();
-
- if (NULL != mpSystemManager)
- {
- mpSystemManager->setStationExec(station_exec);
- }
-}
-
-
-void CoreEngine::initAttributes ( )
-{
- clog << "CoreEngine::initAttributes" << endl;
-
- // Create all packages: at first SCI; then FunctionCall, Phy, and System; and lastly NetworkClock
- //
- try
- {
- mpSciServer = new SciServer();
- mpFunctionCallManager = new FunctionCallManager(mpSciServer);
- mpSystemManager = new SystemManager(mpSciServer);
- mpPhyProcessor = new PhyProcessor(mpSciServer);
- mpNetworkClockProcessor = new NetworkClockProcessor(mpSciServer, mpSystemManager, mpFunctionCallManager, mpPhyProcessor);
- }
- catch ( Error &e )
- {
- e.display();
- }
-}
-
-
-CoreEngine::~CoreEngine ( )
-{
- clog << "~CoreEngine" << endl;
-
- if (NULL != mpNetworkClockProcessor)
- {
- delete (mpNetworkClockProcessor);
- mpNetworkClockProcessor = NULL;
- }
- if (NULL != mpFunctionCallManager)
- {
- delete (mpFunctionCallManager);
- mpFunctionCallManager = NULL;
- }
- if (NULL != mpSystemManager)
- {
- delete (mpSystemManager);
- mpSystemManager = NULL;
- }
- if (NULL != mpPhyProcessor)
- {
- delete (mpPhyProcessor);
- mpPhyProcessor = NULL;
- }
- if (NULL != mpSciServer)
- {
- delete (mpSciServer);
- mpSciServer = NULL;
- }
-}
-
-
-//
-// Methods
-//
-
-
-// Other methods
-//
-
-
-// public methods
-//
-
-
-int CoreEngine::run ( )
-{
- clog << "CoreEngine::run" << endl;
- int run = -1;
-
- try
- {
- TestExample testExample(mpFunctionCallManager, mpSystemManager, mpNetworkClockProcessor, mpPhyProcessor);
- run = testExample.run();
- //stop ();
- }
- catch ( Error &e )
- {
- e.display();
- }
-
- return run;
-}
-
-
-void CoreEngine::stop ( )
-{
- clog << "CoreEngine::stop" << endl;
-
- // Kill all stations
- //
- mpSystemManager->removeAllStations();
-}
-
-
-// private methods
-//
-
-
-// protected methods
-//
-
-
-// Accessor methods
-//
-
-
-// public attribute accessor methods
-//
-
-
-// private attribute accessor methods
-//
-
-
-FunctionCallManager * CoreEngine::getFunctionCallManager ( ) const
-{
- return mpFunctionCallManager;
-}
-
-
-SystemManager * CoreEngine::getSystemManager ( ) const
-{
- return mpSystemManager;
-}
-
-
-NetworkClockProcessor * CoreEngine::getNetworkClockProcessor ( ) const
-{
- return mpNetworkClockProcessor;
-}
-
-
-PhyProcessor * CoreEngine::getPhyProcessor ( ) const
-{
- return mpPhyProcessor;
-}
-
-
-SciServer * CoreEngine::getSciServer ( ) const
-{
- return mpSciServer;
-}
-
-
-// protected attribute accessor methods
-//
-
diff --git a/maximus/coreengine/test/src/Maximus_Sar.cpp b/maximus/coreengine/test/src/Maximus_Sar.cpp
deleted file mode 100755
index a57e4d1cc1..0000000000
--- a/maximus/coreengine/test/src/Maximus_Sar.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-//
-// Generated by StarUML(tm) C++ Add-In
-//
-// @ Project : Sar_procedure_test
-// @ File Name : Maximus_Sar.cpp
-// @ Date : 25/07/2007
-// @ Author : Nelio Laranjeiro
-//
-//
-
-
-#include "Maximus_Sar.h"
-#include "FunctionCallManager.h"
-#include "NetworkClockProcessor.h"
-#include "PhyProcessor.h"
-#include "SystemManager.h"
-
-Maximus_Sar::Maximus_Sar (FunctionCallManager *p_function_call_manager,
- NetworkClockProcessor *p_network_clock_processor,
- PhyProcessor *p_phy_processor, SystemManager *p_system_manager)
-{
- clog << "Maximus_sar_add_msdu(...)"<< endl;
-
- mpFunctionCallManager = p_function_call_manager;
- mpSystemManager = p_system_manager;
- mpNetworkClockProcessor = p_network_clock_processor;
- mpPhyProcessor = p_phy_processor;
-}
-
-Maximus_Sar::~Maximus_Sar ()
-{
- clog << "~Maximus_sar_add_msdu"<< endl;
-
- mpFunctionCallManager = NULL;
- mpSystemManager = NULL;
- mpNetworkClockProcessor = NULL;
- mpPhyProcessor = NULL;
-}
-
-void Maximus_Sar::process ()
-{
- clog << "Maximus_sar_add_msdu::process"<< endl;
-
- while (!mpSystemManager->areAllActiveStationsIdle ())
- ;
-
- bool b = true;
- unsigned int count = 0;
- while (b && (count < 5))
- {
- b = mpNetworkClockProcessor->processNextEvt ();
- count ++;
- }
-
- while (!mpSystemManager->areAllActiveStationsIdle ())
- ;
-}
-
diff --git a/maximus/coreengine/test/src/Maximus_sar_complete.cpp b/maximus/coreengine/test/src/Maximus_sar_complete.cpp
deleted file mode 100755
index 93756ecc17..0000000000
--- a/maximus/coreengine/test/src/Maximus_sar_complete.cpp
+++ /dev/null
@@ -1,225 +0,0 @@
-/* Cesar project {{{
- *
- * Copyright (C) 2007 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file Maximus_sar_complete.cpp
- * \brief Test the SAR with Maximus
- * \ingroup /media/datas/Workspace/Cesar/maximus/coreengine/test
- *
- * Send a msdu to the STA to be segmented.
- * The sta returns the list of PBs generated
- *
- * The list is sended as a mpdu to the STA.
- * The STA mix up the list of PBs (simulate the pbproc)
- * Give the list to the SAR (without any data to the MFS or MME, the SAR will
- * create it).
- * The SAR reconsititute the MF and returns it in two buffers of 1024 bytes each.
- *
- * The MF is writen down in a file in the /tmp/mf.txt file.
- */
-
-
-#include "Maximus_sar_complete.h"
-
-void maximus_send_msdu_cb (FunctionSciMsg & function_sci_msg)
-{
- extern unsigned char **blk;
- unsigned long dataLength;
- char value [5];
- string id;
- int i;
-
- clog << "maximus_send_msdu_cb"<< endl;
-
- blk_array_length
- = function_sci_msg.getSpecializedSciMsgParametersNumber ();
- blk = (unsigned char **) malloc (blk_array_length
- * sizeof(unsigned char *));
-
- dataLength = 520;
-
- for (i = 0; i < blk_array_length; i++)
- {
- id = "pb";
- sprintf (value, "%d", i);
- id += value;
- function_sci_msg.bindParameter (id , dataLength, blk[i]);
- }
-
-// //Print the data of each PB
-// printf ("PB segmented by the STA");
-// int j;
-// for (i = 0; i < blk_array_length; i++)
-// {
-// for (j = 0; j < 512; j++)
-// {
-// printf ("%02x ", blk[i][j + 16]);
-// }
-// printf ("\n\n");
-// }
-
- clog << "End of maximus_send_msdu_cb"<< endl;
-}
-
-void maximus_send_mpdu_cb (FunctionSciMsg & function_sci_msg)
-{
- clog << "maximus_send_mpdu_cb"<< endl;
-
- FILE *mac_frame;
- unsigned char *buffer;
- unsigned long buffer_length = 1024;
-
- mac_frame = fopen ("/tmp/mf.txt", "w+");
-
- if (mac_frame != NULL)
- {
- clog << "[File] created : ~/tmp/mf.txt" << endl;
-
- function_sci_msg.bindParameter ("buffer1" , buffer_length, buffer);
- fwrite(buffer, sizeof(unsigned char), buffer_length, mac_frame);
- clog << "[File] buffer wrote" << endl;
- free (buffer);
-
- function_sci_msg.bindParameter ("buffer2" , buffer_length, buffer);
- fwrite(buffer, sizeof(unsigned char), buffer_length, mac_frame);
- clog << "[File] buffer wrote" << endl;
- free (buffer);
-
- fclose (mac_frame);
- clog << "[File] Closed" << endl;
- }
-
- clog << "End of maximus_send_mpdu_cb"<< endl;
-}
-
-int Maximus_sar_complete::run ()
-{
- clog << "Maximus_sar_add_msdu::run"<< endl;
- int testResult = -1;
-
- try
- {
- Sci_Msg_Station_Id stationId = mpSystemManager->createStation();
-
- if (0 != stationId)
- {
- while (!mpSystemManager->areAllActiveStationsIdle());
-
- // Test function call
- //
- testResult = maximus_send_msdu (stationId);
- process();
-
- testResult = maximus_send_mpdu (stationId);
- process();
- }
- }
- catch ( Error &e )
- {
- e.display();
- }
-
- return testResult;
-}
-
-Maximus_sar_complete::Maximus_sar_complete (
- FunctionCallManager *p_function_call_manager,
- NetworkClockProcessor *p_network_clock_processor,
- PhyProcessor *p_phy_processor, SystemManager *p_system_manager) :
- Maximus_Sar(p_function_call_manager, p_network_clock_processor,
- p_phy_processor, p_system_manager)
-{
- clog << "Maximus_sar_add_msdu(...)"<< endl;
-}
-
-Maximus_sar_complete::~Maximus_sar_complete ()
-{
- clog << "~Maximus_sar_add_msdu"<< endl;
-}
-
-int Maximus_sar_complete::maximus_send_msdu (Sci_Msg_Station_Id station_id)
-{
- int testFc = -1;
-
- clog << "Sending msdu request"<< endl;
-
- FunctionSciMsg * functionSciMsg = mpFunctionCallManager->createMsg ();
- mpFunctionCallManager->registerCallback (
- functionSciMsg->getSpecializedSciMsgId (), &maximus_send_msdu_cb);
- testFc = functionSciMsg->setFunctionName ("maximus_send_msdu");
- FunctionCallParameter parameter("function_call_parameter", 27,
- (unsigned char *)"Maximus function call test\0");
- testFc &= functionSciMsg->addParameter (parameter);
-
- testFc &= functionSciMsg->setSciMsgStationId (station_id);
- mpFunctionCallManager->sendMsg (functionSciMsg);
-
- // Delete SCI msg
- //
- if (NULL != functionSciMsg)
- {
- delete (functionSciMsg);
- functionSciMsg = NULL;
- }
-
- return testFc;
-}
-
-int Maximus_sar_complete::maximus_send_mpdu (Sci_Msg_Station_Id station_id)
-{
- int testFc = -1;
- int i;
- char value [5];
- unsigned long datalength;
- string id;
-
- FunctionCallParameter *parameter;
-
- clog << "Sending mpdu request"<< endl;
-
- FunctionSciMsg * functionSciMsg = mpFunctionCallManager->createMsg ();
- mpFunctionCallManager->registerCallback (
- functionSciMsg->getSpecializedSciMsgId (), &maximus_send_mpdu_cb);
- testFc = functionSciMsg->setFunctionName ("maximus_send_mpdu");
-
- datalength = 520;
-
- sprintf (value, "%d", blk_array_length);
- parameter = new FunctionCallParameter( "qte", 5, (unsigned char *) value);
- testFc &= functionSciMsg->addParameter (*parameter);
-
- for (i = 0; i < blk_array_length; i++)
- {
- id = "pb";
- sprintf (value, "%d", i);
- id += value;
-
- parameter = new FunctionCallParameter( id, datalength, blk[i]);
- testFc &= functionSciMsg->addParameter (*parameter);
- }
-
- testFc &= functionSciMsg->setSciMsgStationId (station_id);
- mpFunctionCallManager->sendMsg (functionSciMsg);
-
- // Delete SCI msg
- //
- if (NULL != functionSciMsg)
- {
- delete (functionSciMsg);
- functionSciMsg = NULL;
- }
-
- if (blk != NULL)
- {
- free (blk);
- blk = NULL;
- blk_array_length = 0;
- }
-
- return testFc;
-}
-
diff --git a/maximus/coreengine/test/src/TestExample.cpp b/maximus/coreengine/test/src/TestExample.cpp
deleted file mode 100644
index f529f52cd4..0000000000
--- a/maximus/coreengine/test/src/TestExample.cpp
+++ /dev/null
@@ -1,284 +0,0 @@
-/************************************************************************
- TestExample.cpp - Copyright buret
-
-Here you can write a license for your code, some comments or any other
-information you want to have in your generated code. To to this simply
-configure the "headings" directory in uml to point to a directory
-where you have your heading files.
-
-or you can just replace the contents of this file with your own.
-If you want to do this, this file is located at
-
-/usr/share/apps/umbrello/headings/heading.cpp
-
--->Code Generators searches for heading files based on the file extension
- i.e. it will look for a file name ending in ".h" to include in C++ header
- files, and for a file name ending in ".java" to include in all generated
- java code.
- If you name the file "heading.<extension>", Code Generator will always
- choose this file even if there are other files with the same extension in the
- directory. If you name the file something else, it must be the only one with that
- extension in the directory to guarantee that Code Generator will choose it.
-
-you can use variables in your heading files which are replaced at generation
-time. possible variables are : author, date, time, filename and filepath.
-just write %variable_name%
-
-This file was generated on %date% at %time%
-The original location of this file is /home/buret/eclipse/maximus/coreengine/test/src/TestExample.cpp
-**************************************************************************/
-
-#include "TestExample.h"
-
-#include "FunctionSciMsg.h"
-#include "FunctionCallParameter.h"
-#include "FunctionCallManager.h"
-#include "SystemManager.h"
-#include "NetworkClockProcessor.h"
-#include "PhyProcessor.h"
-
-#include "Error.h"
-#include <iostream> // for 'cout', 'cerr' and 'clog'
-using namespace std;
-
-
-void maximus_function_call_test ( FunctionSciMsg & function_sci_msg )
-{
- clog << "=> maximus_function_call_test" << endl;
-
- unsigned char * pData = NULL;
- unsigned long dataLength = 0;
- function_sci_msg.bindParameter("function_call_parameter", dataLength, pData);
- clog << "\tfunction_call_parameter = ";
- for (unsigned int i=0; i<dataLength; i++)
- {
- clog << pData[i];
- }
- clog << endl;
-}
-
-
-// Constructors/Destructors
-//
-
-
-TestExample::TestExample ( FunctionCallManager * p_function_call_manager,
- SystemManager * p_system_manager,
- NetworkClockProcessor * p_network_clock_processor,
- PhyProcessor * p_phy_processor )
-{
- clog << "TestExample(...)" << endl;
-
- mpFunctionCallManager = p_function_call_manager;
- mpSystemManager = p_system_manager;
- mpNetworkClockProcessor = p_network_clock_processor;
- mpPhyProcessor = p_phy_processor;
-}
-
-
-TestExample::~TestExample ( )
-{
- clog << "~TestExample" << endl;
-
- mpFunctionCallManager = NULL;
- mpSystemManager = NULL;
- mpNetworkClockProcessor = NULL;
- mpPhyProcessor = NULL;
-}
-
-
-//
-// Methods
-//
-
-
-// Other methods
-//
-
-
-// public methods
-//
-
-
-int TestExample::run ( )
-{
- clog << "TestExample::run" << endl;
- int testResult = -1;
-
- try
- {
- Sci_Msg_Station_Id stationId1 = mpSystemManager->createStation();
- Sci_Msg_Station_Id stationId2 = mpSystemManager->createStation();
-
- if ((0 != stationId1) && (0 != stationId2))
- {
- while (!mpSystemManager->areAllActiveStationsIdle());
-
- // Test function call
- //
- testResult = testFunctionCall (stationId1);
- process();
-
- // Test probe
- //
- testResult &= testProbe1 (stationId2); // 1. Get parameter
- process();
- testResult &= testProbe2 (stationId2); // 2. Set parameter
- process();
- testResult &= testProbe3 (stationId2); // 3. Get parameter that has been set to check result
- process();
- }
- }
- catch ( Error &e )
- {
- e.display();
- }
-
- return testResult;
-}
-
-
-void TestExample::process ( )
-{
- clog << "TestExample::process" << endl;
-
- while (!mpSystemManager->areAllActiveStationsIdle());
-
- bool b = true;
- unsigned int count = 0;
- while (b && (count < 5))
- {
- b = mpNetworkClockProcessor->processNextEvt();
- count ++;
- }
-
- while (!mpSystemManager->areAllActiveStationsIdle());
-}
-
-
-int TestExample::testFunctionCall ( Sci_Msg_Station_Id station_id )
-{
- int testFc = -1;
-
- FunctionSciMsg * functionSciMsg = mpFunctionCallManager->createMsg();
- mpFunctionCallManager->registerCallback(functionSciMsg->getSpecializedSciMsgId(), &maximus_function_call_test);
- testFc = functionSciMsg->setFunctionName("function_call_test");
- FunctionCallParameter parameter ("function_call_parameter", 27, (unsigned char *)"Maximus function call test\0");
- testFc &= functionSciMsg->addParameter(parameter);
- testFc &= functionSciMsg->setSciMsgStationId(station_id);
- mpFunctionCallManager->sendMsg(functionSciMsg);
-
- // Delete SCI msg
- //
- if (NULL != functionSciMsg)
- {
- delete (functionSciMsg);
- functionSciMsg = NULL;
- }
-
- return testFc;
-}
-
-
-int TestExample::testProbe1 ( Sci_Msg_Station_Id station_id )
-{
- int testProbe1 = -1;
-
- FunctionSciMsg * probeSciMsg1 = mpFunctionCallManager->createMsg();
- testProbe1 = probeSciMsg1->setFunctionName(PROBE_ID);
- FunctionCallParameter probeParameterToGet ("probe_call_parameter_to_get", 0, NULL);
- testProbe1 &= probeSciMsg1->addParameter(probeParameterToGet);
- testProbe1 &= probeSciMsg1->setSciMsgStationId(station_id);
- mpFunctionCallManager->sendMsg(probeSciMsg1);
-
- // Delete SCI msg
- //
- if (NULL != probeSciMsg1)
- {
- delete(probeSciMsg1);
- probeSciMsg1 = NULL;
- }
-
- return testProbe1;
-}
-
-
-int TestExample::testProbe2 ( Sci_Msg_Station_Id station_id )
-{
- int testProbe2 = -1;
-
- FunctionSciMsg * probeSciMsg2 = mpFunctionCallManager->createMsg();
- testProbe2 = probeSciMsg2->setFunctionName(PROBE_ID);
- unsigned char * pValueToSet = new unsigned char [sizeof(int)];
- int valueToSet = 36;
- memcpy(pValueToSet, &valueToSet, sizeof(int));
- FunctionCallParameter probeParameterToSet ("probe_call_parameter_to_set", sizeof(int), pValueToSet);
- testProbe2 &= probeSciMsg2->addParameter(probeParameterToSet);
- testProbe2 &= probeSciMsg2->setSciMsgStationId(station_id);
- mpFunctionCallManager->sendMsg(probeSciMsg2);
-
- // Delete SCI msg
- //
- if (NULL != probeSciMsg2)
- {
- delete(probeSciMsg2);
- probeSciMsg2 = NULL;
- }
-
- // Free allocated memory
- //
- if (NULL != pValueToSet)
- {
- delete [] pValueToSet;
- pValueToSet = NULL;
- }
-
- return testProbe2;
-}
-
-
-int TestExample::testProbe3 ( Sci_Msg_Station_Id station_id )
-{
- int testProbe3 = -1;
-
- FunctionSciMsg * probeSciMsg3 = mpFunctionCallManager->createMsg();
- testProbe3 = probeSciMsg3->setFunctionName(PROBE_ID);
- FunctionCallParameter probeParameterToCheck ("probe_call_parameter_to_set", 0, NULL);
- testProbe3 &= probeSciMsg3->addParameter(probeParameterToCheck);
- testProbe3 &= probeSciMsg3->setSciMsgStationId(station_id);
- testProbe3 &= mpFunctionCallManager->sendMsg(probeSciMsg3);
-
- // Delete SCI msg
- if (NULL != probeSciMsg3)
- {
- delete(probeSciMsg3);
- probeSciMsg3 = NULL;
- }
-
- return testProbe3;
-}
-
-
-// private methods
-//
-
-
-// protected methods
-//
-
-
-// Accessor methods
-//
-
-
-// public attribute accessor methods
-//
-
-
-// private attribute accessor methods
-//
-
-
-// protected attribute accessor methods
-//
-
diff --git a/maximus/coreengine/test/src/main.cpp b/maximus/coreengine/test/src/main.cpp
deleted file mode 100644
index e5b94cc834..0000000000
--- a/maximus/coreengine/test/src/main.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-
-#include "CoreEngine.h"
-#include "Error.h"
-
-#include <signal.h>
-#include <iostream> // for 'cout', 'cerr' and 'clog'
-#include <fstream> // for 'ofstream'
-#include <string>
-using namespace std;
-
-
-CoreEngine * pCoreEngine;
-
-void wrapperCoreEngine ( int n )
-{
- if (NULL != pCoreEngine)
- {
- cerr << endl;
- cerr << "-------------------------------------------------------------------------------------" << endl;
- cerr << "*** Exit Fulminata Maximus simulator ***" << endl;
- delete (pCoreEngine);
- pCoreEngine = NULL;
- }
-}
-
-
-int main ( int argc, const char * argv[] )
-{
- int result = -1;
-
- // Create a file for logging
- //
- //ofstream logFile ("/dev/null");
- ofstream logFile ("maximustestlog.txt");
- if (logFile)
- {
- clog.rdbuf(logFile.rdbuf());
- }
- else
- {
- cerr << "Error while opening log file" << endl;
- clog.rdbuf(cout.rdbuf());
- }
-
- cout << "-------------------------------------------------------------------------------------" << endl;
- cout << "*** Welcome to Fulminata Maximus simulator ***" << endl << endl;
-
- try
- {
- if (NULL != argv[1])
- {
- clog << "\tstation executable = " << argv[1] << endl;
- const string stationExec (argv[1]);
- pCoreEngine = new CoreEngine(stationExec);
- }
- else
- {
- pCoreEngine = new CoreEngine();
- }
- signal(SIGINT, wrapperCoreEngine);
- if (NULL != pCoreEngine)
- {
- result = pCoreEngine->run();
- }
- else
- {
- cerr << "Cannot create core engine" << endl;
- }
- }
- catch ( Error &e )
- {
- e.display();
- }
-
- // Delete core engine
- //
- if (NULL != pCoreEngine)
- {
- delete (pCoreEngine);
- pCoreEngine = NULL;
- }
-
- cout << endl;
- cout << "-------------------------------------------------------------------------------------" << endl;
- cout << "*** END ***" << endl;
- logFile.close();
-
- return result;
-}