Subversion Repositories HomeAutomation

Rev

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

Rev 1309 Rev 1310
Line 6... Line 6...
6
 */
6
 */
7
 
7
 
8
#ifndef CANNET_H_
8
#ifndef CANNET_H_
9
#define CANNET_H_
9
#define CANNET_H_
10
 
10
 
11
#include "../../broker/Subscriber.h"
11
#include "broker/Subscriber.h"
12
#include "../../broker/Broker.h"
12
#include "broker/Broker.h"
13
#include "../../message/Message.h"
13
#include "message/Message.h"
14
#include "../../message/Header.h"
14
#include "message/Header.h"
15
#include "../../utils/BitBuffer.h"
15
#include "utils/BitBuffer.h"
16
#include "../../utils/UdpServer.h"
16
#include "utils/UdpServer.h"
17
#include "../../utils/Logger.h"
17
#include "utils/Logger.h"
18
#include <boost/make_shared.hpp>
18
#include <boost/make_shared.hpp>
19
#include <boost/bind.hpp>
19
#include <boost/bind.hpp>
20
#include <boost/signal.hpp>
20
#include <boost/signal.hpp>
21
#include <string>
21
#include <string>
22
#include "../../types.h"
22
#include "types.h"
23
 
23
 
24
namespace atom {
24
namespace atom {
25
namespace subscribers {
25
namespace subscribers {
26
 
26
 
27
using namespace atom::broker;
27
using namespace broker;
28
using namespace atom::utils;
28
using namespace utils;
29
using namespace atom::message;
29
using namespace message;
30
using namespace std;
30
using namespace std;
31
 
31
 
32
// public boost::signals::trackable,
32
// public boost::signals::trackable,
33
class CanNet : public Subscriber
33
class CanNet : public Subscriber
34
{
34
{
Line 49... Line 49...
49
    enum
49
    enum
50
    {
50
    {
51
        PACKET_START = 253, PACKET_END = 250, PACKET_PING = 251
51
        PACKET_START = 253, PACKET_END = 250, PACKET_PING = 251
52
    };
52
    };
53
 
53
 
54
    boost::shared_ptr<UdpServer> myUdpServer;
54
    UdpServer::pointer myUdpServer;
55
    udp::endpoint myEndpoint;
55
    udp::endpoint myEndpoint;
56
    // TODO Add mutex lock for access to the buffer or are we safe?
56
    // TODO Add mutex lock for access to the buffer or are we safe?
57
    byte_list myBuffer;
57
    byte_list myBuffer;
58
 
58
 
59
private:
59
private: