author | mickeyl <mickeyl> | 2006-06-01 11:25:38 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2006-06-01 11:25:38 (UTC) |
commit | 4ec617a0fa1c44f5527ae7eff176cf8451d9973c (patch) (unidiff) | |
tree | cdb30283f8b09c2a8fa7448614ec4e3ae3e16529 | |
parent | b8da33d26189ae36814335e77bef05203df4e2b2 (diff) | |
download | opie-4ec617a0fa1c44f5527ae7eff176cf8451d9973c.zip opie-4ec617a0fa1c44f5527ae7eff176cf8451d9973c.tar.gz opie-4ec617a0fa1c44f5527ae7eff176cf8451d9973c.tar.bz2 |
add support for ipaq 2200
-rw-r--r-- | noncore/net/opietooth/applet/bluezapplet.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp index 127b0af..a1d64a4 100644 --- a/noncore/net/opietooth/applet/bluezapplet.cpp +++ b/noncore/net/opietooth/applet/bluezapplet.cpp | |||
@@ -90,96 +90,100 @@ namespace OpieTooth { | |||
90 | if ( btDevice ) { | 90 | if ( btDevice ) { |
91 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); | 91 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); |
92 | delete btDevice; | 92 | delete btDevice; |
93 | } | 93 | } |
94 | if ( btManager ) { | 94 | if ( btManager ) { |
95 | delete btManager; | 95 | delete btManager; |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | int BluezApplet::position() | 99 | int BluezApplet::position() |
100 | { | 100 | { |
101 | return 6; | 101 | return 6; |
102 | } | 102 | } |
103 | 103 | ||
104 | 104 | ||
105 | bool BluezApplet::checkBluezStatus() { | 105 | bool BluezApplet::checkBluezStatus() { |
106 | if (btDevice) { | 106 | if (btDevice) { |
107 | if (btDevice->isLoaded() ) { | 107 | if (btDevice->isLoaded() ) { |
108 | odebug << "btDevice isLoaded" << oendl; | 108 | odebug << "btDevice isLoaded" << oendl; |
109 | return true; | 109 | return true; |
110 | } else { | 110 | } else { |
111 | odebug << "btDevice is NOT loaded" << oendl; | 111 | odebug << "btDevice is NOT loaded" << oendl; |
112 | return false; | 112 | return false; |
113 | } | 113 | } |
114 | } else { | 114 | } else { |
115 | odebug << "btDevice is ZERO" << oendl; | 115 | odebug << "btDevice is ZERO" << oendl; |
116 | return false; | 116 | return false; |
117 | } | 117 | } |
118 | } | 118 | } |
119 | 119 | ||
120 | int BluezApplet::setBluezStatus(int c, bool sync) { | 120 | int BluezApplet::setBluezStatus(int c, bool sync) { |
121 | 121 | ||
122 | if ( c == 1 ) { | 122 | if ( c == 1 ) { |
123 | switch ( ODevice::inst()->model() ) { | 123 | switch ( ODevice::inst()->model() ) { |
124 | case Model_iPAQ_H39xx: | 124 | case Model_iPAQ_H39xx: |
125 | btDevice = new Device( "/dev/tts/1", "bcsp", "921600" ); | 125 | btDevice = new Device( "/dev/tts/1", "bcsp", "921600" ); |
126 | break; | 126 | break; |
127 | 127 | ||
128 | case Model_iPAQ_H5xxx: | 128 | case Model_iPAQ_H5xxx: |
129 | btDevice = new Device( "/dev/tts/1", "any", "921600" ); | 129 | btDevice = new Device( "/dev/tts/1", "any", "921600" ); |
130 | break; | 130 | break; |
131 | 131 | ||
132 | #if OPIE_VERSION >= 102010 | 132 | #if OPIE_VERSION >= 102010 |
133 | case Model_MyPal_716: | 133 | case Model_MyPal_716: |
134 | btDevice = new Device( "/dev/ttyS1", "bcsp", "921600" ); | 134 | btDevice = new Device( "/dev/ttyS1", "bcsp", "921600" ); |
135 | break; | 135 | break; |
136 | #endif | 136 | #endif |
137 | 137 | ||
138 | case Model_iPAQ_H22xx: | ||
139 | btDevice = new Device( "/dev/tts/3", "any", "921600" ); | ||
140 | break; | ||
141 | |||
138 | default: | 142 | default: |
139 | btDevice = new Device( "/dev/ttySB0", "bcsp", "230400" ); | 143 | btDevice = new Device( "/dev/ttySB0", "bcsp", "230400" ); |
140 | break; | 144 | break; |
141 | } | 145 | } |
142 | m_sync = sync; | 146 | m_sync = sync; |
143 | connect(btDevice, SIGNAL(device(const QString&, bool)), | 147 | connect(btDevice, SIGNAL(device(const QString&, bool)), |
144 | this, SLOT(slotDevice(const QString&, bool))); | 148 | this, SLOT(slotDevice(const QString&, bool))); |
145 | 149 | ||
146 | } else { | 150 | } else { |
147 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); | 151 | ::system("/etc/init.d/bluetooth stop >/dev/null 2>/dev/null"); |
148 | if ( btManager ) { | 152 | if ( btManager ) { |
149 | delete btManager; | 153 | delete btManager; |
150 | btManager = 0; | 154 | btManager = 0; |
151 | } | 155 | } |
152 | if ( btDevice ) { | 156 | if ( btDevice ) { |
153 | delete btDevice; | 157 | delete btDevice; |
154 | btDevice = 0; | 158 | btDevice = 0; |
155 | } | 159 | } |
156 | } | 160 | } |
157 | return 0; | 161 | return 0; |
158 | } | 162 | } |
159 | 163 | ||
160 | int BluezApplet::checkBluezDiscoveryStatus() { | 164 | int BluezApplet::checkBluezDiscoveryStatus() { |
161 | return isScanning; | 165 | return isScanning; |
162 | } | 166 | } |
163 | 167 | ||
164 | int BluezApplet::setBluezDiscoveryStatus(int d) { | 168 | int BluezApplet::setBluezDiscoveryStatus(int d) { |
165 | return bluezDiscoveryActive = d; | 169 | return bluezDiscoveryActive = d; |
166 | } | 170 | } |
167 | 171 | ||
168 | // FIXME mbhaynie | 172 | // FIXME mbhaynie |
169 | // receiver for QCopChannel("QPE/Bluetooth") messages. | 173 | // receiver for QCopChannel("QPE/Bluetooth") messages. |
170 | void BluezApplet::slotMessage( const QCString& str, const QByteArray& ) | 174 | void BluezApplet::slotMessage( const QCString& str, const QByteArray& ) |
171 | { | 175 | { |
172 | if ( str == "enableBluetooth()") { | 176 | if ( str == "enableBluetooth()") { |
173 | m_wasOn = checkBluezStatus(); | 177 | m_wasOn = checkBluezStatus(); |
174 | if (!m_wasOn) { | 178 | if (!m_wasOn) { |
175 | setBluezStatus(1, true); | 179 | setBluezStatus(1, true); |
176 | sleep(2); | 180 | sleep(2); |
177 | } | 181 | } |
178 | } | 182 | } |
179 | else if ( str == "disableBluetooth()") { | 183 | else if ( str == "disableBluetooth()") { |
180 | /* | 184 | /* |
181 | * We can down BT only if it was started by qcop. We don't want | 185 | * We can down BT only if it was started by qcop. We don't want |
182 | * to down BT started from menu an break our networking connection | 186 | * to down BT started from menu an break our networking connection |
183 | */ | 187 | */ |
184 | if (checkBluezStatus() && !m_wasOn) | 188 | if (checkBluezStatus() && !m_wasOn) |
185 | setBluezStatus(0); | 189 | setBluezStatus(0); |