source: sample/pingpong/main.cpp@ 4904

Last change on this file since 4904 was 4902, checked in by huebsch, 15 years ago

ping pong bootstrap test

File size: 1.2 KB
Line 
1#include <string>
2#include "ariba/utility/system/StartupWrapper.h"
3#include "PingPong.h"
4
5using std::string;
6using ariba::utility::StartupWrapper;
7using ariba::application::pingpong::PingPong;
8
9
10//*************************************************
11
12#include "ariba/utility/bootstrap/BootstrapManager.h"
13using ariba::utility::BootstrapManager;
14
15void debug(){
16 StartupWrapper::startSystem();
17
18 BootstrapManager& manager = BootstrapManager::instance();
19 manager.registerModule( BootstrapManager::BootstrapTypeBluetoothSdp );
20
21 manager.publish("testname", "testinfo1", "testinfo2", "testinfo3");
22 getchar();
23 manager.revoke("testname");
24
25 manager.unregisterModule( BootstrapManager::BootstrapTypePeriodicBroadcast );
26 StartupWrapper::stopSystem();
27}
28
29//*************************************************
30
31int main( int argc, char** argv ) {
32
33 debug();
34 return 0;
35
36
37 // get config file
38 string config = "../etc/settings.cnf";
39 if (argc >= 2) config = argv[1];
40
41 StartupWrapper::initConfig( config );
42 StartupWrapper::startSystem();
43
44 // this will do the main functionality and block
45 PingPong ping;
46 StartupWrapper::startup(&ping);
47
48 // --> we will run blocking until <enter> is hit
49
50 StartupWrapper::shutdown(&ping);
51 StartupWrapper::stopSystem();
52
53 return 0;
54}
Note: See TracBrowser for help on using the repository browser.