Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Orbforms tell if device has Bluetooth?

Orbforms tell if device has Bluetooth?

Discuss OrbForms Designer and PocketC Architect

Postby md10bldr on Fri Oct 28, 2005 8:42 pm

Hello -
Is there any way to tell if a given device has Bluetooth capability? I've written myself a small app to provide a simple "terminal" type serial interface between my palm and other selectronic devices via cable, IR, or BT. However, in the course of testing on an older non-BT equiped device, I find that selecting the BT option on an old Palm IIIxe causes a fatal exception. While I can obviously compile a different version with the BT routine disabled, it got me thinking about whether it's possible in orbforms to determine the available functions such as BT, WiFi, etc. How about OS revision? While things such as color depth could provide a clue, maybe someone has else has dealt with this issue and can offer some advice?
Thanks!
md10bldr
 
Posts: 17
Joined: Wed Dec 04, 2002 6:55 pm

Postby dewey on Tue Nov 08, 2005 4:41 am

For BT, you can tell if the device supports BT by attempting to open the serRfComm serial port. As you've pointed out, this crashes on a Palm IIIxe. The reason for this is that it doesn't support the new serial manager, since it has an OS < 3.3. To handle this, check the OS version first.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby md10bldr on Tue Nov 08, 2005 8:56 pm

Thanks for the feedback. I guess my question is a little more global -
How could I code my app to check to see if bluetooth is supported; that way I could make sure the app did not even offer the bluetooth selection to the user. There are devices that do not have bluetooth, yet have greater than OS 3.3. I guess differnt versions, or simply warning a potential user that selecting bluetooth on a non bluetooth device will crash it, is the solution.

Thanks.
md10bldr
 
Posts: 17
Joined: Wed Dec 04, 2002 6:55 pm

Postby dewey on Wed Nov 09, 2005 2:52 am

bool HasBluetooth() {
Serial serial;
// see if OS 3.3 or higher
if (osver() < 0x03030000) return false;
// try to open the port
if (ser.open(serRfComm, 576000)) {
ser.close();
return true;
}
return false;
}

Opening the BT port will only crash on OS < 3.3, so the above function is always safe to use.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby md10bldr on Mon Nov 14, 2005 6:16 pm

Dewey -
Doh!. I guess that's exactly what you said in your previous reply. Seriously though, thanks for your help, and patience with newbie questions. I guess I really need to work on getting my head around the "build you own function" concept with orbforms & C/C++.
md10bldr
 
Posts: 17
Joined: Wed Dec 04, 2002 6:55 pm


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 2 guests

cron