00001 00002 #include "connection.h" 00003 00004 using namespace OpieTooth; 00005 00006 00007 00008 00009 00010 ConnectionState::ConnectionState() { 00011 m_direction = Incoming; 00012 m_handle = -1; 00013 m_state = -1; 00014 m_linkMode = -1; 00015 }; 00016 00017 ConnectionState::ConnectionState( const ConnectionState& con1 ) { 00018 (*this) = con1; 00019 } 00020 00021 00022 ConnectionState::ConnectionState( bool in, 00023 const QString& conType, 00024 const QString& mac, 00025 int handle, 00026 int state, 00027 int linkMode ) { 00028 m_direction = in; 00029 m_contype = conType; 00030 m_mac = mac; 00031 m_handle = handle; 00032 m_state = state; 00033 m_linkMode = linkMode; 00034 00035 } 00036 00037 void ConnectionState::setDirection( bool incoming ) { 00038 m_direction = incoming; 00039 } 00040 00041 bool ConnectionState::direction() const { 00042 return m_direction; 00043 } 00044 00045 void ConnectionState::setConnectionMode( const QString& conType ) { 00046 m_contype = conType; 00047 } 00048 00049 QString ConnectionState::connectionMode() const { 00050 return m_contype; 00051 } 00052 00053 void ConnectionState::setMac( const QString& mac ) { 00054 m_mac = mac; 00055 } 00056 00057 QString ConnectionState::mac() const{ 00058 return m_mac; 00059 } 00060 00061 void ConnectionState::setHandle( int handle ) { 00062 m_handle = handle; 00063 } 00064 00065 int ConnectionState::handle() const{ 00066 return m_handle; 00067 } 00068 00069 void ConnectionState::setState( int state ) { 00070 m_state = state; 00071 } 00072 00073 int ConnectionState::state()const { 00074 return m_state; 00075 } 00076 00077 void ConnectionState::setLinkMode( int linkMode ) { 00078 m_linkMode = linkMode; 00079 } 00080 00081 int ConnectionState::linkMode()const{ 00082 return m_linkMode; 00083 } 00084 00085 ConnectionState &ConnectionState::operator=( const ConnectionState& con1 ) { 00086 m_direction = con1.m_direction; 00087 m_contype = con1.m_contype; 00088 m_mac = con1.m_mac; 00089 m_handle = con1.m_handle; 00090 m_state = con1.m_state; 00091 m_linkMode = con1.m_linkMode; 00092 00093 return (*this); 00094 }
1.4.2