1 | #include <string>
|
---|
2 | #include "ariba/utility/system/StartupWrapper.h"
|
---|
3 | #include "PingPong.h"
|
---|
4 |
|
---|
5 | using std::string;
|
---|
6 | using ariba::utility::StartupWrapper;
|
---|
7 | using ariba::application::pingpong::PingPong;
|
---|
8 |
|
---|
9 |
|
---|
10 | //*************************************************
|
---|
11 |
|
---|
12 | #include "ariba/utility/bootstrap/BootstrapManager.h"
|
---|
13 | using ariba::utility::BootstrapManager;
|
---|
14 |
|
---|
15 | void 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 |
|
---|
31 | int 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 | }
|
---|