Subversion Repositories HomeAutomation

Rev

Rev 1326 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1326 Rev 1328
Line 38... Line 38...
38
#define reverse_foreach BOOST_REVERSE_FOREACH
38
#define reverse_foreach BOOST_REVERSE_FOREACH
39
using namespace std;
39
using namespace std;
40
 
40
 
41
 
41
 
42
using namespace atom;
42
using namespace atom;
-
 
43
/*
-
 
44
#
-
 
45
#include <unistd.h>
43
 
46
 
-
 
47
#
-
 
48
#include <stdlib.h>// for MAX_PATH
-
 
49
#
-
 
50
#include <iostream> // for cout and cin
-
 
51
#
-
 
52
 
-
 
53
#
-
 
54
using namespace std;
-
 
55
#
-
 
56
// function to return the current working directory
-
 
57
#
-
 
58
// this is generally the application path
-
 
59
#
-
 
60
void GetCurrentPath(char* buffer)
-
 
61
#
-
 
62
{
-
 
63
#
-
 
64
getcwd(buffer, 1024);
-
 
65
#
-
 
66
}
-
 
67
#
-
 
68
 
-
 
69
#
-
 
70
int main()
-
 
71
#
-
 
72
{
-
 
73
#
-
 
74
 
-
 
75
#
-
 
76
// _MAX_PATH is the maximum length allowed for a path
-
 
77
#
-
 
78
char CurrentPath[1024];
-
 
79
#
-
 
80
// use the function to get the path
-
 
81
#
-
 
82
GetCurrentPath(CurrentPath);
-
 
83
#
-
 
84
 
-
 
85
#
-
 
86
// display the path for demo purposes only
-
 
87
#
-
 
88
char temp[1024];
-
 
89
#
-
 
90
cout << CurrentPath << endl;
-
 
91
#
-
 
92
cout << "Press Enter to continue";
-
 
93
#
-
 
94
cin.getline(temp,1024);
-
 
95
#
-
 
96
return 0;
-
 
97
#
-
 
98
}
-
 
99
*/
44
int main(int argc, char* argv[])
100
int main(int argc, char* argv[])
45
{
101
{
46
    try
102
    try
47
    {
103
    {
48
        log::Logger LOG;
104
        log::Logger LOG;
Line 54... Line 110...
54
        Protocol::getInstance()->load("../../Configuration/protocol.xml", "../../Configuration/protocol-cache.xml");
110
        Protocol::getInstance()->load("../../Configuration/protocol.xml", "../../Configuration/protocol-cache.xml");
55
 
111
 
56
        broker::Broker::pointer broker = broker::Broker::getInstance();
112
        broker::Broker::pointer broker = broker::Broker::getInstance();
57
 
113
 
58
        subscribers::Monitor::pointer monitorSubscriber(new subscribers::Monitor(broker));
114
        subscribers::Monitor::pointer monitorSubscriber(new subscribers::Monitor(broker));
59
        //subscribers::CanNet::pointer canNetSubscriber(new subscribers::CanNet(broker, "192.168.1.250", 1100));
115
        subscribers::CanNet::pointer canNetSubscriber(new subscribers::CanNet(broker, "192.168.1.250", 1100));
60
 
116
 
61
        LOG.info("Will now try to send a message...");
117
        /*LOG.info("Will now try to send a message...");
62
 
118
 
63
        message::Header header(0, "irTranceiver", "temperature");
119
        message::Header header(0, "irTranceiver", "temperature");
64
 
120
 
65
        LOG.info("Header constructed...");
121
        LOG.info("Header constructed...");
66
 
122
 
67
        message::Message::pointer message(new message::Message(header));
123
        message::Message::pointer message(new message::Message(header));
68
 
124
 
69
        LOG.info("Message constructed...");
125
        LOG.info("Message constructed...");
70
 
126
 
71
        broker->put(message);
127
        broker->put(message);*/
72
 
128
 
73
        sleep(10000000);
129
        sleep(10000000);
74
    }
130
    }
75
    catch (Exception * e)
131
    catch (Exception * e)
76
    {
132
    {