Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Share Your Creations
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Share Your Creations Show your developed application to Basic4ppc community. Please include source code if possible.

Bluetooth Serial Port communication program for the PDA.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-26-2009, 07:20 AM
pdablue's Avatar
Senior Member
 
Join Date: Sep 2007
Posts: 114
Arrow Bluetooth Serial Port communication program for the PDA.

Hi,

This program allows you to transmit ASCII characters from your PDA
to an external Bluetooth module. You can send one character at a time
or you can create your own string of characters to be tranmitted.

The program has buttons to support the individual transmission of both
Upper case and Lower Case alphabetic characters ( A - Z ) and ( a - z ).

The program has buttons to transmit the numeric characters ( 0 - 9 ).

The program has buttons to transmit 24 special characters.

You can create your own character strings by tapping the Stylus in the
TX window to move the focus to the TX textbox and use the (S.I.P)
Soft Input Panel keyboard to enter your text string, then press the
"Send TX" button to transmit the entire string at once.

I used the BlueSmiRF Bluetooth module in "Loop-Back" mode to test this program.
"Loop-Back" mode is the TX line connected to the RX line, on the Bluetooth module.

In the program "Bluetooth SPP", the Green textbox is the TX (transmit) window and the
Yellow textbox is the RX (receive) window.

The file "BSP3.JPG" is the screenshot view of the program.
The file "Bluesp3.sbp" is the Basic4ppc source code for the program.
The file "BlueSPPzip.zip" is the zipped up ARMV4 (.CAB) installation file.
Attached Images
File Type: jpg BSP3.JPG (24.8 KB, 50 views)
Attached Files
File Type: sbp Bluesp3.sbp (23.4 KB, 91 views)
File Type: zip BlueSPPzip.zip (54.4 KB, 79 views)

Last edited by pdablue : 03-30-2009 at 03:19 PM. Reason: Recompiled the program to use the Serial2.dll.
Reply With Quote
  #2 (permalink)  
Old 03-27-2009, 05:49 PM
taximania's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 592
Awards Showcase
Beta Tester 
Total Awards: 1
Default

You don't need seperate subs for every button.

Do a search of the help file for the 'Control' keyword.
I'll try to knock up a quick example of what i'm on about.
__________________
.
.
.
Don't ask, I'm fine, honest. !!
.
.
.
Just a little crazy at times



O2 XDA, GW Evo 2.1 UC WWE Rom, WM6.1
Radio Ver 03.34.90
With Basic4ppc V6.80


http://www.taximania.co.uk

Last edited by taximania : 03-27-2009 at 05:53 PM.
Reply With Quote
  #3 (permalink)  
Old 03-27-2009, 06:35 PM
taximania's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 592
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Here's a taster. Name all your Buttons - Button1, Button2, Button3 etc.
Add a click event for each button as shown here.
Code:
For a = 1 To <u><i>number of buttons</i></u>
AddEvent(
"Button" & a,Click, "Btn_Click")
Next a
Your single Button click sub is as below.
Code:
Sub Btn_Click
a=
Sender.text
End Sub
variable 'a' now holds the 'text' of the button that was clicked.

By using the 'Control' keyword you can access other properties from
the Button eg:
Code:
x=10
Control(
"Button" & x).Text="Hi"
This would alter the text of Button10 to 'Hi'

Hope I've made sense here ;-)
__________________
.
.
.
Don't ask, I'm fine, honest. !!
.
.
.
Just a little crazy at times



O2 XDA, GW Evo 2.1 UC WWE Rom, WM6.1
Radio Ver 03.34.90
With Basic4ppc V6.80


http://www.taximania.co.uk
Reply With Quote
  #4 (permalink)  
Old 03-30-2009, 02:45 PM
pdablue's Avatar
Senior Member
 
Join Date: Sep 2007
Posts: 114
Default

Thanks for the programming tips.

I will have to try some of these out and see how they work.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bluetooth communication hung Questions (Windows Mobile) 1 03-09-2009 05:10 PM
Serial communication - problems with reading token Questions (Windows Mobile) 11 02-19-2009 01:51 PM
trouble with serial communication Joe08 Questions (Windows Mobile) 5 12-03-2008 11:29 AM
Serial Port Profile & Bluetooth Paul Questions (Windows Mobile) 5 07-27-2007 04:08 PM
Open serial port crashes program on device Steve Bug Reports 2 05-23-2007 09:52 PM


All times are GMT. The time now is 12:12 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0