summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib/connection.cpp
blob: 5e35463db3d1f8d9b983ed519738f78008668832 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

#include "connection.h"

using namespace OpieTooth;





ConnectionState::ConnectionState() {
    m_direction = Incoming;
    m_handle = -1;
    m_state = -1;
    m_linkMode = -1;
};

ConnectionState::ConnectionState( const ConnectionState& con1 ) {
    (*this) = con1;
}


ConnectionState::ConnectionState( bool in,
                        const QString& conType,
                        const QString& mac,
                        int handle,
                        int state,
                        int linkMode ) {
    m_direction = in;
    m_contype = conType;
    m_mac = mac;
    m_handle = handle;
    m_state = state;
    m_linkMode = linkMode;

}

void ConnectionState::setDirection( bool incoming ) {
    m_direction = incoming;
}

bool ConnectionState::direction() const {
    return m_direction;
}

void ConnectionState::setConnectionMode( const QString& conType ) {
    m_contype = conType;
}

QString ConnectionState::connectionMode() const {
    return m_contype;
}

void ConnectionState::setMac( const QString& mac ) {
    m_mac = mac;
}

QString ConnectionState::mac() const{
    return m_mac;
}

void ConnectionState::setHandle( int handle ) {
    m_handle = handle;
}

int ConnectionState::handle() const{
    return m_handle;
}

void ConnectionState::setState( int state ) {
    m_state = state;
}

int ConnectionState::state()const {
    return m_state;
}

void ConnectionState::setLinkMode( int linkMode ) {
    m_linkMode = linkMode;
}

int ConnectionState::linkMode()const{
    return m_linkMode;
}

ConnectionState &ConnectionState::operator=( const ConnectionState& con1 ) {
    m_direction = con1.m_direction;
    m_contype = con1.m_contype;
    m_mac = con1.m_mac;
    m_handle = con1.m_handle;
    m_state = con1.m_state;
    m_linkMode = con1.m_linkMode;

    return (*this);
}